Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754116AbcDJNRS (ORCPT ); Sun, 10 Apr 2016 09:17:18 -0400 Received: from smtp1.ccs.ornl.gov ([160.91.199.38]:42640 "EHLO smtp1.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753344AbcDJNOB (ORCPT ); Sun, 10 Apr 2016 09:14:01 -0400 From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin Cc: Linux Kernel Mailing List , Lustre Development List , Andrew Perepechko , James Simmons Subject: [PATCH 06/17] staging: lustre: llite: speedup in unlink/rmdir Date: Sun, 10 Apr 2016 09:13:29 -0400 Message-Id: <1460294020-2111-7-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1460294020-2111-1-git-send-email-jsimmons@infradead.org> References: <1460294020-2111-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2794 Lines: 74 From: Andrew Perepechko Assume dchild argument is fully initialized in ->unlink and ->rmdir callbacks, so additional lookup for ELC is not needed. Signed-off-by: Andrew Perepechko Reviewed-by: Alexander Boyko Reviewed-by: Vitaly Fertman Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3473 Xyratex-bug-id: MRP-1027 Reviewed-on: http://review.whamcloud.com/6648 Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/namei.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 6445bc1..7e4247a 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -845,12 +845,6 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, return rc; } -static inline void ll_get_child_fid(struct dentry *child, struct lu_fid *fid) -{ - if (d_really_is_positive(child)) - *fid = *ll_inode2fid(d_inode(child)); -} - int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir) { struct mdt_body *body; @@ -943,7 +937,9 @@ static int ll_unlink(struct inode *dir, struct dentry *dchild) if (IS_ERR(op_data)) return PTR_ERR(op_data); - ll_get_child_fid(dchild, &op_data->op_fid3); + if (dchild && dchild->d_inode) + op_data->op_fid3 = *ll_inode2fid(dchild->d_inode); + op_data->op_fid2 = op_data->op_fid3; rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_finish_md_op_data(op_data); @@ -993,7 +989,9 @@ static int ll_rmdir(struct inode *dir, struct dentry *dchild) if (IS_ERR(op_data)) return PTR_ERR(op_data); - ll_get_child_fid(dchild, &op_data->op_fid3); + if (dchild && dchild->d_inode) + op_data->op_fid3 = *ll_inode2fid(dchild->d_inode); + op_data->op_fid2 = op_data->op_fid3; rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_finish_md_op_data(op_data); @@ -1074,8 +1072,11 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, if (IS_ERR(op_data)) return PTR_ERR(op_data); - ll_get_child_fid(src_dchild, &op_data->op_fid3); - ll_get_child_fid(tgt_dchild, &op_data->op_fid4); + if (src_dchild && src_dchild->d_inode) + op_data->op_fid3 = *ll_inode2fid(src_dchild->d_inode); + if (tgt_dchild && tgt_dchild->d_inode) + op_data->op_fid4 = *ll_inode2fid(tgt_dchild->d_inode); + err = md_rename(sbi->ll_md_exp, op_data, src_dchild->d_name.name, src_dchild->d_name.len, -- 1.7.1