Whamcloud - gitweb
LU-18177 lustre: use enum cl_attr_valid instead of unsigned 82/56182/4
authorBobi Jam <bobijam@whamcloud.com>
Wed, 28 Aug 2024 14:38:59 +0000 (22:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Mar 2025 23:30:53 +0000 (23:30 +0000)
The last parameter of coo_attr_update() should be enum cl_attr_valid
instead of __u32/unsigned int

Test-Parameters: trivial
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I1e02f1f3621d82d5e279f6d37571ea43929f083e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56182
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
12 files changed:
lustre/include/cl_object.h
lustre/include/lustre_osc.h
lustre/llite/vvp_io.c
lustre/llite/vvp_object.c
lustre/lov/lov_object.c
lustre/lov/lovsub_object.c
lustre/mdc/mdc_dev.c
lustre/obdclass/cl_object.c
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_request.c

index 26dce98..fc9407c 100644 (file)
@@ -359,7 +359,8 @@ struct cl_object_operations {
         * cl_object_operations::coo_attr_get() is used.
         */
        int (*coo_attr_update)(const struct lu_env *env, struct cl_object *obj,
-                              const struct cl_attr *attr, unsigned int valid);
+                              const struct cl_attr *attr,
+                              enum cl_attr_valid valid);
        /**
         * Mark the inode dirty. By this way, the inode will add into the
         * writeback list of the corresponding @bdi_writeback, and then it will
@@ -2125,7 +2126,8 @@ void cl_object_attr_unlock(struct cl_object *o);
 int  cl_object_attr_get(const struct lu_env *env, struct cl_object *obj,
                        struct cl_attr *attr);
 int  cl_object_attr_update(const struct lu_env *env, struct cl_object *obj,
-                          const struct cl_attr *attr, unsigned int valid);
+                          const struct cl_attr *attr,
+                          enum cl_attr_valid valid);
 void cl_object_dirty_for_sync(const struct lu_env *env, struct cl_object *obj);
 int  cl_object_glimpse(const struct lu_env *env, struct cl_object *obj,
                       struct ost_lvb *lvb);
index a6e52f2..fbe0552 100644 (file)
@@ -631,7 +631,7 @@ int osc_object_print(const struct lu_env *env, void *cookie,
 int osc_attr_get(const struct lu_env *env, struct cl_object *obj,
                 struct cl_attr *attr);
 int osc_attr_update(const struct lu_env *env, struct cl_object *obj,
-                   const struct cl_attr *attr, unsigned int valid);
+                   const struct cl_attr *attr, enum cl_attr_valid valid);
 int osc_object_glimpse(const struct lu_env *env, const struct cl_object *obj,
                       struct ost_lvb *lvb);
 int osc_object_invalidate(const struct lu_env *env, struct osc_object *osc);
index 03a22d6..54c0098 100644 (file)
@@ -687,7 +687,7 @@ static int vvp_io_setattr_time(const struct lu_env *env,
        struct cl_object *obj   = io->ci_obj;
        struct cl_attr *attr  = vvp_env_new_attr(env);
        int result;
-       unsigned int valid = CAT_CTIME;
+       enum cl_attr_valid valid = CAT_CTIME;
 
        cl_object_attr_lock(obj);
        attr->cat_ctime = io->u.ci_setattr.sa_attr.lvb_ctime;
index fb6032c..6b73cbe 100644 (file)
@@ -80,7 +80,7 @@ static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj,
 }
 
 static int vvp_attr_update(const struct lu_env *env, struct cl_object *obj,
-                          const struct cl_attr *attr, unsigned int valid)
+                          const struct cl_attr *attr, enum cl_attr_valid valid)
 {
        struct inode *inode = vvp_object_inode(obj);
 
index a9da801..b9a3bbb 100644 (file)
@@ -1602,7 +1602,7 @@ static int lov_attr_get(const struct lu_env *env, struct cl_object *obj,
 }
 
 static int lov_attr_update(const struct lu_env *env, struct cl_object *obj,
-                          const struct cl_attr *attr, unsigned valid)
+                          const struct cl_attr *attr, enum cl_attr_valid valid)
 {
        /*
         * No dispatch is required here, as no layout implements this.
index e8abc5a..336aa85 100644 (file)
@@ -95,7 +95,8 @@ static int lovsub_object_print(const struct lu_env *env, void *cookie,
 }
 
 static int lovsub_attr_update(const struct lu_env *env, struct cl_object *obj,
-                             const struct cl_attr *attr, unsigned valid)
+                             const struct cl_attr *attr,
+                             enum cl_attr_valid valid)
 {
        struct lovsub_object *los = cl2lovsub(obj);
        struct lov_object *lov = cl2lovsub(obj)->lso_super;
index 50e8241..81f1b4d 100644 (file)
@@ -408,8 +408,8 @@ void mdc_lock_lvb_update(const struct lu_env *env, struct osc_object *osc,
        struct cl_object *obj = osc2cl(osc);
        struct lov_oinfo *oinfo = osc->oo_oinfo;
        struct cl_attr *attr = &osc_env_info(env)->oti_attr;
-       unsigned valid = CAT_BLOCKS | CAT_ATIME | CAT_CTIME | CAT_MTIME |
-                        CAT_SIZE;
+       enum cl_attr_valid valid = CAT_BLOCKS | CAT_ATIME | CAT_CTIME |
+                                  CAT_MTIME | CAT_SIZE;
        unsigned int setkms = 0;
 
        ENTRY;
@@ -1071,7 +1071,7 @@ static int mdc_io_setattr_start(const struct lu_env *env,
                rc = cl_object_attr_get(env, obj, attr);
                if (rc == 0) {
                        struct ost_lvb *lvb = &io->u.ci_setattr.sa_attr;
-                       unsigned int cl_valid = 0;
+                       enum cl_attr_valid cl_valid = 0;
 
                        if (ia_avalid & ATTR_SIZE) {
                                attr->cat_size = size;
index eaa7cc3..7bb5d6e 100644 (file)
@@ -211,7 +211,7 @@ EXPORT_SYMBOL(cl_object_attr_get);
  * to top.
  */
 int cl_object_attr_update(const struct lu_env *env, struct cl_object *top,
-                         const struct cl_attr *attr, unsigned v)
+                         const struct cl_attr *attr, enum cl_attr_valid v)
 {
        struct cl_object *obj;
        int result = 0;
index c6015e9..c026f35 100644 (file)
@@ -253,7 +253,7 @@ void osc_page_touch_at(const struct lu_env *env, struct cl_object *obj,
 {
        struct lov_oinfo  *loi  = cl2osc(obj)->oo_oinfo;
        struct cl_attr    *attr = &osc_env_info(env)->oti_attr;
-       int valid;
+       enum cl_attr_valid valid;
        __u64 kms;
 
        ENTRY;
@@ -590,7 +590,7 @@ static int osc_io_setattr_start(const struct lu_env *env,
                result = cl_object_attr_get(env, obj, attr);
                if (result == 0) {
                        struct ost_lvb *lvb = &io->u.ci_setattr.sa_attr;
-                       unsigned int cl_valid = 0;
+                       enum cl_attr_valid cl_valid = 0;
 
                        if (ia_avalid & ATTR_SIZE) {
                                attr->cat_size = size;
@@ -701,7 +701,7 @@ void osc_io_setattr_end(const struct lu_env *env,
        struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
        struct cl_attr  *attr = &osc_env_info(env)->oti_attr;
        struct obdo *oa = &oio->oi_oa;
-       unsigned int cl_valid = 0;
+       enum cl_attr_valid cl_valid = 0;
        int result = 0;
 
        if (cbargs->opc_rpc_sent) {
@@ -834,7 +834,7 @@ static void osc_io_data_version_end(const struct lu_env *env,
        struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
        struct cl_attr *attr = &osc_env_info(env)->oti_attr;
        struct obdo *oa = &oio->oi_oa;
-       unsigned int cl_valid = 0;
+       enum cl_attr_valid cl_valid = 0;
 
        ENTRY;
        wait_for_completion(&cbargs->opc_sync);
index ecc9ae7..e599994 100644 (file)
@@ -135,7 +135,8 @@ void osc_lock_lvb_update(const struct lu_env *env,
        struct cl_object *obj = osc2cl(osc);
        struct lov_oinfo *oinfo = osc->oo_oinfo;
        struct cl_attr *attr = &osc_env_info(env)->oti_attr;
-       unsigned valid, setkms = 0;
+       unsigned int setkms = 0;
+       enum cl_attr_valid valid;
 
        ENTRY;
 
index da44810..ee3bb16 100644 (file)
@@ -147,7 +147,7 @@ int osc_attr_get(const struct lu_env *env, struct cl_object *obj,
 EXPORT_SYMBOL(osc_attr_get);
 
 int osc_attr_update(const struct lu_env *env, struct cl_object *obj,
-                   const struct cl_attr *attr, unsigned valid)
+                   const struct cl_attr *attr, enum cl_attr_valid valid)
 {
        struct lov_oinfo *oinfo = cl2osc(obj)->oo_oinfo;
        struct ost_lvb   *lvb   = &oinfo->loi_lvb;
index b5b97f0..1f728c0 100644 (file)
@@ -470,7 +470,7 @@ static int osc_sync_interpret(const struct lu_env *env,
        struct osc_fsync_args *fa = args;
        struct ost_body *body;
        struct cl_attr *attr = &osc_env_info(env)->oti_attr;
-       unsigned long valid = 0;
+       enum cl_attr_valid valid = 0;
        struct cl_object *obj;
 
        ENTRY;
@@ -2627,7 +2627,7 @@ static int brw_interpret(const struct lu_env *env,
        if (rc == 0) {
                struct obdo *oa = aa->aa_oa;
                struct cl_attr *attr = &osc_env_info(env)->oti_attr;
-               unsigned long valid = 0;
+               enum cl_attr_valid valid = 0;
 
                cl_object_attr_lock(obj);
                if (oa->o_valid & OBD_MD_FLBLOCKS) {