Whamcloud - gitweb
LU-10792 llite: remove unused parameters from md_{get,set}xattr() 92/31592/3
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 8 Mar 2018 19:03:54 +0000 (13:03 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:49:45 +0000 (19:49 +0000)
md_getxattr() and md_setxattr() each have several unused
parameters. Remove them and improve the naming or remaining
parameters.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I578bdd5dab70745ba7f8fbb9f047fa9eb1f6ee9a
Reviewed-on: https://review.whamcloud.com/31592
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd.h
lustre/include/obd_class.h
lustre/llite/file.c
lustre/llite/xattr.c
lustre/llite/xattr26.c
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_request.c

index 1644a1e..e270aa5 100644 (file)
@@ -1076,12 +1076,11 @@ struct md_ops {
                        struct ptlrpc_request **);
 
        int (*m_setxattr)(struct obd_export *, const struct lu_fid *,
-                         u64, const char *, const char *, int, int, int, u32,
-                         struct ptlrpc_request **);
+                         u64, const char *, const void *, size_t, unsigned int,
+                         u32, struct ptlrpc_request **);
 
        int (*m_getxattr)(struct obd_export *, const struct lu_fid *,
-                         u64, const char *, const char *, int, int, int,
-                         struct ptlrpc_request **);
+                         u64, const char *, size_t, struct ptlrpc_request **);
 
        int (*m_intent_getattr_async)(struct obd_export *,
                                      struct md_enqueue_info *);
index e65f9ce..2c52b36 100644 (file)
@@ -1652,10 +1652,10 @@ static inline int md_merge_attr(struct obd_export *exp,
 }
 
 static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
-                             u64 valid, const char *name,
-                             const char *input, int input_size,
-                             int output_size, int flags, __u32 suppgid,
-                             struct ptlrpc_request **request)
+                             u64 obd_md_valid, const char *name,
+                             const void *value, size_t value_size,
+                             unsigned int xattr_flags, u32 suppgid,
+                             struct ptlrpc_request **req)
 {
        int rc;
        ENTRY;
@@ -1664,16 +1664,14 @@ static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
        if (rc)
                RETURN(rc);
        EXP_MD_COUNTER_INCREMENT(exp, setxattr);
-       RETURN(MDP(exp->exp_obd, setxattr)(exp, fid, valid, name, input,
-                                          input_size, output_size, flags,
-                                          suppgid, request));
+       RETURN(MDP(exp->exp_obd, setxattr)(exp, fid, obd_md_valid, name,
+                                          value, value_size, xattr_flags,
+                                          suppgid, req));
 }
 
 static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid,
-                             u64 valid, const char *name,
-                             const char *input, int input_size,
-                             int output_size, int flags,
-                             struct ptlrpc_request **request)
+                             u64 obd_md_valid, const char *name,
+                             size_t buf_size, struct ptlrpc_request **req)
 {
        int rc;
        ENTRY;
@@ -1681,9 +1679,8 @@ static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid,
        if (rc)
                RETURN(rc);
        EXP_MD_COUNTER_INCREMENT(exp, getxattr);
-       RETURN(MDP(exp->exp_obd, getxattr)(exp, fid, valid, name, input,
-                                          input_size, output_size, flags,
-                                          request));
+       RETURN(MDP(exp->exp_obd, getxattr)(exp, fid, obd_md_valid, name,
+                                          buf_size, req));
 }
 
 static inline int md_set_open_replay_data(struct obd_export *exp,
index 62f8f71..dbdbb9e 100644 (file)
@@ -4472,7 +4472,7 @@ int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 
        rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
                         value ? OBD_MD_FLXATTR : OBD_MD_FLXATTRRM,
-                        name, value, value_size, 0, 0, 0, &req);
+                        name, value, value_size, 0, 0, &req);
 
        ptlrpc_req_finished(req);
 out_value:
@@ -4774,8 +4774,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
        rc = ll_get_default_mdsize(sbi, &lmmsize);
        if (rc == 0)
                rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
-                               OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0,
-                               lmmsize, 0, &req);
+                               OBD_MD_FLXATTR, XATTR_NAME_LOV, lmmsize, &req);
        if (rc < 0)
                RETURN(rc);
 
index 5581ee2..96ef059 100644 (file)
@@ -145,7 +145,7 @@ static int ll_xattr_set_common(const struct xattr_handler *handler,
                RETURN(-ENOMEM);
 
        rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, fullname,
-                        pv, size, 0, flags, ll_i2suppgid(inode), &req);
+                        pv, size, flags, ll_i2suppgid(inode), &req);
        kfree(fullname);
        if (rc) {
                if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
@@ -359,8 +359,8 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer,
                }
        } else {
 getxattr_nocache:
-               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
-                                valid, name, NULL, 0, size, 0, &req);
+               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid,
+                                name, size, &req);
                if (rc < 0)
                        GOTO(out_xattr, rc);
 
index 3faa1d8..c6c3396 100644 (file)
@@ -152,7 +152,7 @@ int ll_setxattr_common(struct inode *inode, const char *name,
        }
 
        rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, name, pv,
-                        size, 0, flags, ll_i2suppgid(inode), &req);
+                        size, flags, ll_i2suppgid(inode), &req);
        if (rc) {
                if (rc == -EOPNOTSUPP && xattr_type == XATTR_USER_T) {
                        LCONSOLE_INFO("Disabling user_xattr feature because "
@@ -405,9 +405,8 @@ do_getxattr:
                }
        } else {
 getxattr_nocache:
-               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
-                               valid, name, NULL, 0, size, 0, &req);
-
+               rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid,
+                                name, size, &req);
                if (rc < 0)
                        GOTO(out_xattr, rc);
 
index df6d19e..7895ab4 100644 (file)
@@ -1425,9 +1425,8 @@ static int lmv_get_root(struct obd_export *exp, const char *fileset,
 }
 
 static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
-                       u64 valid, const char *name,
-                       const char *input, int input_size, int output_size,
-                       int flags, struct ptlrpc_request **request)
+                       u64 obd_md_valid, const char *name, size_t buf_size,
+                       struct ptlrpc_request **req)
 {
         struct obd_device      *obd = exp->exp_obd;
         struct lmv_obd         *lmv = &obd->u.lmv;
@@ -1439,17 +1438,16 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
         if (IS_ERR(tgt))
                 RETURN(PTR_ERR(tgt));
 
-       rc = md_getxattr(tgt->ltd_exp, fid, valid, name, input,
-                        input_size, output_size, flags, request);
+       rc = md_getxattr(tgt->ltd_exp, fid, obd_md_valid, name, buf_size, req);
 
        RETURN(rc);
 }
 
 static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
-                       u64 valid, const char *name,
-                       const char *input, int input_size, int output_size,
-                       int flags, __u32 suppgid,
-                       struct ptlrpc_request **request)
+                       u64 obd_md_valid, const char *name,
+                       const void *value, size_t value_size,
+                       unsigned int xattr_flags, u32 suppgid,
+                       struct ptlrpc_request **req)
 {
         struct obd_device      *obd = exp->exp_obd;
         struct lmv_obd         *lmv = &obd->u.lmv;
@@ -1461,9 +1459,8 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
         if (IS_ERR(tgt))
                 RETURN(PTR_ERR(tgt));
 
-       rc = md_setxattr(tgt->ltd_exp, fid, valid, name, input,
-                        input_size, output_size, flags, suppgid,
-                        request);
+       rc = md_setxattr(tgt->ltd_exp, fid, obd_md_valid, name,
+                        value, value_size, xattr_flags, suppgid, req);
 
        RETURN(rc);
 }
index 201421c..20a074b 100644 (file)
@@ -417,26 +417,30 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
 }
 
 static int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
-                       u64 valid, const char *xattr_name,
-                       const char *input, int input_size, int output_size,
-                       int flags, __u32 suppgid,
-                       struct ptlrpc_request **request)
+                       u64 obd_md_valid, const char *name,
+                       const void *value, size_t value_size,
+                       unsigned int xattr_flags, u32 suppgid,
+                       struct ptlrpc_request **req)
 {
+       LASSERT(obd_md_valid == OBD_MD_FLXATTR ||
+               obd_md_valid == OBD_MD_FLXATTRRM);
+
        return mdc_xattr_common(exp, &RQF_MDS_REINT_SETXATTR,
-                               fid, MDS_REINT, valid, xattr_name,
-                               input, input_size, output_size, flags,
-                               suppgid, request);
+                               fid, MDS_REINT, obd_md_valid, name,
+                               value, value_size, 0, xattr_flags, suppgid,
+                               req);
 }
 
 static int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid,
-                       u64 valid, const char *xattr_name,
-                       const char *input, int input_size, int output_size,
-                       int flags, struct ptlrpc_request **request)
+                       u64 obd_md_valid, const char *name, size_t buf_size,
+                       struct ptlrpc_request **req)
 {
-       return mdc_xattr_common(exp, &RQF_MDS_GETXATTR,
-                               fid, MDS_GETXATTR, valid, xattr_name,
-                               input, input_size, output_size, flags,
-                               -1, request);
+       LASSERT(obd_md_valid == OBD_MD_FLXATTR ||
+               obd_md_valid == OBD_MD_FLXATTRLS);
+
+       return mdc_xattr_common(exp, &RQF_MDS_GETXATTR, fid, MDS_GETXATTR,
+                               obd_md_valid, name, NULL, 0, buf_size, 0, -1,
+                               req);
 }
 
 #ifdef CONFIG_FS_POSIX_ACL