[lustre-devel] [PATCH 1/9] lustre: llite: send file mode with rename RPC

James Simmons jsimmons at infradead.org
Mon Feb 8 16:54:19 PST 2021


From: Andreas Dilger <adilger at whamcloud.com>

In preparation for parallel rename operations, send renamed file mode
to the MDS in order to allow the rename locking to be more efficient.

WC-bug-id: https://jira.whamcloud.com/browse/LU-12125
Lustre-commit: 47576dc68cd9006 ("LU-12125 llite: send file mode with rename RPC")
Signed-off-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41184
Reviewed-by: Lai Siyao <lai.siyao at whamcloud.com>
Reviewed-by: Yingjin Qian <qian at ddn.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/namei.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/llite/namei.c b/fs/lustre/llite/namei.c
index b24f097..1095fa9 100644
--- a/fs/lustre/llite/namei.c
+++ b/fs/lustre/llite/namei.c
@@ -1745,6 +1745,7 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild,
 	struct ll_sb_info *sbi = ll_i2sbi(src);
 	struct md_op_data *op_data;
 	ktime_t kstart = ktime_get();
+	umode_t mode = 0;
 	int err;
 
 	if (flags)
@@ -1762,7 +1763,13 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild,
 	if (err)
 		return err;
 
-	op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
+	if (src_dchild->d_inode)
+		mode = src_dchild->d_inode->i_mode;
+
+	if (tgt_dchild->d_inode)
+		mode = tgt_dchild->d_inode->i_mode;
+
+	op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, mode,
 				     LUSTRE_OPC_ANY, NULL);
 	if (IS_ERR(op_data))
 		return PTR_ERR(op_data);
-- 
1.8.3.1



More information about the lustre-devel mailing list