@@ -325,9 +325,10 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
set_mrc_cr_flags(rec, cr_flags);
}
-static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid)
+static inline enum mds_attr_flags mdc_attr_pack(unsigned int ia_valid,
+ enum op_xvalid ia_xvalid)
{
- u64 sa_valid = 0;
+ enum mds_attr_flags sa_valid = 0;
if (ia_valid & ATTR_MODE)
sa_valid |= MDS_ATTR_MODE;
@@ -370,6 +371,7 @@ static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid)
sa_valid |= MDS_ATTR_LSIZE;
if (ia_xvalid & OP_XVALID_LAZYBLOCKS)
sa_valid |= MDS_ATTR_LBLOCKS;
+
return sa_valid;
}
@@ -383,8 +385,8 @@ static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec,
rec->sa_suppgid = -1;
rec->sa_fid = op_data->op_fid1;
- rec->sa_valid = attr_pack(op_data->op_attr.ia_valid,
- op_data->op_xvalid);
+ rec->sa_valid = mdc_attr_pack(op_data->op_attr.ia_valid,
+ op_data->op_xvalid);
rec->sa_mode = op_data->op_attr.ia_mode;
rec->sa_uid = from_kuid(&init_user_ns, op_data->op_attr.ia_uid);
rec->sa_gid = from_kgid(&init_user_ns, op_data->op_attr.ia_gid);
@@ -1683,28 +1683,30 @@ struct mdt_rec_setattr {
* since the client and MDS may run different kernels (see bug 13828)
* Therefore, we should only use MDS_ATTR_* attributes for sa_valid.
*/
-#define MDS_ATTR_MODE 0x1ULL /* = 1 */
-#define MDS_ATTR_UID 0x2ULL /* = 2 */
-#define MDS_ATTR_GID 0x4ULL /* = 4 */
-#define MDS_ATTR_SIZE 0x8ULL /* = 8 */
-#define MDS_ATTR_ATIME 0x10ULL /* = 16 */
-#define MDS_ATTR_MTIME 0x20ULL /* = 32 */
-#define MDS_ATTR_CTIME 0x40ULL /* = 64 */
-#define MDS_ATTR_ATIME_SET 0x80ULL /* = 128 */
-#define MDS_ATTR_MTIME_SET 0x100ULL /* = 256 */
-#define MDS_ATTR_FORCE 0x200ULL /* = 512, Not a change, but a change it */
-#define MDS_ATTR_ATTR_FLAG 0x400ULL /* = 1024 */
-#define MDS_ATTR_KILL_SUID 0x800ULL /* = 2048 */
-#define MDS_ATTR_KILL_SGID 0x1000ULL /* = 4096 */
-#define MDS_ATTR_CTIME_SET 0x2000ULL /* = 8192 */
-#define MDS_ATTR_FROM_OPEN 0x4000ULL /* = 16384, called from open path,
- * ie O_TRUNC
- */
-#define MDS_ATTR_BLOCKS 0x8000ULL /* = 32768 */
-#define MDS_ATTR_PROJID 0x10000ULL /* = 65536 */
-#define MDS_ATTR_LSIZE 0x20000ULL /* = 131072 */
-#define MDS_ATTR_LBLOCKS 0x40000ULL /* = 262144 */
-#define MDS_ATTR_OVERRIDE 0x2000000ULL /* = 33554432 */
+enum mds_attr_flags {
+ MDS_ATTR_MODE = 0x1ULL, /* = 1 */
+ MDS_ATTR_UID = 0x2ULL, /* = 2 */
+ MDS_ATTR_GID = 0x4ULL, /* = 4 */
+ MDS_ATTR_SIZE = 0x8ULL, /* = 8 */
+ MDS_ATTR_ATIME = 0x10ULL, /* = 16 */
+ MDS_ATTR_MTIME = 0x20ULL, /* = 32 */
+ MDS_ATTR_CTIME = 0x40ULL, /* = 64 */
+ MDS_ATTR_ATIME_SET = 0x80ULL, /* = 128 */
+ MDS_ATTR_MTIME_SET = 0x100ULL, /* = 256 */
+ MDS_ATTR_FORCE = 0x200ULL, /* = 512, Not a change, but a change it */
+ MDS_ATTR_ATTR_FLAG = 0x400ULL, /* = 1024 */
+ MDS_ATTR_KILL_SUID = 0x800ULL, /* = 2048 */
+ MDS_ATTR_KILL_SGID = 0x1000ULL, /* = 4096 */
+ MDS_ATTR_CTIME_SET = 0x2000ULL, /* = 8192 */
+ MDS_ATTR_FROM_OPEN = 0x4000ULL, /* = 16384, called from open path,
+ * ie O_TRUNC
+ */
+ MDS_ATTR_BLOCKS = 0x8000ULL, /* = 32768 */
+ MDS_ATTR_PROJID = 0x10000ULL, /* = 65536 */
+ MDS_ATTR_LSIZE = 0x20000ULL, /* = 131072 */
+ MDS_ATTR_LBLOCKS = 0x40000ULL, /* = 262144 */
+ MDS_ATTR_OVERRIDE = 0x2000000ULL, /* = 33554432 */
+};
enum mds_op_bias {
/* MDS_CHECK_SPLIT = 1 << 0, obsolete before 2.3.58 */