/* * The 2.9 core will put 64 bit handles in here like this: * 1234 0000 0000 5678 * The 3.0 and beyond cores will put 128 bit handles in here like this: * 1234 5678 90AB CDEF * The kernel module will always use the first four bytes and * the last four bytes as an inum.
*/ struct orangefs_khandle { unsignedchar u[16];
} __aligned(8);
/* * kernel version of an object ref.
*/ struct orangefs_object_kref { struct orangefs_khandle khandle;
__s32 fs_id;
__s32 __pad1;
};
/* * compare 2 khandles assumes little endian thus from large address to * small address
*/ staticinlineint ORANGEFS_khandle_cmp(conststruct orangefs_khandle *kh1, conststruct orangefs_khandle *kh2)
{ int i;
for (i = 15; i >= 0; i--) { if (kh1->u[i] > kh2->u[i]) return 1; if (kh1->u[i] < kh2->u[i]) return -1;
}
return 0;
}
staticinlinevoid ORANGEFS_khandle_to(conststruct orangefs_khandle *kh, void *p, int size)
{
/* * ORANGEFS error codes are a signed 32-bit integer. Error codes are negative, but * the sign is stripped before decoding.
*/
/* Bit 31 is not used since it is the sign. */
/* * Bit 30 specifies that this is a ORANGEFS error. A ORANGEFS error is either an * encoded errno value or a ORANGEFS protocol error.
*/ #define ORANGEFS_ERROR_BIT (1 << 30)
/* * Bit 29 specifies that this is a ORANGEFS protocol error and not an encoded * errno value.
*/ #define ORANGEFS_NON_ERRNO_ERROR_BIT (1 << 29)
/* * Bits 9, 8, and 7 specify the error class, which encodes the section of * server code the error originated in for logging purposes. It is not used * in the kernel except to be masked out.
*/ #define ORANGEFS_ERROR_CLASS_BITS 0x380
/* Bits 6 - 0 are reserved for the actual error code. */ #define ORANGEFS_ERROR_NUMBER_BITS 0x7f
/* Encoded errno values decoded by PINT_errno_mapping in orangefs-utils.c. */
#define ORANGEFS_XATTR_REPLACE 0x2 #define ORANGEFS_XATTR_CREATE 0x1 #define ORANGEFS_MAX_SERVER_ADDR_LEN 256 #define ORANGEFS_NAME_MAX 256 /* * max extended attribute name len as imposed by the VFS and exploited for the * upcall request types. * NOTE: Please retain them as multiples of 8 even if you wish to change them * This is *NECESSARY* for supporting 32 bit user-space binaries on a 64-bit * kernel. Due to implementation within DBPF, this really needs to be * ORANGEFS_NAME_MAX, which it was the same value as, but no reason to let it * break if that changes in the future.
*/ #define ORANGEFS_MAX_XATTR_NAMELEN ORANGEFS_NAME_MAX /* Not the same as * XATTR_NAME_MAX defined * by <linux/xattr.h>
*/ #define ORANGEFS_MAX_XATTR_VALUELEN 8192 /* Not the same as XATTR_SIZE_MAX * defined by <linux/xattr.h>
*/ #define ORANGEFS_MAX_XATTR_LISTLEN 16 /* Not the same as XATTR_LIST_MAX * defined by <linux/xattr.h>
*/ /* * ORANGEFS I/O operation types, used in both system and server interfaces.
*/ enum ORANGEFS_io_type {
ORANGEFS_IO_READ = 1,
ORANGEFS_IO_WRITE = 2
};
/* * If this enum is modified the server parameters related to the precreate pool * batch and low threshold sizes may need to be modified to reflect this * change.
*/ enum orangefs_ds_type {
ORANGEFS_TYPE_NONE = 0,
ORANGEFS_TYPE_METAFILE = (1 << 0),
ORANGEFS_TYPE_DATAFILE = (1 << 1),
ORANGEFS_TYPE_DIRECTORY = (1 << 2),
ORANGEFS_TYPE_SYMLINK = (1 << 3),
ORANGEFS_TYPE_DIRDATA = (1 << 4),
ORANGEFS_TYPE_INTERNAL = (1 << 5) /* for the server's private use */
};
/* This structure is used by the VFS-client interaction alone */ struct ORANGEFS_keyval_pair { char key[ORANGEFS_MAX_XATTR_NAMELEN];
__s32 key_sz; /* __s32 for portable, fixed-size structures */
__s32 val_sz; char val[ORANGEFS_MAX_XATTR_VALUELEN];
};
/* pvfs2-sysint.h ***********************************************************/ /* Describes attributes for a file, directory, or symlink. */ struct ORANGEFS_sys_attr_s {
__u32 owner;
__u32 group;
__u32 perms;
__u64 atime;
__u64 mtime;
__u64 ctime;
__s64 size;
/* NOTE: caller must free if valid */ char *link_target;
/* Changed to __s32 so that size of structure does not change */
__s32 dfile_count;
/* Changed to __s32 so that size of structure does not change */
__s32 distr_dir_servers_initial;
/* Changed to __s32 so that size of structure does not change */
__s32 distr_dir_servers_max;
/* Changed to __s32 so that size of structure does not change */
__s32 distr_dir_split_size;
__u32 mirror_copies_count;
/* NOTE: caller must free if valid */ char *dist_name;
/* NOTE: caller must free if valid */ char *dist_params;
/* * version number for use in communicating between kernel space and user * space. Zero signifies the upstream version of the kernel module.
*/ #define ORANGEFS_KERNEL_PROTO_VERSION 0 #define ORANGEFS_MINIMUM_USERSPACE_VERSION 20903
/* * describes memory regions to map in the ORANGEFS_DEV_MAP ioctl. * NOTE: See devorangefs-req.c for 32 bit compat structure. * Since this structure has a variable-sized layout that is different * on 32 and 64 bit platforms, we need to normalize to a 64 bit layout * on such systems before servicing ioctl calls from user-space binaries * that may be 32 bit!
*/ struct ORANGEFS_dev_map_desc { void __user *ptr;
__s32 total_size;
__s32 size;
__s32 count;
};
/* try to avoid function call overhead by checking masks in macro */ #define gossip_debug(mask, fmt, ...) \ do { \ if (orangefs_gossip_debug_mask & (mask)) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
} while (0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.