From: Andreas Dilger Date: Thu, 8 May 2014 21:27:21 +0000 (-0600) Subject: LU-5017 idl: clean up file attribute flags X-Git-Tag: 2.7.65~42 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=26fae8692eed9998aa0286749a068b67279e7163 LU-5017 idl: clean up file attribute flags Remove unused file attribute flag LUSTRE_BFLAG_UNCOMMITTED_WRITES that was used internally on the client at one point. Remove unused file attribute LUSTRE_BFLAG_EXT_FLAGS from wireshark which was used to distinguish between S_* (in-memory) flags and *_FL (on-disk) flags. Add flags from the kernel which may be useful in the near future. Signed-off-by: Andreas Dilger Change-Id: I39d6f26aa0fbe7b5f6ddcf31d97c959556660310 Reviewed-on: http://review.whamcloud.com/10274 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: wangdi Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- diff --git a/lustre/contrib/wireshark/packet-lustre.c b/lustre/contrib/wireshark/packet-lustre.c index 5cff78b..cf41609 100644 --- a/lustre/contrib/wireshark/packet-lustre.c +++ b/lustre/contrib/wireshark/packet-lustre.c @@ -1085,13 +1085,16 @@ const value_string lustre_llog_hdr_llh_flags[]= { }; const value_string lustre_mds_flags_vals[] = { - {0x1, "LUSTRE_BFLAG_UNCOMMITTED_WRITES"}, - {0x80000000, "LUSTRE_BFLAG_EXT_FLAGS"}, /* == EXT3_RESERVED_FL */ {0x00000008, "LUSTRE_SYNC_FL "}, /* Synchronous updates */ {0x00000010, "LUSTRE_IMMUTABLE_FL "}, /* Immutable file */ {0x00000020, "LUSTRE_APPEND_FL "}, /* writes to file may only append */ + {0x00000040, "LUSTRE_NODUMP_FL "}, /* do not dump file */ {0x00000080, "LUSTRE_NOATIME_FL "}, /* do not update atime */ + {0x00001000, "LUSTRE_INDEX_FL "}, /* hash-indexed directory */ {0x00010000, "LUSTRE_DIRSYNC_FL "}, /* dirsync behaviour (dir only) */ + {0x00020000, "LUSTRE_TOPDIR_FL "}, /* Top of directory hierarchies */ + {0x00100000, "LUSTRE_DIRECTIO_FL "}, /* Use direct i/o */ + {0x10000000, "LUSTRE_INLINE_DATA_FL "}, /* Inode has inline data. */ { 0, NULL } }; diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 85364f1..82a3016 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -2151,15 +2151,18 @@ enum { #define MDS_STATUS_CONN 1 #define MDS_STATUS_LOV 2 -#define LUSTRE_BFLAG_UNCOMMITTED_WRITES 0x1 - /* these should be identical to their EXT4_*_FL counterparts, they are * redefined here only to avoid dragging in fs/ext4/ext4.h */ -#define LUSTRE_SYNC_FL 0x00000008 /* Synchronous updates */ -#define LUSTRE_IMMUTABLE_FL 0x00000010 /* Immutable file */ -#define LUSTRE_APPEND_FL 0x00000020 /* writes to file may only append */ -#define LUSTRE_NOATIME_FL 0x00000080 /* do not update atime */ -#define LUSTRE_DIRSYNC_FL 0x00010000 /* dirsync behaviour (dir only) */ +#define LUSTRE_SYNC_FL 0x00000008 /* Synchronous updates */ +#define LUSTRE_IMMUTABLE_FL 0x00000010 /* Immutable file */ +#define LUSTRE_APPEND_FL 0x00000020 /* writes to file may only append */ +#define LUSTRE_NODUMP_FL 0x00000040 /* do not dump file */ +#define LUSTRE_NOATIME_FL 0x00000080 /* do not update atime */ +#define LUSTRE_INDEX_FL 0x00001000 /* hash-indexed directory */ +#define LUSTRE_DIRSYNC_FL 0x00010000 /* dirsync behaviour (dir only) */ +#define LUSTRE_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ +#define LUSTRE_DIRECTIO_FL 0x00100000 /* Use direct i/o */ +#define LUSTRE_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */ #ifdef __KERNEL__ /* Convert wire LUSTRE_*_FL to corresponding client local VFS S_* values @@ -2216,7 +2219,7 @@ struct mdt_body { __u32 mbo_mode; __u32 mbo_uid; __u32 mbo_gid; - __u32 mbo_flags; + __u32 mbo_flags; /* LUSTRE_*_FL file attributes */ __u32 mbo_rdev; __u32 mbo_nlink; /* #bytes to read in the case of MDS_READPAGE */ __u32 mbo_unused2; /* was "generation" until 2.4.0 */ diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index ed3a67f..541efbf 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -488,7 +488,7 @@ static int mdd_fix_attr(const struct lu_env *env, struct mdd_object *obj, RETURN(-EPERM); if (!S_ISDIR(oattr->la_mode)) - la->la_flags &= ~LUSTRE_DIRSYNC_FL; + la->la_flags &= ~(LUSTRE_DIRSYNC_FL | LUSTRE_TOPDIR_FL); } if (oattr->la_flags & (LUSTRE_IMMUTABLE_FL | LUSTRE_APPEND_FL) && diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 4a5a4c3..785bf4e 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -222,8 +222,6 @@ void lustre_assert_wire_constants(void) (long long)MDS_STATUS_CONN); LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n", (long long)MDS_STATUS_LOV); - LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n", - (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES); LASSERTF(MDS_ATTR_MODE == 0x0000000000000001ULL, "found 0x%.16llxULL\n", (long long)MDS_ATTR_MODE); LASSERTF(MDS_ATTR_UID == 0x0000000000000002ULL, "found 0x%.16llxULL\n", @@ -2160,10 +2158,20 @@ void lustre_assert_wire_constants(void) LUSTRE_IMMUTABLE_FL); LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n", LUSTRE_APPEND_FL); + LASSERTF(LUSTRE_NODUMP_FL == 0x00000040, "found 0x%.8x\n", + LUSTRE_NODUMP_FL); LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n", LUSTRE_NOATIME_FL); + LASSERTF(LUSTRE_INDEX_FL == 0x00001000, "found 0x%.8x\n", + LUSTRE_INDEX_FL); LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n", LUSTRE_DIRSYNC_FL); + LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000, "found 0x%.8x\n", + LUSTRE_TOPDIR_FL); + LASSERTF(LUSTRE_DIRECTIO_FL == 0x00100000, "found 0x%.8x\n", + LUSTRE_DIRECTIO_FL); + LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000, "found 0x%.8x\n", + LUSTRE_INLINE_DATA_FL); LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n", MDS_INODELOCK_LOOKUP); LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index e72a556..3e65b75 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -960,8 +960,13 @@ check_mdt_body(void) CHECK_DEFINE_X(LUSTRE_SYNC_FL); CHECK_DEFINE_X(LUSTRE_IMMUTABLE_FL); CHECK_DEFINE_X(LUSTRE_APPEND_FL); + CHECK_DEFINE_X(LUSTRE_NODUMP_FL); CHECK_DEFINE_X(LUSTRE_NOATIME_FL); + CHECK_DEFINE_X(LUSTRE_INDEX_FL); CHECK_DEFINE_X(LUSTRE_DIRSYNC_FL); + CHECK_DEFINE_X(LUSTRE_TOPDIR_FL); + CHECK_DEFINE_X(LUSTRE_DIRECTIO_FL); + CHECK_DEFINE_X(LUSTRE_INLINE_DATA_FL); CHECK_DEFINE_X(MDS_INODELOCK_LOOKUP); CHECK_DEFINE_X(MDS_INODELOCK_UPDATE); @@ -2412,8 +2417,6 @@ main(int argc, char **argv) CHECK_VALUE(MDS_STATUS_CONN); CHECK_VALUE(MDS_STATUS_LOV); - CHECK_VALUE(LUSTRE_BFLAG_UNCOMMITTED_WRITES); - CHECK_VALUE_64X(MDS_ATTR_MODE); CHECK_VALUE_64X(MDS_ATTR_UID); CHECK_VALUE_64X(MDS_ATTR_GID); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index bec44ea..100d752 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -233,8 +233,6 @@ void lustre_assert_wire_constants(void) (long long)MDS_STATUS_CONN); LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n", (long long)MDS_STATUS_LOV); - LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n", - (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES); LASSERTF(MDS_ATTR_MODE == 0x0000000000000001ULL, "found 0x%.16llxULL\n", (long long)MDS_ATTR_MODE); LASSERTF(MDS_ATTR_UID == 0x0000000000000002ULL, "found 0x%.16llxULL\n", @@ -2171,10 +2169,20 @@ void lustre_assert_wire_constants(void) LUSTRE_IMMUTABLE_FL); LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n", LUSTRE_APPEND_FL); + LASSERTF(LUSTRE_NODUMP_FL == 0x00000040, "found 0x%.8x\n", + LUSTRE_NODUMP_FL); LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n", LUSTRE_NOATIME_FL); + LASSERTF(LUSTRE_INDEX_FL == 0x00001000, "found 0x%.8x\n", + LUSTRE_INDEX_FL); LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n", LUSTRE_DIRSYNC_FL); + LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000, "found 0x%.8x\n", + LUSTRE_TOPDIR_FL); + LASSERTF(LUSTRE_DIRECTIO_FL == 0x00100000, "found 0x%.8x\n", + LUSTRE_DIRECTIO_FL); + LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000, "found 0x%.8x\n", + LUSTRE_INLINE_DATA_FL); LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n", MDS_INODELOCK_LOOKUP); LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",