X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre%2Flustre_user.h;h=be69c18570a23efff0eb33943b692ccdb732a505;hb=4f91d5161d005eed6ff7a9fe6abea99690f4bcb7;hp=d6f7e884c2edec419554e89ddd46b7c74b4426a5;hpb=4b7cbec396fcd7afb81d601a2facb70ee8c7ad28;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index d6f7e88..be69c18 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -28,6 +28,8 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011, 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -154,7 +156,7 @@ struct obd_statfs { /* see for ioctl numbers 177-210 */ -#define LL_STATFS_MDC 1 +#define LL_STATFS_LMV 1 #define LL_STATFS_LOV 2 #define IOC_MDC_TYPE 'i' @@ -167,6 +169,9 @@ struct obd_statfs { #define LL_IOC_OBD_STATFS IOC_OBD_STATFS #define IOC_MDC_GETSTRIPE IOC_MDC_GETFILESTRIPE + +#define MAX_OBD_NAME 128 /* If this changes, a NEW ioctl must be added */ + #define O_LOV_DELAY_CREATE 0100000000 /* hopefully this does not conflict */ #define LL_FILE_IGNORE_LOCK 0x00000001 @@ -197,6 +202,7 @@ struct lov_user_ost_data_v1 { /* per-stripe data structure */ } __attribute__((packed)); #define lov_user_md lov_user_md_v1 +#define lmm_stripe_offset u.lum_stripe_offset struct lov_user_md_v1 { /* LOV EA user data (host-endian) */ __u32 lmm_magic; /* magic number = LOV_USER_MAGIC_V1 */ __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */ @@ -204,7 +210,12 @@ struct lov_user_md_v1 { /* LOV EA user data (host-endian) */ __u64 lmm_object_seq; /* LOV object seq */ __u32 lmm_stripe_size; /* size of stripe in bytes */ __u16 lmm_stripe_count; /* num stripes in use for this object */ - __u16 lmm_stripe_offset; /* starting stripe offset in lmm_objects */ + union { + __u16 lum_stripe_offset; /* starting stripe offset in + * lmm_objects, use when writing */ + __u16 lum_layout_gen; /* layout generation number + * used when reading */ + } u; struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ } __attribute__((packed, __may_alias__)); @@ -215,7 +226,12 @@ struct lov_user_md_v3 { /* LOV EA user data (host-endian) */ __u64 lmm_object_seq; /* LOV object seq */ __u32 lmm_stripe_size; /* size of stripe in bytes */ __u16 lmm_stripe_count; /* num stripes in use for this object */ - __u16 lmm_stripe_offset; /* starting stripe offset in lmm_objects */ + union { + __u16 lum_stripe_offset; /* starting stripe offset in + * lmm_objects, use when writing */ + __u16 lum_layout_gen; /* layout generation number + * used when reading */ + } u; char lmm_pool_name[LOV_MAXPOOLNAME]; /* pool name */ struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ } __attribute__((packed)); @@ -248,8 +264,9 @@ struct ll_fid { * OST for saving into EA. */ }; +#define UUID_MAX 40 struct obd_uuid { - char uuid[40]; + char uuid[UUID_MAX]; }; static inline int obd_uuid_equals(const struct obd_uuid *u1, @@ -448,7 +465,7 @@ struct obd_dqblk { __u64 dqb_btime; __u64 dqb_itime; __u32 dqb_valid; - __u32 padding; + __u32 dqb_padding; }; enum { @@ -532,9 +549,10 @@ static inline const char *changelog_type2str(int type) { #define CLF_HSM_SPARE_H 15 #define CLF_HSM_LAST 15 -#define CLF_GET_BITS(_b, _h, _l) \ - _b &= (0xFFFF << (CLF_HSM_LAST - _h)); \ - _b = _b >> (_l + CLF_HSM_LAST - _h) +/* Remove bits higher than _h, then extract the value + * between _h and _l by shifting lower weigth to bit 0. */ +#define CLF_GET_BITS(_b, _h, _l) (((_b << (CLF_HSM_LAST - _h)) & 0xFFFF) \ + >> (CLF_HSM_LAST - _h + _l)) #define CLF_HSM_SUCCESS 0x00 #define CLF_HSM_MAXERROR 0x7E @@ -556,11 +574,7 @@ enum hsm_event { static inline enum hsm_event hsm_get_cl_event(__u16 flags) { - enum hsm_event he; - - CLF_GET_BITS(flags, CLF_HSM_EVENT_H, CLF_HSM_EVENT_L); - he = flags; - return he; + return CLF_GET_BITS(flags, CLF_HSM_EVENT_H, CLF_HSM_EVENT_L); } static inline void hsm_set_cl_event(int *flags, enum hsm_event he) @@ -570,8 +584,7 @@ static inline void hsm_set_cl_event(int *flags, enum hsm_event he) static inline __u16 hsm_get_cl_flags(int flags) { - CLF_GET_BITS(flags, CLF_HSM_FLAG_H, CLF_HSM_FLAG_L); - return flags; + return CLF_GET_BITS(flags, CLF_HSM_FLAG_H, CLF_HSM_FLAG_L); } static inline void hsm_set_cl_flags(int *flags, int bits) @@ -581,8 +594,7 @@ static inline void hsm_set_cl_flags(int *flags, int bits) static inline int hsm_get_cl_error(int flags) { - CLF_GET_BITS(flags, CLF_HSM_ERR_H, CLF_HSM_ERR_L); - return flags; + return CLF_GET_BITS(flags, CLF_HSM_ERR_H, CLF_HSM_ERR_L); } static inline void hsm_set_cl_error(int *flags, int error)