mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-24 18:39:34 +03:00
Fix cstyle warnings
This patch contains no functional changes. It is solely intended to resolve cstyle warnings in order to facilitate moving the spl source code in to the zfs repository. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #681
This commit is contained in:
parent
23602fdb39
commit
5461eefe50
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_FS_FS_SUBR_H
|
||||
#define _SPL_FS_FS_SUBR_H
|
||||
#define _SPL_FS_FS_SUBR_H
|
||||
|
||||
#endif /* SPL_FS_FS_SUBR_H */
|
||||
|
@ -26,6 +26,7 @@
|
||||
#define _SPL_MATH64_COMPAT_H
|
||||
|
||||
#ifndef abs64
|
||||
/* CSTYLED */
|
||||
#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
|
||||
#endif
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RPC_TYPES_H
|
||||
#define _SPL_RPC_TYPES_H
|
||||
#define _SPL_RPC_TYPES_H
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RPC_XDR_H
|
||||
#define _SPL_RPC_XDR_H
|
||||
#define _SPL_RPC_XDR_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <rpc/types.h>
|
||||
@ -36,11 +36,10 @@ enum xdr_op {
|
||||
struct xdr_ops;
|
||||
|
||||
typedef struct {
|
||||
struct xdr_ops *x_ops; /* Also used to let caller know if
|
||||
xdrmem_create() succeeds (sigh..) */
|
||||
caddr_t x_addr; /* Current buffer addr */
|
||||
caddr_t x_addr_end; /* End of the buffer */
|
||||
enum xdr_op x_op; /* Stream direction */
|
||||
struct xdr_ops *x_ops; /* Let caller know xdrmem_create() succeeds */
|
||||
caddr_t x_addr; /* Current buffer addr */
|
||||
caddr_t x_addr_end; /* End of the buffer */
|
||||
enum xdr_op x_op; /* Stream direction */
|
||||
} XDR;
|
||||
|
||||
typedef bool_t (*xdrproc_t)(XDR *xdrs, void *ptr);
|
||||
@ -56,13 +55,13 @@ struct xdr_ops {
|
||||
bool_t (*xdr_opaque)(XDR *, caddr_t, const uint_t);
|
||||
bool_t (*xdr_string)(XDR *, char **, const uint_t);
|
||||
bool_t (*xdr_array)(XDR *, caddr_t *, uint_t *, const uint_t,
|
||||
const uint_t, const xdrproc_t);
|
||||
const uint_t, const xdrproc_t);
|
||||
};
|
||||
|
||||
/*
|
||||
* XDR control operator.
|
||||
*/
|
||||
#define XDR_GET_BYTES_AVAIL 1
|
||||
#define XDR_GET_BYTES_AVAIL 1
|
||||
|
||||
struct xdr_bytesrec {
|
||||
bool_t xc_is_last_record;
|
||||
@ -74,11 +73,12 @@ struct xdr_bytesrec {
|
||||
*/
|
||||
void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size,
|
||||
const enum xdr_op op);
|
||||
#define xdr_destroy(xdrs) ((void) 0) /* Currently not needed. If needed later,
|
||||
we'll add it to struct xdr_ops */
|
||||
|
||||
#define xdr_control(xdrs, req, info) (xdrs)->x_ops->xdr_control((xdrs), \
|
||||
(req), (info))
|
||||
/* Currently not needed. If needed later, we'll add it to struct xdr_ops */
|
||||
#define xdr_destroy(xdrs) ((void) 0)
|
||||
|
||||
#define xdr_control(xdrs, req, info) \
|
||||
(xdrs)->x_ops->xdr_control((xdrs), (req), (info))
|
||||
|
||||
/*
|
||||
* For precaution, the following are defined as static inlines instead of macros
|
||||
@ -89,40 +89,40 @@ void xdrmem_create(XDR *xdrs, const caddr_t addr, const uint_t size,
|
||||
*/
|
||||
static inline bool_t xdr_char(XDR *xdrs, char *cp)
|
||||
{
|
||||
return xdrs->x_ops->xdr_char(xdrs, cp);
|
||||
return (xdrs->x_ops->xdr_char(xdrs, cp));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_u_short(XDR *xdrs, unsigned short *usp)
|
||||
{
|
||||
return xdrs->x_ops->xdr_u_short(xdrs, usp);
|
||||
return (xdrs->x_ops->xdr_u_short(xdrs, usp));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_short(XDR *xdrs, short *sp)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(short) != 2);
|
||||
return xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp);
|
||||
BUILD_BUG_ON(sizeof (short) != 2);
|
||||
return (xdrs->x_ops->xdr_u_short(xdrs, (unsigned short *) sp));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_u_int(XDR *xdrs, unsigned *up)
|
||||
{
|
||||
return xdrs->x_ops->xdr_u_int(xdrs, up);
|
||||
return (xdrs->x_ops->xdr_u_int(xdrs, up));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_int(XDR *xdrs, int *ip)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(int) != 4);
|
||||
return xdrs->x_ops->xdr_u_int(xdrs, (unsigned *) ip);
|
||||
BUILD_BUG_ON(sizeof (int) != 4);
|
||||
return (xdrs->x_ops->xdr_u_int(xdrs, (unsigned *)ip));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp)
|
||||
{
|
||||
return xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp);
|
||||
return (xdrs->x_ops->xdr_u_longlong_t(xdrs, ullp));
|
||||
}
|
||||
|
||||
static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(longlong_t) != 8);
|
||||
return xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *) llp);
|
||||
BUILD_BUG_ON(sizeof (longlong_t) != 8);
|
||||
return (xdrs->x_ops->xdr_u_longlong_t(xdrs, (u_longlong_t *)llp));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -130,7 +130,7 @@ static inline bool_t xdr_longlong_t(XDR *xdrs, longlong_t *llp)
|
||||
*/
|
||||
static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt)
|
||||
{
|
||||
return xdrs->x_ops->xdr_opaque(xdrs, cp, cnt);
|
||||
return (xdrs->x_ops->xdr_opaque(xdrs, cp, cnt));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -139,7 +139,7 @@ static inline bool_t xdr_opaque(XDR *xdrs, caddr_t cp, const uint_t cnt)
|
||||
*/
|
||||
static inline bool_t xdr_string(XDR *xdrs, char **sp, const uint_t maxsize)
|
||||
{
|
||||
return xdrs->x_ops->xdr_string(xdrs, sp, maxsize);
|
||||
return (xdrs->x_ops->xdr_string(xdrs, sp, maxsize));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SHARE_H
|
||||
#define _SPL_SHARE_H
|
||||
#define _SPL_SHARE_H
|
||||
|
||||
#endif /* SPL_SHARE_H */
|
||||
|
@ -23,23 +23,23 @@
|
||||
*/
|
||||
|
||||
#ifndef _DEBUG_CTL_H
|
||||
#define _DEBUG_CTL_H
|
||||
#define _DEBUG_CTL_H
|
||||
|
||||
/*
|
||||
* Contains shared definitions which both the user space
|
||||
* and kernel space portions of splat must agree on.
|
||||
*/
|
||||
typedef struct spl_debug_header {
|
||||
int ph_len;
|
||||
int ph_flags;
|
||||
int ph_subsys;
|
||||
int ph_mask;
|
||||
int ph_cpu_id;
|
||||
int ph_sec;
|
||||
long ph_usec;
|
||||
int ph_stack;
|
||||
int ph_pid;
|
||||
int ph_line_num;
|
||||
int ph_len;
|
||||
int ph_flags;
|
||||
int ph_subsys;
|
||||
int ph_mask;
|
||||
int ph_cpu_id;
|
||||
int ph_sec;
|
||||
long ph_usec;
|
||||
int ph_stack;
|
||||
int ph_pid;
|
||||
int ph_line_num;
|
||||
} spl_debug_header_t;
|
||||
|
||||
#endif /* _DEBUG_CTL_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPLAT_CTL_H
|
||||
#define _SPLAT_CTL_H
|
||||
#define _SPLAT_CTL_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
@ -32,11 +32,11 @@
|
||||
* ensure 32-bit/64-bit interoperability over ioctl()'s only types with
|
||||
* fixed sizes can be used.
|
||||
*/
|
||||
#define SPLAT_NAME "splatctl"
|
||||
#define SPLAT_DEV "/dev/splatctl"
|
||||
#define SPLAT_NAME "splatctl"
|
||||
#define SPLAT_DEV "/dev/splatctl"
|
||||
|
||||
#define SPLAT_NAME_SIZE 20
|
||||
#define SPLAT_DESC_SIZE 60
|
||||
#define SPLAT_NAME_SIZE 20
|
||||
#define SPLAT_DESC_SIZE 60
|
||||
|
||||
typedef struct splat_user {
|
||||
char name[SPLAT_NAME_SIZE]; /* Short name */
|
||||
@ -72,38 +72,38 @@ typedef struct splat_cmd {
|
||||
} splat_cmd_t;
|
||||
|
||||
/* Valid ioctls */
|
||||
#define SPLAT_CFG _IOWR('f', 101, splat_cfg_t)
|
||||
#define SPLAT_CMD _IOWR('f', 102, splat_cmd_t)
|
||||
#define SPLAT_CFG _IOWR('f', 101, splat_cfg_t)
|
||||
#define SPLAT_CMD _IOWR('f', 102, splat_cmd_t)
|
||||
|
||||
/* Valid configuration commands */
|
||||
#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
|
||||
#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
|
||||
#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
|
||||
#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
|
||||
#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
|
||||
#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
|
||||
#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
|
||||
#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
|
||||
#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
|
||||
#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
|
||||
#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
|
||||
#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
|
||||
|
||||
/*
|
||||
* Valid subsystem and test commands are defined in each subsystem as
|
||||
* SPLAT_SUBSYSTEM_*. We do need to be careful to avoid collisions, the
|
||||
* currently defined subsystems are as follows:
|
||||
*/
|
||||
#define SPLAT_SUBSYSTEM_KMEM 0x0100
|
||||
#define SPLAT_SUBSYSTEM_TASKQ 0x0200
|
||||
#define SPLAT_SUBSYSTEM_KRNG 0x0300
|
||||
#define SPLAT_SUBSYSTEM_MUTEX 0x0400
|
||||
#define SPLAT_SUBSYSTEM_CONDVAR 0x0500
|
||||
#define SPLAT_SUBSYSTEM_THREAD 0x0600
|
||||
#define SPLAT_SUBSYSTEM_RWLOCK 0x0700
|
||||
#define SPLAT_SUBSYSTEM_TIME 0x0800
|
||||
#define SPLAT_SUBSYSTEM_VNODE 0x0900
|
||||
#define SPLAT_SUBSYSTEM_KOBJ 0x0a00
|
||||
#define SPLAT_SUBSYSTEM_ATOMIC 0x0b00
|
||||
#define SPLAT_SUBSYSTEM_LIST 0x0c00
|
||||
#define SPLAT_SUBSYSTEM_GENERIC 0x0d00
|
||||
#define SPLAT_SUBSYSTEM_CRED 0x0e00
|
||||
#define SPLAT_SUBSYSTEM_ZLIB 0x0f00
|
||||
#define SPLAT_SUBSYSTEM_LINUX 0x1000
|
||||
#define SPLAT_SUBSYSTEM_UNKNOWN 0xff00
|
||||
#define SPLAT_SUBSYSTEM_KMEM 0x0100
|
||||
#define SPLAT_SUBSYSTEM_TASKQ 0x0200
|
||||
#define SPLAT_SUBSYSTEM_KRNG 0x0300
|
||||
#define SPLAT_SUBSYSTEM_MUTEX 0x0400
|
||||
#define SPLAT_SUBSYSTEM_CONDVAR 0x0500
|
||||
#define SPLAT_SUBSYSTEM_THREAD 0x0600
|
||||
#define SPLAT_SUBSYSTEM_RWLOCK 0x0700
|
||||
#define SPLAT_SUBSYSTEM_TIME 0x0800
|
||||
#define SPLAT_SUBSYSTEM_VNODE 0x0900
|
||||
#define SPLAT_SUBSYSTEM_KOBJ 0x0a00
|
||||
#define SPLAT_SUBSYSTEM_ATOMIC 0x0b00
|
||||
#define SPLAT_SUBSYSTEM_LIST 0x0c00
|
||||
#define SPLAT_SUBSYSTEM_GENERIC 0x0d00
|
||||
#define SPLAT_SUBSYSTEM_CRED 0x0e00
|
||||
#define SPLAT_SUBSYSTEM_ZLIB 0x0f00
|
||||
#define SPLAT_SUBSYSTEM_LINUX 0x1000
|
||||
#define SPLAT_SUBSYSTEM_UNKNOWN 0xff00
|
||||
|
||||
#endif /* _SPLAT_CTL_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_STRINGS_H
|
||||
#define _SPL_STRINGS_H
|
||||
#define _SPL_STRINGS_H
|
||||
|
||||
#endif /* SPL_STRINGS_H */
|
||||
|
@ -23,95 +23,97 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ACL_H
|
||||
#define _SPL_ACL_H
|
||||
#define _SPL_ACL_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct ace {
|
||||
uid_t a_who;
|
||||
uint32_t a_access_mask;
|
||||
uint16_t a_flags;
|
||||
uint16_t a_type;
|
||||
uid_t a_who;
|
||||
uint32_t a_access_mask;
|
||||
uint16_t a_flags;
|
||||
uint16_t a_type;
|
||||
} ace_t;
|
||||
|
||||
typedef struct ace_object {
|
||||
uid_t a_who; /* uid or gid */
|
||||
uint32_t a_access_mask; /* read,write,... */
|
||||
uint16_t a_flags; /* see below */
|
||||
uint16_t a_type; /* allow or deny */
|
||||
uint8_t a_obj_type[16]; /* obj type */
|
||||
uint8_t a_inherit_obj_type[16]; /* inherit obj */
|
||||
uid_t a_who; /* uid or gid */
|
||||
uint32_t a_access_mask; /* read,write,... */
|
||||
uint16_t a_flags; /* see below */
|
||||
uint16_t a_type; /* allow or deny */
|
||||
uint8_t a_obj_type[16]; /* obj type */
|
||||
uint8_t a_inherit_obj_type[16]; /* inherit obj */
|
||||
} ace_object_t;
|
||||
|
||||
#define MAX_ACL_ENTRIES 1024
|
||||
#define MAX_ACL_ENTRIES 1024
|
||||
|
||||
#define ACE_READ_DATA 0x00000001
|
||||
#define ACE_LIST_DIRECTORY 0x00000001
|
||||
#define ACE_WRITE_DATA 0x00000002
|
||||
#define ACE_ADD_FILE 0x00000002
|
||||
#define ACE_APPEND_DATA 0x00000004
|
||||
#define ACE_ADD_SUBDIRECTORY 0x00000004
|
||||
#define ACE_READ_NAMED_ATTRS 0x00000008
|
||||
#define ACE_WRITE_NAMED_ATTRS 0x00000010
|
||||
#define ACE_EXECUTE 0x00000020
|
||||
#define ACE_DELETE_CHILD 0x00000040
|
||||
#define ACE_READ_ATTRIBUTES 0x00000080
|
||||
#define ACE_WRITE_ATTRIBUTES 0x00000100
|
||||
#define ACE_DELETE 0x00010000
|
||||
#define ACE_READ_ACL 0x00020000
|
||||
#define ACE_WRITE_ACL 0x00040000
|
||||
#define ACE_WRITE_OWNER 0x00080000
|
||||
#define ACE_SYNCHRONIZE 0x00100000
|
||||
#define ACE_READ_DATA 0x00000001
|
||||
#define ACE_LIST_DIRECTORY 0x00000001
|
||||
#define ACE_WRITE_DATA 0x00000002
|
||||
#define ACE_ADD_FILE 0x00000002
|
||||
#define ACE_APPEND_DATA 0x00000004
|
||||
#define ACE_ADD_SUBDIRECTORY 0x00000004
|
||||
#define ACE_READ_NAMED_ATTRS 0x00000008
|
||||
#define ACE_WRITE_NAMED_ATTRS 0x00000010
|
||||
#define ACE_EXECUTE 0x00000020
|
||||
#define ACE_DELETE_CHILD 0x00000040
|
||||
#define ACE_READ_ATTRIBUTES 0x00000080
|
||||
#define ACE_WRITE_ATTRIBUTES 0x00000100
|
||||
#define ACE_DELETE 0x00010000
|
||||
#define ACE_READ_ACL 0x00020000
|
||||
#define ACE_WRITE_ACL 0x00040000
|
||||
#define ACE_WRITE_OWNER 0x00080000
|
||||
#define ACE_SYNCHRONIZE 0x00100000
|
||||
|
||||
#define ACE_FILE_INHERIT_ACE 0x0001
|
||||
#define ACE_DIRECTORY_INHERIT_ACE 0x0002
|
||||
#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004
|
||||
#define ACE_INHERIT_ONLY_ACE 0x0008
|
||||
#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010
|
||||
#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020
|
||||
#define ACE_IDENTIFIER_GROUP 0x0040
|
||||
#define ACE_INHERITED_ACE 0x0080
|
||||
#define ACE_OWNER 0x1000
|
||||
#define ACE_GROUP 0x2000
|
||||
#define ACE_EVERYONE 0x4000
|
||||
#define ACE_FILE_INHERIT_ACE 0x0001
|
||||
#define ACE_DIRECTORY_INHERIT_ACE 0x0002
|
||||
#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004
|
||||
#define ACE_INHERIT_ONLY_ACE 0x0008
|
||||
#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010
|
||||
#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020
|
||||
#define ACE_IDENTIFIER_GROUP 0x0040
|
||||
#define ACE_INHERITED_ACE 0x0080
|
||||
#define ACE_OWNER 0x1000
|
||||
#define ACE_GROUP 0x2000
|
||||
#define ACE_EVERYONE 0x4000
|
||||
|
||||
#define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000
|
||||
#define ACE_ACCESS_DENIED_ACE_TYPE 0x0001
|
||||
#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002
|
||||
#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003
|
||||
#define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000
|
||||
#define ACE_ACCESS_DENIED_ACE_TYPE 0x0001
|
||||
#define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002
|
||||
#define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003
|
||||
|
||||
#define ACL_AUTO_INHERIT 0x0001
|
||||
#define ACL_PROTECTED 0x0002
|
||||
#define ACL_DEFAULTED 0x0004
|
||||
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED)
|
||||
#define ACL_AUTO_INHERIT 0x0001
|
||||
#define ACL_PROTECTED 0x0002
|
||||
#define ACL_DEFAULTED 0x0004
|
||||
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED|ACL_DEFAULTED)
|
||||
|
||||
#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04
|
||||
#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05
|
||||
#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06
|
||||
#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07
|
||||
#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08
|
||||
#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09
|
||||
#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A
|
||||
#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B
|
||||
#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C
|
||||
#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D
|
||||
#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E
|
||||
#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F
|
||||
#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10
|
||||
#define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04
|
||||
#define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05
|
||||
#define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06
|
||||
#define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07
|
||||
#define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08
|
||||
#define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09
|
||||
#define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A
|
||||
#define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B
|
||||
#define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C
|
||||
#define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D
|
||||
#define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E
|
||||
#define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F
|
||||
#define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10
|
||||
|
||||
#define ACE_ALL_TYPES 0x001F
|
||||
#define ACE_ALL_TYPES 0x001F
|
||||
|
||||
#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP)
|
||||
#define ACE_TYPE_FLAGS (ACE_OWNER|ACE_GROUP|ACE_EVERYONE|ACE_IDENTIFIER_GROUP)
|
||||
|
||||
#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
|
||||
/* BEGIN CSTYLED */
|
||||
#define ACE_ALL_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
|
||||
ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
|
||||
ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
|
||||
ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
|
||||
ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
|
||||
/* END CSTYLED */
|
||||
|
||||
#define VSA_ACE 0x0010
|
||||
#define VSA_ACECNT 0x0020
|
||||
#define VSA_ACE_ALLTYPES 0x0040
|
||||
#define VSA_ACE_ACLFLAGS 0x0080
|
||||
#define VSA_ACE 0x0010
|
||||
#define VSA_ACECNT 0x0020
|
||||
#define VSA_ACE_ALLTYPES 0x0040
|
||||
#define VSA_ACE_ACLFLAGS 0x0080
|
||||
|
||||
#endif /* _SPL_ACL_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ACL_IMPL_H
|
||||
#define _SPL_ACL_IMPL_H
|
||||
#define _SPL_ACL_IMPL_H
|
||||
|
||||
#endif /* _SPL_ACL_IMPL_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ATOMIC_H
|
||||
#define _SPL_ATOMIC_H
|
||||
#define _SPL_ATOMIC_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/spinlock.h>
|
||||
@ -91,7 +91,7 @@ atomic_inc_32_nv(volatile uint32_t *target)
|
||||
nv = ++(*target);
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t
|
||||
@ -103,7 +103,7 @@ atomic_dec_32_nv(volatile uint32_t *target)
|
||||
nv = --(*target);
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t
|
||||
@ -116,7 +116,7 @@ atomic_add_32_nv(volatile uint32_t *target, uint32_t delta)
|
||||
nv = *target;
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t
|
||||
@ -129,12 +129,11 @@ atomic_sub_32_nv(volatile uint32_t *target, uint32_t delta)
|
||||
nv = *target;
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t
|
||||
atomic_cas_32(volatile uint32_t *target, uint32_t cmp,
|
||||
uint32_t newval)
|
||||
atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval)
|
||||
{
|
||||
uint32_t rc;
|
||||
|
||||
@ -145,7 +144,7 @@ atomic_cas_32(volatile uint32_t *target, uint32_t cmp,
|
||||
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return rc;
|
||||
return (rc);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t
|
||||
@ -158,7 +157,7 @@ atomic_swap_32(volatile uint32_t *target, uint32_t newval)
|
||||
*target = newval;
|
||||
spin_unlock(&atomic32_lock);
|
||||
|
||||
return rc;
|
||||
return (rc);
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
@ -202,7 +201,7 @@ atomic_inc_64_nv(volatile uint64_t *target)
|
||||
nv = ++(*target);
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
@ -214,7 +213,7 @@ atomic_dec_64_nv(volatile uint64_t *target)
|
||||
nv = --(*target);
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
@ -227,7 +226,7 @@ atomic_add_64_nv(volatile uint64_t *target, uint64_t delta)
|
||||
nv = *target;
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
@ -240,12 +239,11 @@ atomic_sub_64_nv(volatile uint64_t *target, uint64_t delta)
|
||||
nv = *target;
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return nv;
|
||||
return (nv);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
atomic_cas_64(volatile uint64_t *target, uint64_t cmp,
|
||||
uint64_t newval)
|
||||
atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval)
|
||||
{
|
||||
uint64_t rc;
|
||||
|
||||
@ -255,7 +253,7 @@ atomic_cas_64(volatile uint64_t *target, uint64_t cmp,
|
||||
*target = newval;
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return rc;
|
||||
return (rc);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
@ -268,31 +266,31 @@ atomic_swap_64(volatile uint64_t *target, uint64_t newval)
|
||||
*target = newval;
|
||||
spin_unlock(&atomic64_lock);
|
||||
|
||||
return rc;
|
||||
return (rc);
|
||||
}
|
||||
|
||||
#else /* ATOMIC_SPINLOCK */
|
||||
|
||||
#define atomic_inc_32(v) atomic_inc((atomic_t *)(v))
|
||||
#define atomic_dec_32(v) atomic_dec((atomic_t *)(v))
|
||||
#define atomic_add_32(v, i) atomic_add((i), (atomic_t *)(v))
|
||||
#define atomic_sub_32(v, i) atomic_sub((i), (atomic_t *)(v))
|
||||
#define atomic_inc_32_nv(v) atomic_inc_return((atomic_t *)(v))
|
||||
#define atomic_dec_32_nv(v) atomic_dec_return((atomic_t *)(v))
|
||||
#define atomic_add_32_nv(v, i) atomic_add_return((i), (atomic_t *)(v))
|
||||
#define atomic_sub_32_nv(v, i) atomic_sub_return((i), (atomic_t *)(v))
|
||||
#define atomic_cas_32(v, x, y) atomic_cmpxchg((atomic_t *)(v), x, y)
|
||||
#define atomic_swap_32(v, x) atomic_xchg((atomic_t *)(v), x)
|
||||
#define atomic_inc_64(v) atomic64_inc((atomic64_t *)(v))
|
||||
#define atomic_dec_64(v) atomic64_dec((atomic64_t *)(v))
|
||||
#define atomic_add_64(v, i) atomic64_add((i), (atomic64_t *)(v))
|
||||
#define atomic_sub_64(v, i) atomic64_sub((i), (atomic64_t *)(v))
|
||||
#define atomic_inc_64_nv(v) atomic64_inc_return((atomic64_t *)(v))
|
||||
#define atomic_dec_64_nv(v) atomic64_dec_return((atomic64_t *)(v))
|
||||
#define atomic_add_64_nv(v, i) atomic64_add_return((i), (atomic64_t *)(v))
|
||||
#define atomic_sub_64_nv(v, i) atomic64_sub_return((i), (atomic64_t *)(v))
|
||||
#define atomic_cas_64(v, x, y) atomic64_cmpxchg((atomic64_t *)(v), x, y)
|
||||
#define atomic_swap_64(v, x) atomic64_xchg((atomic64_t *)(v), x)
|
||||
#define atomic_inc_32(v) atomic_inc((atomic_t *)(v))
|
||||
#define atomic_dec_32(v) atomic_dec((atomic_t *)(v))
|
||||
#define atomic_add_32(v, i) atomic_add((i), (atomic_t *)(v))
|
||||
#define atomic_sub_32(v, i) atomic_sub((i), (atomic_t *)(v))
|
||||
#define atomic_inc_32_nv(v) atomic_inc_return((atomic_t *)(v))
|
||||
#define atomic_dec_32_nv(v) atomic_dec_return((atomic_t *)(v))
|
||||
#define atomic_add_32_nv(v, i) atomic_add_return((i), (atomic_t *)(v))
|
||||
#define atomic_sub_32_nv(v, i) atomic_sub_return((i), (atomic_t *)(v))
|
||||
#define atomic_cas_32(v, x, y) atomic_cmpxchg((atomic_t *)(v), x, y)
|
||||
#define atomic_swap_32(v, x) atomic_xchg((atomic_t *)(v), x)
|
||||
#define atomic_inc_64(v) atomic64_inc((atomic64_t *)(v))
|
||||
#define atomic_dec_64(v) atomic64_dec((atomic64_t *)(v))
|
||||
#define atomic_add_64(v, i) atomic64_add((i), (atomic64_t *)(v))
|
||||
#define atomic_sub_64(v, i) atomic64_sub((i), (atomic64_t *)(v))
|
||||
#define atomic_inc_64_nv(v) atomic64_inc_return((atomic64_t *)(v))
|
||||
#define atomic_dec_64_nv(v) atomic64_dec_return((atomic64_t *)(v))
|
||||
#define atomic_add_64_nv(v, i) atomic64_add_return((i), (atomic64_t *)(v))
|
||||
#define atomic_sub_64_nv(v, i) atomic64_sub_return((i), (atomic64_t *)(v))
|
||||
#define atomic_cas_64(v, x, y) atomic64_cmpxchg((atomic64_t *)(v), x, y)
|
||||
#define atomic_swap_64(v, x) atomic64_xchg((atomic64_t *)(v), x)
|
||||
|
||||
#endif /* ATOMIC_SPINLOCK */
|
||||
|
||||
@ -300,15 +298,15 @@ atomic_swap_64(volatile uint64_t *target, uint64_t newval)
|
||||
static __inline__ void *
|
||||
atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
|
||||
{
|
||||
return (void *)atomic_cas_64((volatile uint64_t *)target,
|
||||
(uint64_t)cmp, (uint64_t)newval);
|
||||
return ((void *)atomic_cas_64((volatile uint64_t *)target,
|
||||
(uint64_t)cmp, (uint64_t)newval));
|
||||
}
|
||||
#else /* _LP64 */
|
||||
static __inline__ void *
|
||||
atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
|
||||
{
|
||||
return (void *)atomic_cas_32((volatile uint32_t *)target,
|
||||
(uint32_t)cmp, (uint32_t)newval);
|
||||
return ((void *)atomic_cas_32((volatile uint32_t *)target,
|
||||
(uint32_t)cmp, (uint32_t)newval));
|
||||
}
|
||||
#endif /* _LP64 */
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ATTR_H
|
||||
#define _SPL_ATTR_H
|
||||
#define _SPL_ATTR_H
|
||||
|
||||
#endif /* SPL_ATTR_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BITMAP_H
|
||||
#define _SPL_BITMAP_H
|
||||
#define _SPL_BITMAP_H
|
||||
|
||||
#endif /* SPL_BITMAP_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BOOTCONF_H
|
||||
#define _SPL_BOOTCONF_H
|
||||
#define _SPL_BOOTCONF_H
|
||||
|
||||
#endif /* SPL_BOOTCONF_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BOOTPROPS_H
|
||||
#define _SPL_BOOTPROPS_H
|
||||
#define _SPL_BOOTPROPS_H
|
||||
|
||||
#endif /* SPL_BOOTPROPS_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BUF_H
|
||||
#define _SPL_BUF_H
|
||||
#define _SPL_BUF_H
|
||||
|
||||
#endif /* SPL_BUF_H */
|
||||
|
@ -23,45 +23,49 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_BYTEORDER_H
|
||||
#define _SPL_BYTEORDER_H
|
||||
#define _SPL_BYTEORDER_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <sys/isa_defs.h>
|
||||
|
||||
#define LE_16(x) cpu_to_le16(x)
|
||||
#define LE_32(x) cpu_to_le32(x)
|
||||
#define LE_64(x) cpu_to_le64(x)
|
||||
#define BE_16(x) cpu_to_be16(x)
|
||||
#define BE_32(x) cpu_to_be32(x)
|
||||
#define BE_64(x) cpu_to_be64(x)
|
||||
#define LE_16(x) cpu_to_le16(x)
|
||||
#define LE_32(x) cpu_to_le32(x)
|
||||
#define LE_64(x) cpu_to_le64(x)
|
||||
#define BE_16(x) cpu_to_be16(x)
|
||||
#define BE_32(x) cpu_to_be32(x)
|
||||
#define BE_64(x) cpu_to_be64(x)
|
||||
|
||||
#define BE_IN8(xa) \
|
||||
#define BE_IN8(xa) \
|
||||
*((uint8_t *)(xa))
|
||||
|
||||
#define BE_IN16(xa) \
|
||||
#define BE_IN16(xa) \
|
||||
(((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1))
|
||||
|
||||
#define BE_IN32(xa) \
|
||||
#define BE_IN32(xa) \
|
||||
(((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
|
||||
|
||||
#ifdef _BIG_ENDIAN
|
||||
static __inline__ uint64_t
|
||||
htonll(uint64_t n) {
|
||||
htonll(uint64_t n)
|
||||
{
|
||||
return (n);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
ntohll(uint64_t n) {
|
||||
ntohll(uint64_t n)
|
||||
{
|
||||
return (n);
|
||||
}
|
||||
#else
|
||||
static __inline__ uint64_t
|
||||
htonll(uint64_t n) {
|
||||
htonll(uint64_t n)
|
||||
{
|
||||
return ((((uint64_t)htonl(n)) << 32) + htonl(n >> 32));
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
ntohll(uint64_t n) {
|
||||
ntohll(uint64_t n)
|
||||
{
|
||||
return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
|
||||
}
|
||||
#endif
|
||||
|
@ -23,33 +23,32 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CALLB_H
|
||||
#define _SPL_CALLB_H
|
||||
#define _SPL_CALLB_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp));
|
||||
#define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp));
|
||||
|
||||
typedef struct callb_cpr {
|
||||
kmutex_t *cc_lockp;
|
||||
kmutex_t *cc_lockp;
|
||||
} callb_cpr_t;
|
||||
|
||||
#define CALLB_CPR_INIT(cp, lockp, func, name) { \
|
||||
(cp)->cc_lockp = lockp; \
|
||||
#define CALLB_CPR_INIT(cp, lockp, func, name) { \
|
||||
(cp)->cc_lockp = lockp; \
|
||||
}
|
||||
|
||||
#define CALLB_CPR_SAFE_BEGIN(cp) { \
|
||||
#define CALLB_CPR_SAFE_BEGIN(cp) { \
|
||||
CALLB_CPR_ASSERT(cp); \
|
||||
}
|
||||
|
||||
#define CALLB_CPR_SAFE_END(cp, lockp) { \
|
||||
#define CALLB_CPR_SAFE_END(cp, lockp) { \
|
||||
CALLB_CPR_ASSERT(cp); \
|
||||
}
|
||||
|
||||
#define CALLB_CPR_EXIT(cp) { \
|
||||
ASSERT(MUTEX_HELD((cp)->cc_lockp)); \
|
||||
mutex_exit((cp)->cc_lockp); \
|
||||
#define CALLB_CPR_EXIT(cp) { \
|
||||
ASSERT(MUTEX_HELD((cp)->cc_lockp)); \
|
||||
mutex_exit((cp)->cc_lockp); \
|
||||
}
|
||||
|
||||
#endif /* _SPL_CALLB_H */
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CALLO_H
|
||||
#define _SPL_CALLO_H
|
||||
#define _SPL_CALLO_H
|
||||
|
||||
/*
|
||||
* Callout flags:
|
||||
@ -44,9 +44,9 @@
|
||||
* Legacy interfaces timeout() and realtime_timeout() pass this flag
|
||||
* to timeout_generic() to indicate that a 32-bit ID should be allocated.
|
||||
*/
|
||||
#define CALLOUT_FLAG_ROUNDUP 0x1
|
||||
#define CALLOUT_FLAG_ABSOLUTE 0x2
|
||||
#define CALLOUT_FLAG_HRESTIME 0x4
|
||||
#define CALLOUT_FLAG_32BIT 0x8
|
||||
#define CALLOUT_FLAG_ROUNDUP 0x1
|
||||
#define CALLOUT_FLAG_ABSOLUTE 0x2
|
||||
#define CALLOUT_FLAG_HRESTIME 0x4
|
||||
#define CALLOUT_FLAG_32BIT 0x8
|
||||
|
||||
#endif /* _SPL_CALLB_H */
|
||||
|
@ -23,20 +23,20 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CMN_ERR_H
|
||||
#define _SPL_CMN_ERR_H
|
||||
#define _SPL_CMN_ERR_H
|
||||
|
||||
#include <sys/varargs.h>
|
||||
|
||||
#define CE_CONT 0 /* continuation */
|
||||
#define CE_NOTE 1 /* notice */
|
||||
#define CE_WARN 2 /* warning */
|
||||
#define CE_PANIC 3 /* panic */
|
||||
#define CE_IGNORE 4 /* print nothing */
|
||||
#define CE_CONT 0 /* continuation */
|
||||
#define CE_NOTE 1 /* notice */
|
||||
#define CE_WARN 2 /* warning */
|
||||
#define CE_PANIC 3 /* panic */
|
||||
#define CE_IGNORE 4 /* print nothing */
|
||||
|
||||
extern void cmn_err(int, const char *, ...);
|
||||
extern void vcmn_err(int, const char *, __va_list);
|
||||
extern void vpanic(const char *, __va_list);
|
||||
|
||||
#define fm_panic panic
|
||||
#define fm_panic panic
|
||||
|
||||
#endif /* SPL_CMN_ERR_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_COMPRESS_H
|
||||
#define _SPL_COMPRESS_H
|
||||
#define _SPL_COMPRESS_H
|
||||
|
||||
#endif /* SPL_COMPRESS_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CONF_H
|
||||
#define _SPL_CONF_H
|
||||
#define _SPL_CONF_H
|
||||
|
||||
#endif /* SPL_CONF_H */
|
||||
|
@ -28,17 +28,17 @@
|
||||
void
|
||||
console_vprintf(const char *fmt, va_list args)
|
||||
{
|
||||
vprintk(fmt, args);
|
||||
vprintk(fmt, args);
|
||||
}
|
||||
|
||||
void
|
||||
console_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
console_vprintf(fmt, args);
|
||||
va_end(args);
|
||||
va_start(args, fmt);
|
||||
console_vprintf(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#endif /* _SPL_CONSOLE_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CPUPART_H
|
||||
#define _SPL_CPUPART_H
|
||||
#define _SPL_CPUPART_H
|
||||
|
||||
#endif /* SPL_CPUPART_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CPUVAR_H
|
||||
#define _SPL_CPUVAR_H
|
||||
#define _SPL_CPUVAR_H
|
||||
|
||||
#endif /* SPL_CPUVAR_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CRC32_H
|
||||
#define _SPL_CRC32_H
|
||||
#define _SPL_CRC32_H
|
||||
|
||||
#endif /* SPL_CRC32_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CRED_H
|
||||
#define _SPL_CRED_H
|
||||
#define _SPL_CRED_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <sys/types.h>
|
||||
@ -68,7 +68,7 @@ extern gid_t crgetrgid(const cred_t *cr);
|
||||
extern gid_t crgetsgid(const cred_t *cr);
|
||||
extern gid_t crgetfsgid(const cred_t *cr);
|
||||
extern int crgetngroups(const cred_t *cr);
|
||||
extern gid_t * crgetgroups(const cred_t *cr);
|
||||
extern gid_t *crgetgroups(const cred_t *cr);
|
||||
extern int groupmember(gid_t gid, const cred_t *cr);
|
||||
|
||||
#endif /* _SPL_CRED_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_CTYPE_H
|
||||
#define _SPL_CTYPE_H
|
||||
#define _SPL_CTYPE_H
|
||||
|
||||
#include <linux/ctype.h>
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DDI_H
|
||||
#define _SPL_DDI_H
|
||||
#define _SPL_DDI_H
|
||||
|
||||
#endif /* SPL_DDI_H */
|
||||
|
@ -54,16 +54,17 @@ int spl_panic(const char *file, const char *func, int line,
|
||||
const char *fmt, ...);
|
||||
void spl_dumpstack(void);
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
#define PANIC(fmt, a...) \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
|
||||
|
||||
#define VERIFY(cond) \
|
||||
(void)(unlikely(!(cond)) && \
|
||||
(void) (unlikely(!(cond)) && \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"%s", "VERIFY(" #cond ") failed\n"))
|
||||
|
||||
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \
|
||||
(void)((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \
|
||||
(void) ((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
|
||||
"failed (" FMT " " #OP " " FMT ")\n", \
|
||||
@ -120,6 +121,7 @@ void spl_dumpstack(void);
|
||||
((void)((!!(A) == !!(B)) || \
|
||||
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"(" #A ") is equivalent to (" #B ")")))
|
||||
/* END CSTYLED */
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DIRENT_H
|
||||
#define _SPL_DIRENT_H
|
||||
#define _SPL_DIRENT_H
|
||||
|
||||
#endif /* SPL_DIRENT_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DISP_H
|
||||
#define _SPL_DISP_H
|
||||
#define _SPL_DISP_H
|
||||
|
||||
#include <linux/preempt.h>
|
||||
|
||||
|
@ -52,7 +52,7 @@ static inline void dfl_free(dkioc_free_list_t *dfl) {
|
||||
}
|
||||
|
||||
static inline dkioc_free_list_t *dfl_alloc(uint64_t dfl_num_exts, int flags) {
|
||||
return vmem_zalloc(DFL_SZ(dfl_num_exts), flags);
|
||||
return (vmem_zalloc(DFL_SZ(dfl_num_exts), flags));
|
||||
}
|
||||
|
||||
#endif /* _SPL_DKIOC_UTIL_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DNLC_H
|
||||
#define _SPL_DNLC_H
|
||||
#define _SPL_DNLC_H
|
||||
|
||||
#endif /* SPL_DNLC_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_DUMPHDR_H
|
||||
#define _SPL_DUMPHDR_H
|
||||
#define _SPL_DUMPHDR_H
|
||||
|
||||
#endif /* SPL_DUMPHDR_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_EFI_PARTITION_H
|
||||
#define _SPL_EFI_PARTITION_H
|
||||
#define _SPL_EFI_PARTITION_H
|
||||
|
||||
#endif /* SPL_EFI_PARTITION_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ERRNO_H
|
||||
#define _SPL_ERRNO_H
|
||||
#define _SPL_ERRNO_H
|
||||
|
||||
#endif /* SPL_ERRNO_H */
|
||||
|
@ -22,11 +22,11 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_FCNTL_H
|
||||
#define _SPL_FCNTL_H
|
||||
#define _SPL_FCNTL_H
|
||||
|
||||
#include <asm/fcntl.h>
|
||||
|
||||
#define F_FREESP 11
|
||||
#define F_FREESP 11
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
typedef struct flock flock64_t;
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_FILE_H
|
||||
#define _SPL_FILE_H
|
||||
#define _SPL_FILE_H
|
||||
|
||||
#define FIGNORECASE 0x00080000
|
||||
#define FKIOCTL 0x80000000
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SWAPNODE_H
|
||||
#define _SPL_SWAPNODE_H
|
||||
#define _SPL_SWAPNODE_H
|
||||
|
||||
#endif /* SPL_SWAPNODE_H */
|
||||
|
@ -22,8 +22,8 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_IDMAP_H
|
||||
#define _SPL_IDMAP_H
|
||||
#define _SPL_IDMAP_H
|
||||
|
||||
#define IDMAP_WK_CREATOR_OWNER_UID 2147483648U
|
||||
#define IDMAP_WK_CREATOR_OWNER_UID 2147483648U
|
||||
|
||||
#endif /* SPL_IDMAP_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_INT_LIMITS_H
|
||||
#define _SPL_INT_LIMITS_H
|
||||
#define _SPL_INT_LIMITS_H
|
||||
|
||||
#endif /* SPL_INT_LIMITS_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_INT_TYPES_H
|
||||
#define _SPL_INT_TYPES_H
|
||||
#define _SPL_INT_TYPES_H
|
||||
|
||||
#include <sys/inttypes.h>
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_INTTYPES_H
|
||||
#define _SPL_INTTYPES_H
|
||||
#define _SPL_INTTYPES_H
|
||||
|
||||
#endif /* SPL_INTTYPES_H */
|
||||
|
@ -29,59 +29,59 @@
|
||||
#if defined(__x86_64) || defined(__x86_64__)
|
||||
|
||||
#if !defined(__x86_64)
|
||||
#define __x86_64
|
||||
#define __x86_64
|
||||
#endif
|
||||
|
||||
#if !defined(__amd64)
|
||||
#define __amd64
|
||||
#define __amd64
|
||||
#endif
|
||||
|
||||
#if !defined(__x86)
|
||||
#define __x86
|
||||
#define __x86
|
||||
#endif
|
||||
|
||||
#if !defined(_LP64)
|
||||
#define _LP64
|
||||
#define _LP64
|
||||
#endif
|
||||
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
|
||||
/* i386 arch specific defines */
|
||||
#elif defined(__i386) || defined(__i386__)
|
||||
|
||||
#if !defined(__i386)
|
||||
#define __i386
|
||||
#define __i386
|
||||
#endif
|
||||
|
||||
#if !defined(__x86)
|
||||
#define __x86
|
||||
#define __x86
|
||||
#endif
|
||||
|
||||
#if !defined(_ILP32)
|
||||
#define _ILP32
|
||||
#define _ILP32
|
||||
#endif
|
||||
|
||||
#define _ALIGNMENT_REQUIRED 0
|
||||
#define _ALIGNMENT_REQUIRED 0
|
||||
|
||||
/* powerpc (ppc64) arch specific defines */
|
||||
#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
|
||||
|
||||
#if !defined(__powerpc)
|
||||
#define __powerpc
|
||||
#define __powerpc
|
||||
#endif
|
||||
|
||||
#if !defined(__powerpc__)
|
||||
#define __powerpc__
|
||||
#define __powerpc__
|
||||
#endif
|
||||
|
||||
#if defined(__powerpc64__)
|
||||
#if !defined(_LP64)
|
||||
#define _LP64
|
||||
#define _LP64
|
||||
#endif
|
||||
#else
|
||||
#if !defined(_ILP32)
|
||||
#define _ILP32
|
||||
#define _ILP32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -89,65 +89,65 @@
|
||||
* Illumos doesn't define _ALIGNMENT_REQUIRED for PPC, so default to 1
|
||||
* out of paranoia.
|
||||
*/
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
/* arm arch specific defines */
|
||||
#elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
|
||||
|
||||
#if !defined(__arm)
|
||||
#define __arm
|
||||
#define __arm
|
||||
#endif
|
||||
|
||||
#if !defined(__arm__)
|
||||
#define __arm__
|
||||
#define __arm__
|
||||
#endif
|
||||
|
||||
#if defined(__aarch64__)
|
||||
#if !defined(_LP64)
|
||||
#define _LP64
|
||||
#define _LP64
|
||||
#endif
|
||||
#else
|
||||
#if !defined(_ILP32)
|
||||
#define _ILP32
|
||||
#define _ILP32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__ARMEL__) || defined(__AARCH64EL__)
|
||||
#define _LITTLE_ENDIAN
|
||||
#define _LITTLE_ENDIAN
|
||||
#else
|
||||
#define _BIG_ENDIAN
|
||||
#define _BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Illumos doesn't define _ALIGNMENT_REQUIRED for ARM, so default to 1
|
||||
* out of paranoia.
|
||||
*/
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
/* sparc arch specific defines */
|
||||
#elif defined(__sparc) || defined(__sparc__)
|
||||
|
||||
#if !defined(__sparc)
|
||||
#define __sparc
|
||||
#define __sparc
|
||||
#endif
|
||||
|
||||
#if !defined(__sparc__)
|
||||
#define __sparc__
|
||||
#define __sparc__
|
||||
#endif
|
||||
|
||||
#if defined(__arch64__)
|
||||
#if !defined(_LP64)
|
||||
#define _LP64
|
||||
#define _LP64
|
||||
#endif
|
||||
#else
|
||||
#if !defined(_ILP32)
|
||||
#define _ILP32
|
||||
#define _ILP32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _BIG_ENDIAN
|
||||
#define _SUNOS_VTOC_16
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _BIG_ENDIAN
|
||||
#define _SUNOS_VTOC_16
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
/* s390 arch specific defines */
|
||||
#elif defined(__s390__)
|
||||
@ -167,7 +167,7 @@
|
||||
* Illumos doesn't define _ALIGNMENT_REQUIRED for s390, so default to 1
|
||||
* out of paranoia.
|
||||
*/
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
/* MIPS arch specific defines */
|
||||
#elif defined(__mips__)
|
||||
@ -190,7 +190,7 @@
|
||||
* Illumos doesn't define _ALIGNMENT_REQUIRED for MIPS, so default to 1
|
||||
* out of paranoia.
|
||||
*/
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
#define _ALIGNMENT_REQUIRED 1
|
||||
|
||||
#else
|
||||
/*
|
||||
@ -211,11 +211,11 @@
|
||||
#include <sys/byteorder.h>
|
||||
|
||||
#if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
|
||||
#define _LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#define _LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#if defined(__BIG_ENDIAN) && !defined(_BIG_ENDIAN)
|
||||
#define _BIG_ENDIAN __BIG_ENDIAN
|
||||
#define _BIG_ENDIAN __BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_KIDMAP_H
|
||||
#define _SPL_KIDMAP_H
|
||||
#define _SPL_KIDMAP_H
|
||||
|
||||
#include <sys/idmap.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_KOBJ_H
|
||||
#define _SPL_KOBJ_H
|
||||
#define _SPL_KOBJ_H
|
||||
|
||||
#include <sys/vnode.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_KSTAT_H
|
||||
#define _SPL_KSTAT_H
|
||||
#define _SPL_KSTAT_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/proc_compat.h>
|
||||
@ -32,63 +32,65 @@
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#define KSTAT_STRLEN 255
|
||||
#define KSTAT_RAW_MAX (128*1024)
|
||||
#define KSTAT_STRLEN 255
|
||||
#define KSTAT_RAW_MAX (128*1024)
|
||||
|
||||
/* For reference valid classes are:
|
||||
/*
|
||||
* For reference valid classes are:
|
||||
* disk, tape, net, controller, vm, kvm, hat, streams, kstat, misc
|
||||
*/
|
||||
|
||||
#define KSTAT_TYPE_RAW 0 /* can be anything; ks_ndata >= 1 */
|
||||
#define KSTAT_TYPE_NAMED 1 /* name/value pair; ks_ndata >= 1 */
|
||||
#define KSTAT_TYPE_INTR 2 /* interrupt stats; ks_ndata == 1 */
|
||||
#define KSTAT_TYPE_IO 3 /* I/O stats; ks_ndata == 1 */
|
||||
#define KSTAT_TYPE_TIMER 4 /* event timer; ks_ndata >= 1 */
|
||||
#define KSTAT_NUM_TYPES 5
|
||||
#define KSTAT_TYPE_RAW 0 /* can be anything; ks_ndata >= 1 */
|
||||
#define KSTAT_TYPE_NAMED 1 /* name/value pair; ks_ndata >= 1 */
|
||||
#define KSTAT_TYPE_INTR 2 /* interrupt stats; ks_ndata == 1 */
|
||||
#define KSTAT_TYPE_IO 3 /* I/O stats; ks_ndata == 1 */
|
||||
#define KSTAT_TYPE_TIMER 4 /* event timer; ks_ndata >= 1 */
|
||||
#define KSTAT_NUM_TYPES 5
|
||||
|
||||
#define KSTAT_DATA_CHAR 0
|
||||
#define KSTAT_DATA_INT32 1
|
||||
#define KSTAT_DATA_UINT32 2
|
||||
#define KSTAT_DATA_INT64 3
|
||||
#define KSTAT_DATA_UINT64 4
|
||||
#define KSTAT_DATA_LONG 5
|
||||
#define KSTAT_DATA_ULONG 6
|
||||
#define KSTAT_DATA_STRING 7
|
||||
#define KSTAT_NUM_DATAS 8
|
||||
#define KSTAT_DATA_CHAR 0
|
||||
#define KSTAT_DATA_INT32 1
|
||||
#define KSTAT_DATA_UINT32 2
|
||||
#define KSTAT_DATA_INT64 3
|
||||
#define KSTAT_DATA_UINT64 4
|
||||
#define KSTAT_DATA_LONG 5
|
||||
#define KSTAT_DATA_ULONG 6
|
||||
#define KSTAT_DATA_STRING 7
|
||||
#define KSTAT_NUM_DATAS 8
|
||||
|
||||
#define KSTAT_INTR_HARD 0
|
||||
#define KSTAT_INTR_SOFT 1
|
||||
#define KSTAT_INTR_WATCHDOG 2
|
||||
#define KSTAT_INTR_SPURIOUS 3
|
||||
#define KSTAT_INTR_MULTSVC 4
|
||||
#define KSTAT_NUM_INTRS 5
|
||||
#define KSTAT_INTR_HARD 0
|
||||
#define KSTAT_INTR_SOFT 1
|
||||
#define KSTAT_INTR_WATCHDOG 2
|
||||
#define KSTAT_INTR_SPURIOUS 3
|
||||
#define KSTAT_INTR_MULTSVC 4
|
||||
#define KSTAT_NUM_INTRS 5
|
||||
|
||||
#define KSTAT_FLAG_VIRTUAL 0x01
|
||||
#define KSTAT_FLAG_VAR_SIZE 0x02
|
||||
#define KSTAT_FLAG_WRITABLE 0x04
|
||||
#define KSTAT_FLAG_PERSISTENT 0x08
|
||||
#define KSTAT_FLAG_DORMANT 0x10
|
||||
#define KSTAT_FLAG_UNSUPPORTED (KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
|
||||
KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
|
||||
#define KSTAT_FLAG_VIRTUAL 0x01
|
||||
#define KSTAT_FLAG_VAR_SIZE 0x02
|
||||
#define KSTAT_FLAG_WRITABLE 0x04
|
||||
#define KSTAT_FLAG_PERSISTENT 0x08
|
||||
#define KSTAT_FLAG_DORMANT 0x10
|
||||
#define KSTAT_FLAG_UNSUPPORTED \
|
||||
(KSTAT_FLAG_VAR_SIZE | KSTAT_FLAG_WRITABLE | \
|
||||
KSTAT_FLAG_PERSISTENT | KSTAT_FLAG_DORMANT)
|
||||
|
||||
|
||||
#define KS_MAGIC 0x9d9d9d9d
|
||||
#define KS_MAGIC 0x9d9d9d9d
|
||||
|
||||
/* Dynamic updates */
|
||||
#define KSTAT_READ 0
|
||||
#define KSTAT_WRITE 1
|
||||
#define KSTAT_READ 0
|
||||
#define KSTAT_WRITE 1
|
||||
|
||||
struct kstat_s;
|
||||
typedef struct kstat_s kstat_t;
|
||||
|
||||
typedef int kid_t; /* unique kstat id */
|
||||
typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
|
||||
typedef int kid_t; /* unique kstat id */
|
||||
typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
|
||||
|
||||
typedef struct kstat_module {
|
||||
char ksm_name[KSTAT_STRLEN+1]; /* module name */
|
||||
struct list_head ksm_module_list; /* module linkage */
|
||||
struct list_head ksm_kstat_list; /* list of kstat entries */
|
||||
struct proc_dir_entry *ksm_proc; /* proc entry */
|
||||
char ksm_name[KSTAT_STRLEN+1]; /* module name */
|
||||
struct list_head ksm_module_list; /* module linkage */
|
||||
struct list_head ksm_kstat_list; /* list of kstat entries */
|
||||
struct proc_dir_entry *ksm_proc; /* proc entry */
|
||||
} kstat_module_t;
|
||||
|
||||
typedef struct kstat_raw_ops {
|
||||
@ -98,95 +100,96 @@ typedef struct kstat_raw_ops {
|
||||
} kstat_raw_ops_t;
|
||||
|
||||
struct kstat_s {
|
||||
int ks_magic; /* magic value */
|
||||
kid_t ks_kid; /* unique kstat ID */
|
||||
hrtime_t ks_crtime; /* creation time */
|
||||
hrtime_t ks_snaptime; /* last access time */
|
||||
char ks_module[KSTAT_STRLEN+1]; /* provider module name */
|
||||
int ks_instance; /* provider module instance */
|
||||
char ks_name[KSTAT_STRLEN+1]; /* kstat name */
|
||||
char ks_class[KSTAT_STRLEN+1]; /* kstat class */
|
||||
uchar_t ks_type; /* kstat data type */
|
||||
uchar_t ks_flags; /* kstat flags */
|
||||
void *ks_data; /* kstat type-specific data */
|
||||
uint_t ks_ndata; /* # of type-specific data records */
|
||||
size_t ks_data_size; /* size of kstat data section */
|
||||
struct proc_dir_entry *ks_proc; /* proc linkage */
|
||||
kstat_update_t *ks_update; /* dynamic updates */
|
||||
void *ks_private; /* private data */
|
||||
kmutex_t ks_private_lock; /* kstat private data lock */
|
||||
kmutex_t *ks_lock; /* kstat data lock */
|
||||
struct list_head ks_list; /* kstat linkage */
|
||||
kstat_module_t *ks_owner; /* kstat module linkage */
|
||||
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */
|
||||
char *ks_raw_buf; /* buf used for raw ops */
|
||||
size_t ks_raw_bufsize; /* size of raw ops buffer */
|
||||
int ks_magic; /* magic value */
|
||||
kid_t ks_kid; /* unique kstat ID */
|
||||
hrtime_t ks_crtime; /* creation time */
|
||||
hrtime_t ks_snaptime; /* last access time */
|
||||
char ks_module[KSTAT_STRLEN+1]; /* provider module name */
|
||||
int ks_instance; /* provider module instance */
|
||||
char ks_name[KSTAT_STRLEN+1]; /* kstat name */
|
||||
char ks_class[KSTAT_STRLEN+1]; /* kstat class */
|
||||
uchar_t ks_type; /* kstat data type */
|
||||
uchar_t ks_flags; /* kstat flags */
|
||||
void *ks_data; /* kstat type-specific data */
|
||||
uint_t ks_ndata; /* # of data records */
|
||||
size_t ks_data_size; /* size of kstat data section */
|
||||
struct proc_dir_entry *ks_proc; /* proc linkage */
|
||||
kstat_update_t *ks_update; /* dynamic updates */
|
||||
void *ks_private; /* private data */
|
||||
kmutex_t ks_private_lock; /* kstat private data lock */
|
||||
kmutex_t *ks_lock; /* kstat data lock */
|
||||
struct list_head ks_list; /* kstat linkage */
|
||||
kstat_module_t *ks_owner; /* kstat module linkage */
|
||||
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */
|
||||
char *ks_raw_buf; /* buf used for raw ops */
|
||||
size_t ks_raw_bufsize; /* size of raw ops buffer */
|
||||
};
|
||||
|
||||
typedef struct kstat_named_s {
|
||||
char name[KSTAT_STRLEN]; /* name of counter */
|
||||
uchar_t data_type; /* data type */
|
||||
union {
|
||||
char c[16]; /* 128-bit int */
|
||||
int32_t i32; /* 32-bit signed int */
|
||||
uint32_t ui32; /* 32-bit unsigned int */
|
||||
int64_t i64; /* 64-bit signed int */
|
||||
uint64_t ui64; /* 64-bit unsigned int */
|
||||
long l; /* native signed long */
|
||||
ulong_t ul; /* native unsigned long */
|
||||
struct {
|
||||
union {
|
||||
char *ptr; /* NULL-term string */
|
||||
char __pad[8]; /* 64-bit padding */
|
||||
} addr;
|
||||
uint32_t len; /* # bytes for strlen + '\0' */
|
||||
} string;
|
||||
} value;
|
||||
char name[KSTAT_STRLEN]; /* name of counter */
|
||||
uchar_t data_type; /* data type */
|
||||
union {
|
||||
char c[16]; /* 128-bit int */
|
||||
int32_t i32; /* 32-bit signed int */
|
||||
uint32_t ui32; /* 32-bit unsigned int */
|
||||
int64_t i64; /* 64-bit signed int */
|
||||
uint64_t ui64; /* 64-bit unsigned int */
|
||||
long l; /* native signed long */
|
||||
ulong_t ul; /* native unsigned long */
|
||||
struct {
|
||||
union {
|
||||
char *ptr; /* NULL-term string */
|
||||
char __pad[8]; /* 64-bit padding */
|
||||
} addr;
|
||||
uint32_t len; /* # bytes for strlen + '\0' */
|
||||
} string;
|
||||
} value;
|
||||
} kstat_named_t;
|
||||
|
||||
#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr)
|
||||
#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len)
|
||||
#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr)
|
||||
#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len)
|
||||
|
||||
typedef struct kstat_intr {
|
||||
uint_t intrs[KSTAT_NUM_INTRS];
|
||||
uint_t intrs[KSTAT_NUM_INTRS];
|
||||
} kstat_intr_t;
|
||||
|
||||
typedef struct kstat_io {
|
||||
u_longlong_t nread; /* number of bytes read */
|
||||
u_longlong_t nwritten; /* number of bytes written */
|
||||
uint_t reads; /* number of read operations */
|
||||
uint_t writes; /* number of write operations */
|
||||
hrtime_t wtime; /* cumulative wait (pre-service) time */
|
||||
hrtime_t wlentime; /* cumulative wait length*time product*/
|
||||
hrtime_t wlastupdate; /* last time wait queue changed */
|
||||
hrtime_t rtime; /* cumulative run (service) time */
|
||||
hrtime_t rlentime; /* cumulative run length*time product */
|
||||
hrtime_t rlastupdate; /* last time run queue changed */
|
||||
uint_t wcnt; /* count of elements in wait state */
|
||||
uint_t rcnt; /* count of elements in run state */
|
||||
u_longlong_t nread; /* number of bytes read */
|
||||
u_longlong_t nwritten; /* number of bytes written */
|
||||
uint_t reads; /* number of read operations */
|
||||
uint_t writes; /* number of write operations */
|
||||
hrtime_t wtime; /* cumulative wait (pre-service) time */
|
||||
hrtime_t wlentime; /* cumulative wait len*time product */
|
||||
hrtime_t wlastupdate; /* last time wait queue changed */
|
||||
hrtime_t rtime; /* cumulative run (service) time */
|
||||
hrtime_t rlentime; /* cumulative run length*time product */
|
||||
hrtime_t rlastupdate; /* last time run queue changed */
|
||||
uint_t wcnt; /* count of elements in wait state */
|
||||
uint_t rcnt; /* count of elements in run state */
|
||||
} kstat_io_t;
|
||||
|
||||
typedef struct kstat_timer {
|
||||
char name[KSTAT_STRLEN+1]; /* event name */
|
||||
u_longlong_t num_events; /* number of events */
|
||||
hrtime_t elapsed_time; /* cumulative elapsed time */
|
||||
hrtime_t min_time; /* shortest event duration */
|
||||
hrtime_t max_time; /* longest event duration */
|
||||
hrtime_t start_time; /* previous event start time */
|
||||
hrtime_t stop_time; /* previous event stop time */
|
||||
char name[KSTAT_STRLEN+1]; /* event name */
|
||||
u_longlong_t num_events; /* number of events */
|
||||
hrtime_t elapsed_time; /* cumulative elapsed time */
|
||||
hrtime_t min_time; /* shortest event duration */
|
||||
hrtime_t max_time; /* longest event duration */
|
||||
hrtime_t start_time; /* previous event start time */
|
||||
hrtime_t stop_time; /* previous event stop time */
|
||||
} kstat_timer_t;
|
||||
|
||||
int spl_kstat_init(void);
|
||||
void spl_kstat_fini(void);
|
||||
|
||||
extern void __kstat_set_raw_ops(kstat_t *ksp,
|
||||
int (*headers)(char *buf, size_t size),
|
||||
int (*data)(char *buf, size_t size, void *data),
|
||||
void* (*addr)(kstat_t *ksp, loff_t index));
|
||||
int (*headers)(char *buf, size_t size),
|
||||
int (*data)(char *buf, size_t size, void *data),
|
||||
void* (*addr)(kstat_t *ksp, loff_t index));
|
||||
|
||||
extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
|
||||
const char *ks_name, const char *ks_class,
|
||||
uchar_t ks_type, uint_t ks_ndata,
|
||||
uchar_t ks_flags);
|
||||
const char *ks_name, const char *ks_class, uchar_t ks_type,
|
||||
uint_t ks_ndata, uchar_t ks_flags);
|
||||
|
||||
extern void __kstat_install(kstat_t *ksp);
|
||||
extern void __kstat_delete(kstat_t *ksp);
|
||||
extern void kstat_waitq_enter(kstat_io_t *);
|
||||
@ -194,9 +197,12 @@ extern void kstat_waitq_exit(kstat_io_t *);
|
||||
extern void kstat_runq_enter(kstat_io_t *);
|
||||
extern void kstat_runq_exit(kstat_io_t *);
|
||||
|
||||
#define kstat_set_raw_ops(k,h,d,a) __kstat_set_raw_ops(k,h,d,a)
|
||||
#define kstat_create(m,i,n,c,t,s,f) __kstat_create(m,i,n,c,t,s,f)
|
||||
#define kstat_install(k) __kstat_install(k)
|
||||
#define kstat_delete(k) __kstat_delete(k)
|
||||
#define kstat_set_raw_ops(k, h, d, a) \
|
||||
__kstat_set_raw_ops(k, h, d, a)
|
||||
#define kstat_create(m, i, n, c, t, s, f) \
|
||||
__kstat_create(m, i, n, c, t, s, f)
|
||||
|
||||
#define kstat_install(k) __kstat_install(k)
|
||||
#define kstat_delete(k) __kstat_delete(k)
|
||||
|
||||
#endif /* _SPL_KSTAT_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_LIST_H
|
||||
#define _SPL_LIST_H
|
||||
#define _SPL_LIST_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <linux/list.h>
|
||||
@ -53,13 +53,13 @@ typedef struct list {
|
||||
list_node_t list_head;
|
||||
} list_t;
|
||||
|
||||
#define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
|
||||
#define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset))
|
||||
#define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
|
||||
#define list_object(a, node) ((void *)(((char *)node) - (a)->list_offset))
|
||||
|
||||
static inline int
|
||||
list_is_empty(list_t *list)
|
||||
{
|
||||
return list_empty(&list->list_head);
|
||||
return (list_empty(&list->list_head));
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -74,7 +74,7 @@ list_create(list_t *list, size_t size, size_t offset)
|
||||
{
|
||||
ASSERT(list);
|
||||
ASSERT(size > 0);
|
||||
ASSERT(size >= offset + sizeof(list_node_t));
|
||||
ASSERT(size >= offset + sizeof (list_node_t));
|
||||
|
||||
list->list_size = size;
|
||||
list->list_offset = offset;
|
||||
@ -132,10 +132,10 @@ list_remove_head(list_t *list)
|
||||
{
|
||||
list_node_t *head = list->list_head.next;
|
||||
if (head == &list->list_head)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
list_del(head);
|
||||
return list_object(list, head);
|
||||
return (list_object(list, head));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
@ -143,28 +143,28 @@ list_remove_tail(list_t *list)
|
||||
{
|
||||
list_node_t *tail = list->list_head.prev;
|
||||
if (tail == &list->list_head)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
list_del(tail);
|
||||
return list_object(list, tail);
|
||||
return (list_object(list, tail));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
list_head(list_t *list)
|
||||
{
|
||||
if (list_is_empty(list))
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
return list_object(list, list->list_head.next);
|
||||
return (list_object(list, list->list_head.next));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
list_tail(list_t *list)
|
||||
{
|
||||
if (list_is_empty(list))
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
return list_object(list, list->list_head.prev);
|
||||
return (list_object(list, list->list_head.prev));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
@ -173,9 +173,9 @@ list_next(list_t *list, void *object)
|
||||
list_node_t *node = list_d2l(list, object);
|
||||
|
||||
if (node->next != &list->list_head)
|
||||
return list_object(list, node->next);
|
||||
return (list_object(list, node->next));
|
||||
|
||||
return NULL;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
@ -184,9 +184,9 @@ list_prev(list_t *list, void *object)
|
||||
list_node_t *node = list_d2l(list, object);
|
||||
|
||||
if (node->prev != &list->list_head)
|
||||
return list_object(list, node->prev);
|
||||
return (list_object(list, node->prev));
|
||||
|
||||
return NULL;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
@ -201,7 +201,7 @@ spl_list_move_tail(list_t *dst, list_t *src)
|
||||
list_splice_init(&src->list_head, dst->list_head.prev);
|
||||
}
|
||||
|
||||
#define list_move_tail(dst, src) spl_list_move_tail(dst, src)
|
||||
#define list_move_tail(dst, src) spl_list_move_tail(dst, src)
|
||||
|
||||
static inline void
|
||||
list_link_replace(list_node_t *old_node, list_node_t *new_node)
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MKDEV_H
|
||||
#define _SPL_MKDEV_H
|
||||
#define _SPL_MKDEV_H
|
||||
|
||||
#endif /* SPL_MKDEV_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MNTENT_H
|
||||
#define _SPL_MNTENT_H
|
||||
#define _SPL_MNTENT_H
|
||||
|
||||
#endif /* SPL_MNTENT_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MODCTL_H
|
||||
#define _SPL_MODCTL_H
|
||||
#define _SPL_MODCTL_H
|
||||
|
||||
#endif /* SPL_MODCTL_H */
|
||||
|
@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MODE_H
|
||||
#define _SPL_MODE_H
|
||||
#define _SPL_MODE_H
|
||||
|
||||
#define IFTOVT(mode) vn_mode_to_vtype(mode)
|
||||
#define VTTOIF(vtype) vn_vtype_to_mode(vtype)
|
||||
#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT))
|
||||
#define IFTOVT(mode) vn_mode_to_vtype(mode)
|
||||
#define VTTOIF(vtype) vn_vtype_to_mode(vtype)
|
||||
#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT))
|
||||
|
||||
#endif /* SPL_MODE_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_MOUNT_H
|
||||
#define _SPL_MOUNT_H
|
||||
#define _SPL_MOUNT_H
|
||||
|
||||
#endif /* SPL_MOUNT_H */
|
||||
|
@ -84,13 +84,13 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \
|
||||
lockdep_on(); \
|
||||
}
|
||||
#else /* CONFIG_LOCKDEP */
|
||||
#define spl_mutex_set_type(mp, type)
|
||||
#define spl_mutex_lockdep_off_maybe(mp)
|
||||
#define spl_mutex_lockdep_on_maybe(mp)
|
||||
#define spl_mutex_set_type(mp, type)
|
||||
#define spl_mutex_lockdep_off_maybe(mp)
|
||||
#define spl_mutex_lockdep_on_maybe(mp)
|
||||
#endif /* CONFIG_LOCKDEP */
|
||||
|
||||
/*
|
||||
* The following functions must be a #define and not static inline.
|
||||
* The following functions must be a #define and not static inline.
|
||||
* This ensures that the native linux mutex functions (lock/unlock)
|
||||
* will be correctly located in the users code which is important
|
||||
* for the built in kernel lock analysis tools
|
||||
@ -113,6 +113,7 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \
|
||||
VERIFY3P(mutex_owner(mp), ==, NULL); \
|
||||
}
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
#define mutex_tryenter(mp) \
|
||||
({ \
|
||||
int _rc_; \
|
||||
@ -124,6 +125,7 @@ spl_mutex_lockdep_on_maybe(kmutex_t *mp) \
|
||||
\
|
||||
_rc_; \
|
||||
})
|
||||
/* END CSTYLED */
|
||||
|
||||
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
||||
#define mutex_enter_nested(mp, subclass) \
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_NOTE_H
|
||||
#define _SPL_NOTE_H
|
||||
#define _SPL_NOTE_H
|
||||
|
||||
#endif /* SPL_NOTE_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_OPEN_H
|
||||
#define _SPL_OPEN_H
|
||||
#define _SPL_OPEN_H
|
||||
|
||||
#endif /* SPL_OPEN_H */
|
||||
|
@ -23,14 +23,14 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PARAM_H
|
||||
#define _SPL_PARAM_H
|
||||
#define _SPL_PARAM_H
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
/* Pages to bytes and back */
|
||||
#define ptob(pages) ((pages) << PAGE_SHIFT)
|
||||
#define btop(bytes) ((bytes) >> PAGE_SHIFT)
|
||||
#define ptob(pages) ((pages) << PAGE_SHIFT)
|
||||
#define btop(bytes) ((bytes) >> PAGE_SHIFT)
|
||||
|
||||
#define MAXUID UINT32_MAX
|
||||
#define MAXUID UINT32_MAX
|
||||
|
||||
#endif /* SPL_PARAM_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PATHNAME_H
|
||||
#define _SPL_PATHNAME_H
|
||||
#define _SPL_PATHNAME_H
|
||||
|
||||
typedef struct pathname {
|
||||
char *pn_buf; /* underlying storage */
|
||||
|
@ -23,25 +23,25 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_POLICY_H
|
||||
#define _SPL_POLICY_H
|
||||
#define _SPL_POLICY_H
|
||||
|
||||
#define secpolicy_fs_unmount(c,vfs) (0)
|
||||
#define secpolicy_fs_unmount(c, vfs) (0)
|
||||
#define secpolicy_nfs(c) (0)
|
||||
#define secpolicy_sys_config(c,co) (0)
|
||||
#define secpolicy_sys_config(c, co) (0)
|
||||
#define secpolicy_zfs(c) (0)
|
||||
#define secpolicy_zinject(c) (0)
|
||||
#define secpolicy_vnode_setids_setgids(c,id) (0)
|
||||
#define secpolicy_vnode_setids_setgids(c, id) (0)
|
||||
#define secpolicy_vnode_setid_retain(c, sr) (0)
|
||||
#define secpolicy_setid_clear(v, c) (0)
|
||||
#define secpolicy_vnode_any_access(c,vp,o) (0)
|
||||
#define secpolicy_vnode_access2(c,cp,o,m1,m2) (0)
|
||||
#define secpolicy_vnode_chown(c,o) (0)
|
||||
#define secpolicy_vnode_setdac(c,o) (0)
|
||||
#define secpolicy_vnode_any_access(c, vp, o) (0)
|
||||
#define secpolicy_vnode_access2(c, cp, o, m1, m2) (0)
|
||||
#define secpolicy_vnode_chown(c, o) (0)
|
||||
#define secpolicy_vnode_setdac(c, o) (0)
|
||||
#define secpolicy_vnode_remove(c) (0)
|
||||
#define secpolicy_vnode_setattr(c,v,a,o,f,func,n) (0)
|
||||
#define secpolicy_vnode_setattr(c, v, a, o, f, func, n) (0)
|
||||
#define secpolicy_xvattr(x, o, c, t) (0)
|
||||
#define secpolicy_vnode_stky_modify(c) (0)
|
||||
#define secpolicy_setid_setsticky_clear(v,a,o,c) (0)
|
||||
#define secpolicy_setid_setsticky_clear(v, a, o, c) (0)
|
||||
#define secpolicy_basic_link(c) (0)
|
||||
|
||||
#endif /* SPL_POLICY_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_POOL_H
|
||||
#define _SPL_POOL_H
|
||||
#define _SPL_POOL_H
|
||||
|
||||
#include <sys/pset.h>
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PRIV_IMPL_H
|
||||
#define _SPL_PRIV_IMPL_H
|
||||
#define _SPL_PRIV_IMPL_H
|
||||
|
||||
#endif /* _SPL_PRIV_IMPL_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PROC_H
|
||||
#define _SPL_PROC_H
|
||||
#define _SPL_PROC_H
|
||||
|
||||
#endif /* SPL_PROC_H */
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef _SPL_PROCESSOR_H
|
||||
#define _SPL_PROCESSOR_H
|
||||
|
||||
#define getcpuid() smp_processor_id()
|
||||
#define getcpuid() smp_processor_id()
|
||||
|
||||
typedef int processorid_t;
|
||||
|
||||
|
@ -23,16 +23,16 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_PSET_H
|
||||
#define _SPL_PSET_H
|
||||
#define _SPL_PSET_H
|
||||
|
||||
typedef int psetid_t;
|
||||
|
||||
/* special processor set id's */
|
||||
#define PS_NONE -1
|
||||
#define PS_QUERY -2
|
||||
#define PS_MYID -3
|
||||
#define PS_SOFT -4
|
||||
#define PS_HARD -5
|
||||
#define PS_QUERY_TYPE -6
|
||||
#define PS_NONE -1
|
||||
#define PS_QUERY -2
|
||||
#define PS_MYID -3
|
||||
#define PS_SOFT -4
|
||||
#define PS_HARD -5
|
||||
#define PS_QUERY_TYPE -6
|
||||
|
||||
#endif /* SPL_PSET_H */
|
||||
|
@ -31,8 +31,8 @@
|
||||
static __inline__ int
|
||||
random_get_bytes(uint8_t *ptr, size_t len)
|
||||
{
|
||||
get_random_bytes((void *)ptr,(int)len);
|
||||
return 0;
|
||||
get_random_bytes((void *)ptr, (int)len);
|
||||
return (0);
|
||||
}
|
||||
|
||||
extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len);
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_REFSTR_H
|
||||
#define _SPL_REFSTR_H
|
||||
#define _SPL_REFSTR_H
|
||||
|
||||
#endif /* SPL_REFSTR_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RESOURCE_H
|
||||
#define _SPL_RESOURCE_H
|
||||
#define _SPL_RESOURCE_H
|
||||
|
||||
#include <linux/resource.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_RWLOCK_H
|
||||
#define _SPL_RWLOCK_H
|
||||
#define _SPL_RWLOCK_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <linux/rwsem.h>
|
||||
@ -55,7 +55,7 @@ typedef struct {
|
||||
#endif /* CONFIG_LOCKDEP */
|
||||
} krwlock_t;
|
||||
|
||||
#define SEM(rwp) (&(rwp)->rw_rwlock)
|
||||
#define SEM(rwp) (&(rwp)->rw_rwlock)
|
||||
|
||||
static inline void
|
||||
spl_rw_set_owner(krwlock_t *rwp)
|
||||
@ -81,9 +81,9 @@ static inline kthread_t *
|
||||
rw_owner(krwlock_t *rwp)
|
||||
{
|
||||
#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
|
||||
return SEM(rwp)->owner;
|
||||
return (SEM(rwp)->owner);
|
||||
#else
|
||||
return rwp->rw_owner;
|
||||
return (rwp->rw_owner);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -106,9 +106,9 @@ spl_rw_lockdep_on_maybe(krwlock_t *rwp) \
|
||||
lockdep_on(); \
|
||||
}
|
||||
#else /* CONFIG_LOCKDEP */
|
||||
#define spl_rw_set_type(rwp, type)
|
||||
#define spl_rw_lockdep_off_maybe(rwp)
|
||||
#define spl_rw_lockdep_on_maybe(rwp)
|
||||
#define spl_rw_set_type(rwp, type)
|
||||
#define spl_rw_lockdep_off_maybe(rwp)
|
||||
#define spl_rw_lockdep_on_maybe(rwp)
|
||||
#endif /* CONFIG_LOCKDEP */
|
||||
|
||||
static inline int
|
||||
@ -131,16 +131,17 @@ RW_WRITE_HELD(krwlock_t *rwp)
|
||||
static inline int
|
||||
RW_LOCK_HELD(krwlock_t *rwp)
|
||||
{
|
||||
return spl_rwsem_is_locked(SEM(rwp));
|
||||
return (spl_rwsem_is_locked(SEM(rwp)));
|
||||
}
|
||||
|
||||
/*
|
||||
* The following functions must be a #define and not static inline.
|
||||
* The following functions must be a #define and not static inline.
|
||||
* This ensures that the native linux semaphore functions (down/up)
|
||||
* will be correctly located in the users code which is important
|
||||
* for the built in kernel lock analysis tools
|
||||
*/
|
||||
#define rw_init(rwp, name, type, arg) \
|
||||
/* BEGIN CSTYLED */
|
||||
#define rw_init(rwp, name, type, arg) \
|
||||
({ \
|
||||
static struct lock_class_key __key; \
|
||||
ASSERT(type == RW_DEFAULT || type == RW_NOLOCKDEP); \
|
||||
@ -150,12 +151,12 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
spl_rw_set_type(rwp, type); \
|
||||
})
|
||||
|
||||
#define rw_destroy(rwp) \
|
||||
#define rw_destroy(rwp) \
|
||||
({ \
|
||||
VERIFY(!RW_LOCK_HELD(rwp)); \
|
||||
})
|
||||
|
||||
#define rw_tryenter(rwp, rw) \
|
||||
#define rw_tryenter(rwp, rw) \
|
||||
({ \
|
||||
int _rc_ = 0; \
|
||||
\
|
||||
@ -175,7 +176,7 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
_rc_; \
|
||||
})
|
||||
|
||||
#define rw_enter(rwp, rw) \
|
||||
#define rw_enter(rwp, rw) \
|
||||
({ \
|
||||
spl_rw_lockdep_off_maybe(rwp); \
|
||||
switch (rw) { \
|
||||
@ -192,7 +193,7 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
spl_rw_lockdep_on_maybe(rwp); \
|
||||
})
|
||||
|
||||
#define rw_exit(rwp) \
|
||||
#define rw_exit(rwp) \
|
||||
({ \
|
||||
spl_rw_lockdep_off_maybe(rwp); \
|
||||
if (RW_WRITE_HELD(rwp)) { \
|
||||
@ -205,7 +206,7 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
spl_rw_lockdep_on_maybe(rwp); \
|
||||
})
|
||||
|
||||
#define rw_downgrade(rwp) \
|
||||
#define rw_downgrade(rwp) \
|
||||
({ \
|
||||
spl_rw_lockdep_off_maybe(rwp); \
|
||||
spl_rw_clear_owner(rwp); \
|
||||
@ -213,7 +214,7 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
spl_rw_lockdep_on_maybe(rwp); \
|
||||
})
|
||||
|
||||
#define rw_tryupgrade(rwp) \
|
||||
#define rw_tryupgrade(rwp) \
|
||||
({ \
|
||||
int _rc_ = 0; \
|
||||
\
|
||||
@ -227,6 +228,7 @@ RW_LOCK_HELD(krwlock_t *rwp)
|
||||
} \
|
||||
_rc_; \
|
||||
})
|
||||
/* END CSTYLED */
|
||||
|
||||
int spl_rw_init(void);
|
||||
void spl_rw_fini(void);
|
||||
|
@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SDT_H
|
||||
#define _SPL_SDT_H
|
||||
#define _SPL_SDT_H
|
||||
|
||||
#define SET_ERROR(x) (x)
|
||||
#define SET_ERROR(x) (x)
|
||||
|
||||
#endif /* SPL_SDT_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SID_H
|
||||
#define _SPL_SID_H
|
||||
#define _SPL_SID_H
|
||||
|
||||
typedef struct ksiddomain {
|
||||
char *kd_name;
|
||||
@ -41,21 +41,21 @@ typedef int ksid_t;
|
||||
static inline ksiddomain_t *
|
||||
ksid_lookupdomain(const char *dom)
|
||||
{
|
||||
ksiddomain_t *kd;
|
||||
ksiddomain_t *kd;
|
||||
int len = strlen(dom);
|
||||
|
||||
kd = kmem_zalloc(sizeof(ksiddomain_t), KM_SLEEP);
|
||||
kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP);
|
||||
kd = kmem_zalloc(sizeof (ksiddomain_t), KM_SLEEP);
|
||||
kd->kd_name = kmem_zalloc(len + 1, KM_SLEEP);
|
||||
memcpy(kd->kd_name, dom, len);
|
||||
|
||||
return (kd);
|
||||
return (kd);
|
||||
}
|
||||
|
||||
static inline void
|
||||
ksiddomain_rele(ksiddomain_t *ksid)
|
||||
{
|
||||
kmem_free(ksid->kd_name, strlen(ksid->kd_name) + 1);
|
||||
kmem_free(ksid, sizeof(ksiddomain_t));
|
||||
kmem_free(ksid, sizeof (ksiddomain_t));
|
||||
}
|
||||
|
||||
#endif /* _SPL_SID_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SIGNAL_H
|
||||
#define _SPL_SIGNAL_H
|
||||
#define _SPL_SIGNAL_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
@ -34,7 +34,8 @@
|
||||
#define FORREAL 0 /* Usual side-effects */
|
||||
#define JUSTLOOKING 1 /* Don't stop the process */
|
||||
|
||||
/* The "why" argument indicates the allowable side-effects of the call:
|
||||
/*
|
||||
* The "why" argument indicates the allowable side-effects of the call:
|
||||
*
|
||||
* FORREAL: Extract the next pending signal from p_sig into p_cursig;
|
||||
* stop the process if a stop has been requested or if a traced signal
|
||||
@ -48,7 +49,7 @@ issig(int why)
|
||||
{
|
||||
ASSERT(why == FORREAL || why == JUSTLOOKING);
|
||||
|
||||
return signal_pending(current);
|
||||
return (signal_pending(current));
|
||||
}
|
||||
|
||||
#endif /* SPL_SIGNAL_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_STAT_H
|
||||
#define _SPL_STAT_H
|
||||
#define _SPL_STAT_H
|
||||
|
||||
#include <linux/stat.h>
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_STROPTS_H
|
||||
#define _SPL_STROPTS_H
|
||||
#define _SPL_STROPTS_H
|
||||
|
||||
#endif /* SPL_STROPTS_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SUNDDI_H
|
||||
#define _SPL_SUNDDI_H
|
||||
#define _SPL_SUNDDI_H
|
||||
|
||||
#include <sys/cred.h>
|
||||
#include <sys/uio.h>
|
||||
@ -44,9 +44,9 @@ typedef int ddi_devid_t;
|
||||
#define DDI_SUCCESS 0
|
||||
#define DDI_FAILURE -1
|
||||
|
||||
#define ddi_prop_lookup_string(x1,x2,x3,x4,x5) (*x5 = NULL)
|
||||
#define ddi_prop_free(x) (void)0
|
||||
#define ddi_root_node() (void)0
|
||||
#define ddi_prop_lookup_string(x1, x2, x3, x4, x5) (*x5 = NULL)
|
||||
#define ddi_prop_free(x) (void)0
|
||||
#define ddi_root_node() (void)0
|
||||
|
||||
extern int ddi_strtoul(const char *, char **, int, unsigned long *);
|
||||
extern int ddi_strtol(const char *, char **, int, long *);
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SUNLDI_H
|
||||
#define _SPL_SUNLDI_H
|
||||
#define _SPL_SUNLDI_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <linux/fs.h>
|
||||
@ -32,6 +32,6 @@
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
#define SECTOR_SIZE 512
|
||||
#define SECTOR_SIZE 512
|
||||
|
||||
#endif /* SPL_SUNLDI_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SYSDC_H
|
||||
#define _SPL_SYSDC_H
|
||||
#define _SPL_SYSDC_H
|
||||
|
||||
#endif /* SPL_SYSDC_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SYSMACROS_H
|
||||
#define _SPL_SYSMACROS_H
|
||||
#define _SPL_SYSMACROS_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
@ -39,120 +39,122 @@
|
||||
#endif
|
||||
|
||||
#ifndef _KERNEL
|
||||
#define _KERNEL __KERNEL__
|
||||
#define _KERNEL __KERNEL__
|
||||
#endif
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define INT8_MAX (127)
|
||||
#define INT8_MIN (-128)
|
||||
#define UINT8_MAX (255)
|
||||
#define UINT8_MIN (0)
|
||||
#define INT8_MAX (127)
|
||||
#define INT8_MIN (-128)
|
||||
#define UINT8_MAX (255)
|
||||
#define UINT8_MIN (0)
|
||||
|
||||
#define INT16_MAX (32767)
|
||||
#define INT16_MIN (-32768)
|
||||
#define UINT16_MAX (65535)
|
||||
#define UINT16_MIN (0)
|
||||
#define INT16_MAX (32767)
|
||||
#define INT16_MIN (-32768)
|
||||
#define UINT16_MAX (65535)
|
||||
#define UINT16_MIN (0)
|
||||
|
||||
#define INT32_MAX INT_MAX
|
||||
#define INT32_MIN INT_MIN
|
||||
#define UINT32_MAX UINT_MAX
|
||||
#define UINT32_MIN UINT_MIN
|
||||
#define INT32_MAX INT_MAX
|
||||
#define INT32_MIN INT_MIN
|
||||
#define UINT32_MAX UINT_MAX
|
||||
#define UINT32_MIN UINT_MIN
|
||||
|
||||
#define INT64_MAX LLONG_MAX
|
||||
#define INT64_MIN LLONG_MIN
|
||||
#define UINT64_MAX ULLONG_MAX
|
||||
#define UINT64_MIN ULLONG_MIN
|
||||
#define INT64_MAX LLONG_MAX
|
||||
#define INT64_MIN LLONG_MIN
|
||||
#define UINT64_MAX ULLONG_MAX
|
||||
#define UINT64_MIN ULLONG_MIN
|
||||
|
||||
#define NBBY 8
|
||||
#define ENOTSUP EOPNOTSUPP
|
||||
#define NBBY 8
|
||||
#define ENOTSUP EOPNOTSUPP
|
||||
|
||||
#define MAXMSGLEN 256
|
||||
#define MAXNAMELEN 256
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
#define MAXOFFSET_T LLONG_MAX
|
||||
#define MAXBSIZE 8192
|
||||
#define DEV_BSIZE 512
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
#define MAXMSGLEN 256
|
||||
#define MAXNAMELEN 256
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
#define MAXOFFSET_T LLONG_MAX
|
||||
#define MAXBSIZE 8192
|
||||
#define DEV_BSIZE 512
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
|
||||
#define proc_pageout NULL
|
||||
#define curproc current
|
||||
#define max_ncpus num_possible_cpus()
|
||||
#define boot_ncpus num_online_cpus()
|
||||
#define CPU_SEQID smp_processor_id()
|
||||
#define _NOTE(x)
|
||||
#define is_system_labeled() 0
|
||||
#define proc_pageout NULL
|
||||
#define curproc current
|
||||
#define max_ncpus num_possible_cpus()
|
||||
#define boot_ncpus num_online_cpus()
|
||||
#define CPU_SEQID smp_processor_id()
|
||||
#define _NOTE(x)
|
||||
#define is_system_labeled() 0
|
||||
|
||||
#ifndef RLIM64_INFINITY
|
||||
#define RLIM64_INFINITY (~0ULL)
|
||||
#define RLIM64_INFINITY (~0ULL)
|
||||
#endif
|
||||
|
||||
/* 0..MAX_PRIO-1: Process priority
|
||||
/*
|
||||
* 0..MAX_PRIO-1: Process priority
|
||||
* 0..MAX_RT_PRIO-1: RT priority tasks
|
||||
* MAX_RT_PRIO..MAX_PRIO-1: SCHED_NORMAL tasks
|
||||
*
|
||||
* Treat shim tasks as SCHED_NORMAL tasks
|
||||
*/
|
||||
#define minclsyspri (MAX_PRIO-1)
|
||||
#define maxclsyspri (MAX_RT_PRIO)
|
||||
#define defclsyspri (DEFAULT_PRIO)
|
||||
#define minclsyspri (MAX_PRIO-1)
|
||||
#define maxclsyspri (MAX_RT_PRIO)
|
||||
#define defclsyspri (DEFAULT_PRIO)
|
||||
|
||||
#ifndef NICE_TO_PRIO
|
||||
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
|
||||
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
|
||||
#endif
|
||||
#ifndef PRIO_TO_NICE
|
||||
#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20)
|
||||
#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Missing macros
|
||||
*/
|
||||
#ifndef PAGESIZE
|
||||
#define PAGESIZE PAGE_SIZE
|
||||
#define PAGESIZE PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef PAGESHIFT
|
||||
#define PAGESHIFT PAGE_SHIFT
|
||||
#define PAGESHIFT PAGE_SHIFT
|
||||
#endif
|
||||
|
||||
/* from Solaris sys/byteorder.h */
|
||||
#define BSWAP_8(x) ((x) & 0xff)
|
||||
#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
|
||||
#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
|
||||
#define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
|
||||
#define BSWAP_8(x) ((x) & 0xff)
|
||||
#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
|
||||
#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
|
||||
#define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
|
||||
|
||||
/* Map some simple functions.
|
||||
/*
|
||||
* Map some simple functions.
|
||||
*/
|
||||
#define bzero(ptr,size) memset(ptr,0,size)
|
||||
#define bcopy(src,dest,size) memmove(dest,src,size)
|
||||
#define bcmp(src,dest,size) memcmp((src), (dest), (size_t)(size))
|
||||
#define bzero(ptr, size) memset(ptr, 0, size)
|
||||
#define bcopy(src, dest, size) memmove(dest, src, size)
|
||||
#define bcmp(src, dest, size) memcmp((src), (dest), (size_t)(size))
|
||||
|
||||
/* Dtrace probes do not exist in the linux kernel */
|
||||
#ifdef DTRACE_PROBE
|
||||
#undef DTRACE_PROBE
|
||||
#endif /* DTRACE_PROBE */
|
||||
#define DTRACE_PROBE(a) ((void)0)
|
||||
#define DTRACE_PROBE(a) ((void)0)
|
||||
|
||||
#ifdef DTRACE_PROBE1
|
||||
#undef DTRACE_PROBE1
|
||||
#endif /* DTRACE_PROBE1 */
|
||||
#define DTRACE_PROBE1(a, b, c) ((void)0)
|
||||
#define DTRACE_PROBE1(a, b, c) ((void)0)
|
||||
|
||||
#ifdef DTRACE_PROBE2
|
||||
#undef DTRACE_PROBE2
|
||||
#endif /* DTRACE_PROBE2 */
|
||||
#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
|
||||
#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
|
||||
|
||||
#ifdef DTRACE_PROBE3
|
||||
#undef DTRACE_PROBE3
|
||||
#endif /* DTRACE_PROBE3 */
|
||||
#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
|
||||
#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
|
||||
|
||||
#ifdef DTRACE_PROBE4
|
||||
#undef DTRACE_PROBE4
|
||||
#endif /* DTRACE_PROBE4 */
|
||||
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
|
||||
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
|
||||
|
||||
/* Missing globals */
|
||||
extern char spl_version[32];
|
||||
@ -167,39 +169,39 @@ extern void spl_cleanup(void);
|
||||
#define lowbit(x) __ffs(x)
|
||||
|
||||
#define highbit64(x) fls64(x)
|
||||
#define makedevice(maj,min) makedev(maj,min)
|
||||
#define makedevice(maj, min) makedev(maj, min)
|
||||
|
||||
/* common macros */
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) ((a) < (b) ? (b) : (a))
|
||||
#define MAX(a, b) ((a) < (b) ? (b) : (a))
|
||||
#endif
|
||||
#ifndef ABS
|
||||
#define ABS(a) ((a) < 0 ? -(a) : (a))
|
||||
#define ABS(a) ((a) < 0 ? -(a) : (a))
|
||||
#endif
|
||||
#ifndef DIV_ROUND_UP
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||
#endif
|
||||
#ifndef roundup
|
||||
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
#endif
|
||||
#ifndef howmany
|
||||
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
|
||||
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compatibility macros/typedefs needed for Solaris -> Linux port
|
||||
*/
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||
#define P2PHASE(x, align) ((x) & ((align) - 1))
|
||||
#define P2NPHASE(x, align) (-(x) & ((align) - 1))
|
||||
#define ISP2(x) (((x) & ((x) - 1)) == 0)
|
||||
#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1))==0)
|
||||
#define P2BOUNDARY(off, len, align) \
|
||||
#define P2ALIGN(x, align) ((x) & -(align))
|
||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||
#define P2PHASE(x, align) ((x) & ((align) - 1))
|
||||
#define P2NPHASE(x, align) (-(x) & ((align) - 1))
|
||||
#define ISP2(x) (((x) & ((x) - 1)) == 0)
|
||||
#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
|
||||
#define P2BOUNDARY(off, len, align) \
|
||||
(((off) ^ ((off) + (len) - 1)) > (align) - 1)
|
||||
|
||||
/*
|
||||
@ -214,28 +216,28 @@ extern void spl_cleanup(void);
|
||||
* or
|
||||
* P2ROUNDUP_TYPED(x, PAGESIZE, uint64_t)
|
||||
*/
|
||||
#define P2ALIGN_TYPED(x, align, type) \
|
||||
((type)(x) & -(type)(align))
|
||||
#define P2PHASE_TYPED(x, align, type) \
|
||||
((type)(x) & ((type)(align) - 1))
|
||||
#define P2NPHASE_TYPED(x, align, type) \
|
||||
(-(type)(x) & ((type)(align) - 1))
|
||||
#define P2ROUNDUP_TYPED(x, align, type) \
|
||||
((((type)(x) - 1) | ((type)(align) - 1)) + 1)
|
||||
#define P2END_TYPED(x, align, type) \
|
||||
(-(~(type)(x) & -(type)(align)))
|
||||
#define P2PHASEUP_TYPED(x, align, phase, type) \
|
||||
((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align)))
|
||||
#define P2CROSS_TYPED(x, y, align, type) \
|
||||
(((type)(x) ^ (type)(y)) > (type)(align) - 1)
|
||||
#define P2SAMEHIGHBIT_TYPED(x, y, type) \
|
||||
(((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))
|
||||
#define P2ALIGN_TYPED(x, align, type) \
|
||||
((type)(x) & -(type)(align))
|
||||
#define P2PHASE_TYPED(x, align, type) \
|
||||
((type)(x) & ((type)(align) - 1))
|
||||
#define P2NPHASE_TYPED(x, align, type) \
|
||||
(-(type)(x) & ((type)(align) - 1))
|
||||
#define P2ROUNDUP_TYPED(x, align, type) \
|
||||
((((type)(x) - 1) | ((type)(align) - 1)) + 1)
|
||||
#define P2END_TYPED(x, align, type) \
|
||||
(-(~(type)(x) & -(type)(align)))
|
||||
#define P2PHASEUP_TYPED(x, align, phase, type) \
|
||||
((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align)))
|
||||
#define P2CROSS_TYPED(x, y, align, type) \
|
||||
(((type)(x) ^ (type)(y)) > (type)(align) - 1)
|
||||
#define P2SAMEHIGHBIT_TYPED(x, y, type) \
|
||||
(((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))
|
||||
|
||||
#if defined(_KERNEL) && !defined(_KMEMUSER) && !defined(offsetof)
|
||||
|
||||
/* avoid any possibility of clashing with <stddef.h> version */
|
||||
|
||||
#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
|
||||
#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_SYSMACROS_H */
|
||||
|
@ -23,14 +23,14 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SYSTEMINFO_H
|
||||
#define _SPL_SYSTEMINFO_H
|
||||
#define _SPL_SYSTEMINFO_H
|
||||
|
||||
#define HW_HOSTID_LEN 11 /* minimum buffer size needed */
|
||||
#define HW_HOSTID_LEN 11 /* minimum buffer size needed */
|
||||
/* to hold a decimal or hex */
|
||||
/* hostid string */
|
||||
|
||||
/* Supplemental definitions for Linux. */
|
||||
#define HW_HOSTID_PATH "/etc/hostid" /* binary configuration file */
|
||||
#define HW_HOSTID_MASK 0xFFFFFFFF /* significant hostid bits */
|
||||
#define HW_HOSTID_PATH "/etc/hostid" /* binary configuration file */
|
||||
#define HW_HOSTID_MASK 0xFFFFFFFF /* significant hostid bits */
|
||||
|
||||
#endif /* SPL_SYSTEMINFO_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_SYSTM_H
|
||||
#define _SPL_SYSTM_H
|
||||
#define _SPL_SYSTM_H
|
||||
|
||||
#include <sys/sunddi.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_T_LOCK_H
|
||||
#define _SPL_T_LOCK_H
|
||||
#define _SPL_T_LOCK_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mutex.h>
|
||||
|
@ -94,7 +94,7 @@ typedef struct taskq {
|
||||
taskqid_t tq_lowest_id; /* lowest pend/work id */
|
||||
struct list_head tq_free_list; /* free taskq_ent_t's */
|
||||
struct list_head tq_pend_list; /* pending taskq_ent_t's */
|
||||
struct list_head tq_prio_list; /* priority pending taskq_ent_t's */
|
||||
struct list_head tq_prio_list; /* priority taskq_ent_t's */
|
||||
struct list_head tq_delay_list; /* delayed taskq_ent_t's */
|
||||
struct list_head tq_taskqs; /* all taskq_t's */
|
||||
spl_wait_queue_head_t tq_work_waitq; /* new work waitq */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_THREAD_H
|
||||
#define _SPL_THREAD_H
|
||||
#define _SPL_THREAD_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/mm.h>
|
||||
@ -36,28 +36,30 @@
|
||||
/*
|
||||
* Thread interfaces
|
||||
*/
|
||||
#define TP_MAGIC 0x53535353
|
||||
#define TP_MAGIC 0x53535353
|
||||
|
||||
#define TS_SLEEP TASK_INTERRUPTIBLE
|
||||
#define TS_RUN TASK_RUNNING
|
||||
#define TS_ZOMB EXIT_ZOMBIE
|
||||
#define TS_STOPPED TASK_STOPPED
|
||||
#define TS_SLEEP TASK_INTERRUPTIBLE
|
||||
#define TS_RUN TASK_RUNNING
|
||||
#define TS_ZOMB EXIT_ZOMBIE
|
||||
#define TS_STOPPED TASK_STOPPED
|
||||
|
||||
typedef void (*thread_func_t)(void *);
|
||||
|
||||
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
|
||||
__thread_create(stk, stksize, (thread_func_t)func, \
|
||||
#func, arg, len, pp, state, pri)
|
||||
#define thread_exit() __thread_exit()
|
||||
#define thread_join(t) VERIFY(0)
|
||||
#define curthread current
|
||||
#define getcomm() current->comm
|
||||
#define getpid() current->pid
|
||||
/* BEGIN CSTYLED */
|
||||
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
|
||||
__thread_create(stk, stksize, (thread_func_t)func, \
|
||||
#func, arg, len, pp, state, pri)
|
||||
/* END CSTYLED */
|
||||
|
||||
#define thread_exit() __thread_exit()
|
||||
#define thread_join(t) VERIFY(0)
|
||||
#define curthread current
|
||||
#define getcomm() current->comm
|
||||
#define getpid() current->pid
|
||||
|
||||
extern kthread_t *__thread_create(caddr_t stk, size_t stksize,
|
||||
thread_func_t func, const char *name,
|
||||
void *args, size_t len, proc_t *pp,
|
||||
int state, pri_t pri);
|
||||
thread_func_t func, const char *name, void *args, size_t len, proc_t *pp,
|
||||
int state, pri_t pri);
|
||||
extern void __thread_exit(void);
|
||||
extern struct task_struct *spl_kthread_create(int (*func)(void *),
|
||||
void *data, const char namefmt[], ...);
|
||||
|
@ -23,38 +23,37 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_TIMER_H
|
||||
#define _SPL_TIMER_H
|
||||
#define _SPL_TIMER_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
#define lbolt ((clock_t)jiffies)
|
||||
#define lbolt64 ((int64_t)get_jiffies_64())
|
||||
#define lbolt ((clock_t)jiffies)
|
||||
#define lbolt64 ((int64_t)get_jiffies_64())
|
||||
|
||||
#define ddi_get_lbolt() ((clock_t)jiffies)
|
||||
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
|
||||
#define ddi_get_lbolt() ((clock_t)jiffies)
|
||||
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
|
||||
|
||||
#define ddi_time_before(a, b) (typecheck(clock_t, a) && \
|
||||
#define ddi_time_before(a, b) (typecheck(clock_t, a) && \
|
||||
typecheck(clock_t, b) && \
|
||||
((a) - (b) < 0))
|
||||
#define ddi_time_after(a, b) ddi_time_before(b, a)
|
||||
#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b))
|
||||
#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a)
|
||||
#define ddi_time_after(a, b) ddi_time_before(b, a)
|
||||
#define ddi_time_before_eq(a, b) (!ddi_time_after(a, b))
|
||||
#define ddi_time_after_eq(a, b) ddi_time_before_eq(b, a)
|
||||
|
||||
#define ddi_time_before64(a, b) (typecheck(int64_t, a) && \
|
||||
#define ddi_time_before64(a, b) (typecheck(int64_t, a) && \
|
||||
typecheck(int64_t, b) && \
|
||||
((a) - (b) < 0))
|
||||
#define ddi_time_after64(a, b) ddi_time_before64(b, a)
|
||||
#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b))
|
||||
#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a)
|
||||
#define ddi_time_after64(a, b) ddi_time_before64(b, a)
|
||||
#define ddi_time_before_eq64(a, b) (!ddi_time_after64(a, b))
|
||||
#define ddi_time_after_eq64(a, b) ddi_time_before_eq64(b, a)
|
||||
|
||||
#define delay(ticks) schedule_timeout_uninterruptible(ticks)
|
||||
#define delay(ticks) schedule_timeout_uninterruptible(ticks)
|
||||
|
||||
#define SEC_TO_TICK(sec) ((sec) * HZ)
|
||||
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
|
||||
#define USEC_TO_TICK(us) usecs_to_jiffies(us)
|
||||
#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC)
|
||||
#define SEC_TO_TICK(sec) ((sec) * HZ)
|
||||
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
|
||||
#define USEC_TO_TICK(us) usecs_to_jiffies(us)
|
||||
#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC)
|
||||
|
||||
#endif /* _SPL_TIMER_H */
|
||||
|
||||
|
@ -22,14 +22,14 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_TSD_H
|
||||
#define _SPL_TSD_H
|
||||
#define _SPL_TSD_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define TSD_HASH_TABLE_BITS_DEFAULT 9
|
||||
#define TSD_KEYS_MAX 32768
|
||||
#define DTOR_PID (PID_MAX_LIMIT+1)
|
||||
#define PID_KEY (TSD_KEYS_MAX+1)
|
||||
#define TSD_HASH_TABLE_BITS_DEFAULT 9
|
||||
#define TSD_KEYS_MAX 32768
|
||||
#define DTOR_PID (PID_MAX_LIMIT+1)
|
||||
#define PID_KEY (TSD_KEYS_MAX+1)
|
||||
|
||||
typedef void (*dtor_func_t)(void *);
|
||||
|
||||
|
@ -29,14 +29,14 @@
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
#define ULLONG_MAX (~0ULL)
|
||||
#define ULLONG_MAX (~0ULL)
|
||||
#endif
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
#define LLONG_MAX ((long long)(~0ULL>>1))
|
||||
#define LLONG_MAX ((long long)(~0ULL>>1))
|
||||
#endif
|
||||
|
||||
typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t;
|
||||
typedef enum { B_FALSE = 0, B_TRUE = 1 } boolean_t;
|
||||
typedef unsigned long intptr_t;
|
||||
typedef unsigned long ulong_t;
|
||||
typedef unsigned int uint_t;
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_U8_TEXTPREP_H
|
||||
#define _SPL_U8_TEXTPREP_H
|
||||
#define _SPL_U8_TEXTPREP_H
|
||||
|
||||
#endif /* SPL_U8_TEXTPREP_H */
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_UIO_H
|
||||
#define _SPL_UIO_H
|
||||
#define _SPL_UIO_H
|
||||
|
||||
#include <linux/uio.h>
|
||||
#include <linux/blkdev.h>
|
||||
@ -34,15 +34,15 @@
|
||||
typedef struct iovec iovec_t;
|
||||
|
||||
typedef enum uio_rw {
|
||||
UIO_READ = 0,
|
||||
UIO_WRITE = 1,
|
||||
UIO_READ = 0,
|
||||
UIO_WRITE = 1,
|
||||
} uio_rw_t;
|
||||
|
||||
typedef enum uio_seg {
|
||||
UIO_USERSPACE = 0,
|
||||
UIO_SYSSPACE = 1,
|
||||
UIO_USERISPACE= 2,
|
||||
UIO_BVEC = 3,
|
||||
UIO_USERSPACE = 0,
|
||||
UIO_SYSSPACE = 1,
|
||||
UIO_USERISPACE = 2,
|
||||
UIO_BVEC = 3,
|
||||
} uio_seg_t;
|
||||
|
||||
typedef struct uio {
|
||||
@ -71,7 +71,7 @@ typedef enum xuio_type {
|
||||
} xuio_type_t;
|
||||
|
||||
|
||||
#define UIOA_IOV_MAX 16
|
||||
#define UIOA_IOV_MAX 16
|
||||
|
||||
typedef struct uioa_page_s {
|
||||
int uioa_pfncnt;
|
||||
@ -100,7 +100,7 @@ typedef struct xuio {
|
||||
} xu_ext;
|
||||
} xuio_t;
|
||||
|
||||
#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv
|
||||
#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw
|
||||
#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv
|
||||
#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw
|
||||
|
||||
#endif /* SPL_UIO_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_UNISTD_H
|
||||
#define _SPL_UNISTD_H
|
||||
#define _SPL_UNISTD_H
|
||||
|
||||
#endif /* SPL_UNISTD_H */
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_USER_H
|
||||
#define _SPL_USER_H
|
||||
#define _SPL_USER_H
|
||||
|
||||
/*
|
||||
* We have uf_info_t for areleasef(). We implement areleasef() using a global
|
||||
@ -37,6 +37,6 @@
|
||||
struct uf_info;
|
||||
typedef struct uf_info uf_info_t;
|
||||
|
||||
#define P_FINFO(x) ((uf_info_t *)x)
|
||||
#define P_FINFO(x) ((uf_info_t *)x)
|
||||
|
||||
#endif /* SPL_USER_H */
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_VA_LIST_H
|
||||
#define _SPL_VA_LIST_H
|
||||
#define _SPL_VA_LIST_H
|
||||
|
||||
#endif /* SPL_VA_LIST_H */
|
||||
|
@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_VARARGS_H
|
||||
#define _SPL_VARARGS_H
|
||||
#define _SPL_VARARGS_H
|
||||
|
||||
#define __va_list va_list
|
||||
#define __va_list va_list
|
||||
|
||||
#endif /* SPL_VARARGS_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ZFS_H
|
||||
#define _SPL_ZFS_H
|
||||
#define _SPL_ZFS_H
|
||||
|
||||
#include <linux/mount.h>
|
||||
#include <linux/fs.h>
|
||||
@ -40,7 +40,7 @@ typedef struct spl_fid {
|
||||
long fid_pad;
|
||||
struct {
|
||||
ushort_t len; /* length of data in bytes */
|
||||
char data[MAXFIDSZ];/* data (variable len) */
|
||||
char data[MAXFIDSZ]; /* data (variable len) */
|
||||
} _fid;
|
||||
} un;
|
||||
} fid_t;
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_OPREG_H
|
||||
#define _SPL_OPREG_H
|
||||
#define _SPL_OPREG_H
|
||||
|
||||
#endif /* SPL_OPREG_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_VMSYSTM_H
|
||||
#define _SPL_VMSYSTM_H
|
||||
#define _SPL_VMSYSTM_H
|
||||
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/mm.h>
|
||||
@ -48,9 +48,9 @@ copyin(const void *from, void *to, size_t len)
|
||||
{
|
||||
/* On error copyin routine returns -1 */
|
||||
if (xcopyin(from, to, len))
|
||||
return -1;
|
||||
return (-1);
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
@ -58,9 +58,9 @@ copyout(const void *from, void *to, size_t len)
|
||||
{
|
||||
/* On error copyout routine returns -1 */
|
||||
if (xcopyout(from, to, len))
|
||||
return -1;
|
||||
return (-1);
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
@ -69,7 +69,7 @@ copyinstr(const void *from, void *to, size_t len, size_t *done)
|
||||
size_t rc;
|
||||
|
||||
if (len == 0)
|
||||
return -ENAMETOOLONG;
|
||||
return (-ENAMETOOLONG);
|
||||
|
||||
/* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */
|
||||
|
||||
@ -78,7 +78,7 @@ copyinstr(const void *from, void *to, size_t len, size_t *done)
|
||||
if (done != NULL)
|
||||
*done = rc;
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* SPL_VMSYSTM_H */
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_VNODE_H
|
||||
#define _SPL_VNODE_H
|
||||
#define _SPL_VNODE_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/syscalls.h>
|
||||
@ -49,25 +49,25 @@
|
||||
* was properly split in to O_SYNC and O_DSYNC respectively.
|
||||
*/
|
||||
#ifndef O_DSYNC
|
||||
#define O_DSYNC O_SYNC
|
||||
#define O_DSYNC O_SYNC
|
||||
#endif
|
||||
|
||||
#define FREAD 1
|
||||
#define FWRITE 2
|
||||
#define FCREAT O_CREAT
|
||||
#define FTRUNC O_TRUNC
|
||||
#define FOFFMAX O_LARGEFILE
|
||||
#define FSYNC O_SYNC
|
||||
#define FDSYNC O_DSYNC
|
||||
#define FRSYNC O_SYNC
|
||||
#define FEXCL O_EXCL
|
||||
#define FDIRECT O_DIRECT
|
||||
#define FAPPEND O_APPEND
|
||||
#define FREAD 1
|
||||
#define FWRITE 2
|
||||
#define FCREAT O_CREAT
|
||||
#define FTRUNC O_TRUNC
|
||||
#define FOFFMAX O_LARGEFILE
|
||||
#define FSYNC O_SYNC
|
||||
#define FDSYNC O_DSYNC
|
||||
#define FRSYNC O_SYNC
|
||||
#define FEXCL O_EXCL
|
||||
#define FDIRECT O_DIRECT
|
||||
#define FAPPEND O_APPEND
|
||||
|
||||
#define FNODSYNC 0x10000 /* fsync pseudo flag */
|
||||
#define FNOFOLLOW 0x20000 /* don't follow symlinks */
|
||||
#define FNODSYNC 0x10000 /* fsync pseudo flag */
|
||||
#define FNOFOLLOW 0x20000 /* don't follow symlinks */
|
||||
|
||||
#define F_FREESP 11 /* Free file space */
|
||||
#define F_FREESP 11 /* Free file space */
|
||||
|
||||
|
||||
/*
|
||||
@ -79,30 +79,30 @@
|
||||
#undef AT_UID
|
||||
#undef AT_GID
|
||||
|
||||
#define AT_MODE ATTR_MODE
|
||||
#define AT_UID ATTR_UID
|
||||
#define AT_GID ATTR_GID
|
||||
#define AT_SIZE ATTR_SIZE
|
||||
#define AT_ATIME ATTR_ATIME
|
||||
#define AT_MTIME ATTR_MTIME
|
||||
#define AT_CTIME ATTR_CTIME
|
||||
#define AT_MODE ATTR_MODE
|
||||
#define AT_UID ATTR_UID
|
||||
#define AT_GID ATTR_GID
|
||||
#define AT_SIZE ATTR_SIZE
|
||||
#define AT_ATIME ATTR_ATIME
|
||||
#define AT_MTIME ATTR_MTIME
|
||||
#define AT_CTIME ATTR_CTIME
|
||||
|
||||
#define ATTR_XVATTR (1 << 31)
|
||||
#define AT_XVATTR ATTR_XVATTR
|
||||
#define ATTR_XVATTR (1 << 31)
|
||||
#define AT_XVATTR ATTR_XVATTR
|
||||
|
||||
#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
|
||||
#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
|
||||
ATTR_ATIME | ATTR_MTIME | ATTR_CTIME | ATTR_FILE)
|
||||
|
||||
#define CRCREAT 0x01
|
||||
#define RMFILE 0x02
|
||||
#define CRCREAT 0x01
|
||||
#define RMFILE 0x02
|
||||
|
||||
#define B_INVAL 0x01
|
||||
#define B_TRUNC 0x02
|
||||
#define B_INVAL 0x01
|
||||
#define B_TRUNC 0x02
|
||||
|
||||
#define LOOKUP_DIR 0x01
|
||||
#define LOOKUP_XATTR 0x02
|
||||
#define CREATE_XATTR_DIR 0x04
|
||||
#define ATTR_NOACLCHECK 0x20
|
||||
#define LOOKUP_DIR 0x01
|
||||
#define LOOKUP_XATTR 0x02
|
||||
#define CREATE_XATTR_DIR 0x04
|
||||
#define ATTR_NOACLCHECK 0x20
|
||||
|
||||
typedef enum vtype {
|
||||
VNON = 0,
|
||||
@ -121,8 +121,8 @@ typedef enum vtype {
|
||||
|
||||
typedef struct vattr {
|
||||
enum vtype va_type; /* vnode type */
|
||||
u_int va_mask; /* attribute bit-mask */
|
||||
u_short va_mode; /* acc mode */
|
||||
uint_t va_mask; /* attribute bit-mask */
|
||||
ushort_t va_mode; /* acc mode */
|
||||
uid_t va_uid; /* owner uid */
|
||||
gid_t va_gid; /* owner gid */
|
||||
long va_fsid; /* fs id */
|
||||
@ -168,12 +168,12 @@ void vn_free(vnode_t *vp);
|
||||
extern vtype_t vn_mode_to_vtype(mode_t);
|
||||
extern mode_t vn_vtype_to_mode(vtype_t);
|
||||
extern int vn_open(const char *path, uio_seg_t seg, int flags, int mode,
|
||||
vnode_t **vpp, int x1, void *x2);
|
||||
vnode_t **vpp, int x1, void *x2);
|
||||
extern int vn_openat(const char *path, uio_seg_t seg, int flags, int mode,
|
||||
vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd);
|
||||
vnode_t **vpp, int x1, void *x2, vnode_t *vp, int fd);
|
||||
extern int vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len,
|
||||
offset_t off, uio_seg_t seg, int x1, rlim64_t x2,
|
||||
void *x3, ssize_t *residp);
|
||||
offset_t off, uio_seg_t seg, int x1, rlim64_t x2,
|
||||
void *x3, ssize_t *residp);
|
||||
extern int vn_close(vnode_t *vp, int flags, int x1, int x2, void *x3, void *x4);
|
||||
extern int vn_seek(vnode_t *vp, offset_t o, offset_t *op, void *ct);
|
||||
|
||||
@ -189,16 +189,16 @@ extern int vn_set_pwd(const char *filename);
|
||||
int spl_vn_init(void);
|
||||
void spl_vn_fini(void);
|
||||
|
||||
#define VOP_CLOSE vn_close
|
||||
#define VOP_SEEK vn_seek
|
||||
#define VOP_GETATTR vn_getattr
|
||||
#define VOP_FSYNC vn_fsync
|
||||
#define VOP_SPACE vn_space
|
||||
#define VOP_PUTPAGE(vp, o, s, f, x1, x2) ((void)0)
|
||||
#define vn_is_readonly(vp) 0
|
||||
#define getf vn_getf
|
||||
#define releasef vn_releasef
|
||||
#define areleasef vn_areleasef
|
||||
#define VOP_CLOSE vn_close
|
||||
#define VOP_SEEK vn_seek
|
||||
#define VOP_GETATTR vn_getattr
|
||||
#define VOP_FSYNC vn_fsync
|
||||
#define VOP_SPACE vn_space
|
||||
#define VOP_PUTPAGE(vp, o, s, f, x1, x2) ((void)0)
|
||||
#define vn_is_readonly(vp) 0
|
||||
#define getf vn_getf
|
||||
#define releasef vn_releasef
|
||||
#define areleasef vn_areleasef
|
||||
|
||||
extern vnode_t *rootdir;
|
||||
|
||||
|
@ -20,7 +20,8 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the SPL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************
|
||||
*
|
||||
*
|
||||
* z_compress_level/z_uncompress are nearly identical copies of the
|
||||
* compress2/uncompress functions provided by the official zlib package
|
||||
* available at http://zlib.net/. The only changes made we to slightly
|
||||
@ -53,7 +54,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ZMOD_H
|
||||
#define _SPL_ZMOD_H
|
||||
#define _SPL_ZMOD_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <linux/zlib.h>
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_ZONE_H
|
||||
#define _SPL_ZONE_H
|
||||
#define _SPL_ZONE_H
|
||||
|
||||
#include <sys/byteorder.h>
|
||||
|
||||
|
@ -23,6 +23,6 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_UNISTD_H
|
||||
#define _SPL_UNISTD_H
|
||||
#define _SPL_UNISTD_H
|
||||
|
||||
#endif /* SPL_UNISTD_H */
|
||||
|
@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
#ifndef _SPL_QSORT_H
|
||||
#define _SPL_QSORT_H
|
||||
#define _SPL_QSORT_H
|
||||
|
||||
#include <linux/sort.h>
|
||||
|
||||
#define qsort(base, num, size, cmp) sort(base, num, size, cmp, NULL)
|
||||
#define qsort(base, num, size, cmp) sort(base, num, size, cmp, NULL)
|
||||
|
||||
#endif /* SPL_QSORT_H */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user