From: Andreas Dilger Date: Sat, 9 Jan 2021 07:23:39 +0000 (-0700) Subject: LU-12125 llite: send file mode with rename RPC X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f3e5f92c89e3ff62a48d475f2892158294cc909a;p=fs%2Flustre-release.git LU-12125 llite: send file mode with rename RPC In preparation for parallel rename operations, send renamed file mode to the MDS in order to allow the rename locking to be more efficient. Signed-off-by: Andreas Dilger Change-Id: I4691f30d151a8ff81e443d24109234341b3ebbe5 --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 4d0babd..7311a2f 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -1814,6 +1814,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; ENTRY; @@ -1838,15 +1839,21 @@ 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)); - if (src_dchild->d_inode != NULL) + if (src_dchild->d_inode) op_data->op_fid3 = *ll_inode2fid(src_dchild->d_inode); - if (tgt_dchild->d_inode != NULL) + if (tgt_dchild->d_inode) op_data->op_fid4 = *ll_inode2fid(tgt_dchild->d_inode); err = md_rename(sbi->ll_md_exp, op_data,