[lustre-devel] [PATCH 6/7] lustre: llite: extend inode flags into GET/SETXATTR ioctl
James Simmons
jsimmons at infradead.org
Sun Oct 14 12:00:45 PDT 2018
From: Wang Shilong <wshilong at ddn.com>
This is very useful for projet quota tools to save RPC call
to change project inherit attribute together with project ID.
Signed-off-by: Wang Shilong <wshilong at ddn.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-10030
Reviewed-on: https://review.whamcloud.com/30072
WC-bug-id: https://jira.whamcloud.com/browse/LU-11165
Reviewed-on: https://review.whamcloud.com/32860
Reviewed-by: Yingjin Qian <qian at ddn.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: John L. Hammond <jhammond at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
drivers/staging/lustre/lustre/llite/file.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 72101bd..f69eefc 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2178,6 +2178,8 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
struct ptlrpc_request *req = NULL;
struct md_op_data *op_data;
struct fsxattr fsxattr;
+ struct cl_object *obj;
+ struct iattr *attr;
int rc = 0;
int flags;
@@ -2206,8 +2208,23 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
rc = md_setattr(ll_i2sbi(inode)->ll_md_exp, op_data, NULL,
0, &req);
ptlrpc_req_finished(req);
+ if (rc)
+ goto out_fsxattr;
+
ll_update_inode_flags(inode, op_data->op_attr_flags);
+ obj = ll_i2info(inode)->lli_clob;
+ if (!obj)
+ goto out_fsxattr;
+
+ attr = kzalloc(sizeof(*attr), GFP_KERNEL);
+ if (!attr) {
+ rc = -ENOMEM;
+ goto out_fsxattr;
+ }
+ rc = cl_setattr_ost(obj, attr, OP_XVALID_FLAGS,
+ fsxattr.fsx_xflags);
+ kfree(attr);
out_fsxattr:
ll_finish_md_op_data(op_data);
return rc;
--
1.8.3.1
More information about the lustre-devel
mailing list