Commit a694be44 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging: lustre: llite: remove unused parameters from md_{get, set}xattr()

md_getxattr() and md_setxattr() each have several unused
parameters. Remove them and improve the naming or remaining
parameters.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10792
Reviewed-on: https://review.whamcloud.com/Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bf3d1262
...@@ -940,12 +940,11 @@ struct md_ops { ...@@ -940,12 +940,11 @@ struct md_ops {
struct ptlrpc_request **); struct ptlrpc_request **);
int (*setxattr)(struct obd_export *, const struct lu_fid *, int (*setxattr)(struct obd_export *, const struct lu_fid *,
u64, const char *, const char *, int, int, int, __u32, u64, const char *, const void *, size_t, unsigned int,
struct ptlrpc_request **); u32, struct ptlrpc_request **);
int (*getxattr)(struct obd_export *, const struct lu_fid *, int (*getxattr)(struct obd_export *, const struct lu_fid *,
u64, const char *, const char *, int, int, int, u64, const char *, size_t, struct ptlrpc_request **);
struct ptlrpc_request **);
int (*init_ea_size)(struct obd_export *, u32, u32); int (*init_ea_size)(struct obd_export *, u32, u32);
......
...@@ -1385,29 +1385,26 @@ static inline int md_merge_attr(struct obd_export *exp, ...@@ -1385,29 +1385,26 @@ static inline int md_merge_attr(struct obd_export *exp,
} }
static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid, static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name, u64 obd_md_valid, const char *name,
const char *input, int input_size, const char *value, size_t value_size,
int output_size, int flags, __u32 suppgid, unsigned int xattr_flags, u32 suppgid,
struct ptlrpc_request **request) struct ptlrpc_request **request)
{ {
EXP_CHECK_MD_OP(exp, setxattr); EXP_CHECK_MD_OP(exp, setxattr);
EXP_MD_COUNTER_INCREMENT(exp, setxattr); EXP_MD_COUNTER_INCREMENT(exp, setxattr);
return MDP(exp->exp_obd, setxattr)(exp, fid, valid, name, input, return MDP(exp->exp_obd, setxattr)(exp, fid, obd_md_valid, name,
input_size, output_size, flags, value, value_size, xattr_flags,
suppgid, request); suppgid, request);
} }
static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid, static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name, u64 obd_md_valid, const char *name,
const char *input, int input_size, size_t buf_size, struct ptlrpc_request **req)
int output_size, int flags,
struct ptlrpc_request **request)
{ {
EXP_CHECK_MD_OP(exp, getxattr); EXP_CHECK_MD_OP(exp, getxattr);
EXP_MD_COUNTER_INCREMENT(exp, getxattr); EXP_MD_COUNTER_INCREMENT(exp, getxattr);
return MDP(exp->exp_obd, getxattr)(exp, fid, valid, name, input, return MDP(exp->exp_obd, getxattr)(exp, fid, obd_md_valid, name,
input_size, output_size, flags, buf_size, req);
request);
} }
static inline int md_set_open_replay_data(struct obd_export *exp, static inline int md_set_open_replay_data(struct obd_export *exp,
......
...@@ -94,7 +94,7 @@ int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type) ...@@ -94,7 +94,7 @@ int ll_set_acl(struct inode *inode, struct posix_acl *acl, int type)
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
value ? OBD_MD_FLXATTR : OBD_MD_FLXATTRRM, 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); ptlrpc_req_finished(req);
out_value: out_value:
......
...@@ -3323,8 +3323,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock) ...@@ -3323,8 +3323,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
rc = ll_get_default_mdsize(sbi, &lmmsize); rc = ll_get_default_mdsize(sbi, &lmmsize);
if (rc == 0) if (rc == 0)
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode),
OBD_MD_FLXATTR, XATTR_NAME_LOV, NULL, 0, OBD_MD_FLXATTR, XATTR_NAME_LOV, lmmsize, &req);
lmmsize, 0, &req);
if (rc < 0) if (rc < 0)
return rc; return rc;
......
...@@ -145,7 +145,7 @@ static int ll_xattr_set_common(const struct xattr_handler *handler, ...@@ -145,7 +145,7 @@ static int ll_xattr_set_common(const struct xattr_handler *handler,
return -ENOMEM; return -ENOMEM;
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, fullname, 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); kfree(fullname);
if (rc) { if (rc) {
if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) { if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
...@@ -344,8 +344,8 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer, ...@@ -344,8 +344,8 @@ int ll_xattr_list(struct inode *inode, const char *name, int type, void *buffer,
} }
} else { } else {
getxattr_nocache: getxattr_nocache:
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid,
valid, name, NULL, 0, size, 0, &req); name, size, &req);
if (rc < 0) if (rc < 0)
goto out_xattr; goto out_xattr;
......
...@@ -1400,9 +1400,8 @@ static int lmv_getstatus(struct obd_export *exp, ...@@ -1400,9 +1400,8 @@ static int lmv_getstatus(struct obd_export *exp,
} }
static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid, static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name, u64 obd_md_valid, const char *name, size_t buf_size,
const char *input, int input_size, int output_size, struct ptlrpc_request **req)
int flags, struct ptlrpc_request **request)
{ {
struct obd_device *obd = exp->exp_obd; struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv; struct lmv_obd *lmv = &obd->u.lmv;
...@@ -1412,15 +1411,15 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid, ...@@ -1412,15 +1411,15 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
if (IS_ERR(tgt)) if (IS_ERR(tgt))
return PTR_ERR(tgt); return PTR_ERR(tgt);
return md_getxattr(tgt->ltd_exp, fid, valid, name, input, return md_getxattr(tgt->ltd_exp, fid, obd_md_valid, name, buf_size,
input_size, output_size, flags, request); req);
} }
static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid, static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *name, u64 obd_md_valid, const char *name,
const char *input, int input_size, int output_size, const void *value, size_t value_size,
int flags, __u32 suppgid, unsigned int xattr_flags, u32 suppgid,
struct ptlrpc_request **request) struct ptlrpc_request **req)
{ {
struct obd_device *obd = exp->exp_obd; struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv; struct lmv_obd *lmv = &obd->u.lmv;
...@@ -1430,9 +1429,8 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid, ...@@ -1430,9 +1429,8 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
if (IS_ERR(tgt)) if (IS_ERR(tgt))
return PTR_ERR(tgt); return PTR_ERR(tgt);
return md_setxattr(tgt->ltd_exp, fid, valid, name, input, return md_setxattr(tgt->ltd_exp, fid, obd_md_valid, name,
input_size, output_size, flags, suppgid, value, value_size, xattr_flags, suppgid, req);
request);
} }
static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data, static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data,
......
...@@ -350,26 +350,30 @@ static int mdc_xattr_common(struct obd_export *exp, ...@@ -350,26 +350,30 @@ static int mdc_xattr_common(struct obd_export *exp,
} }
static int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid, static int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *xattr_name, u64 obd_md_valid, const char *name,
const char *input, int input_size, int output_size, const void *value, size_t value_size,
int flags, __u32 suppgid, unsigned int xattr_flags, u32 suppgid,
struct ptlrpc_request **request) 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, return mdc_xattr_common(exp, &RQF_MDS_REINT_SETXATTR,
fid, MDS_REINT, valid, xattr_name, fid, MDS_REINT, obd_md_valid, name,
input, input_size, output_size, flags, value, value_size, 0, xattr_flags, suppgid,
suppgid, request); req);
} }
static int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid, static int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 valid, const char *xattr_name, u64 obd_md_valid, const char *name, size_t buf_size,
const char *input, int input_size, int output_size, struct ptlrpc_request **req)
int flags, struct ptlrpc_request **request) {
{ LASSERT(obd_md_valid == OBD_MD_FLXATTR ||
return mdc_xattr_common(exp, &RQF_MDS_GETXATTR, obd_md_valid == OBD_MD_FLXATTRLS);
fid, MDS_GETXATTR, valid, xattr_name,
input, input_size, output_size, flags, return mdc_xattr_common(exp, &RQF_MDS_GETXATTR, fid, MDS_GETXATTR,
-1, request); obd_md_valid, name, NULL, 0, buf_size, 0, -1,
req);
} }
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment