mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Andrew Perepechko <andrew_perepechko@xyratex.com>,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH 06/17] staging: lustre: llite: speedup in unlink/rmdir
Date: Sun, 10 Apr 2016 09:13:29 -0400	[thread overview]
Message-ID: <1460294020-2111-7-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1460294020-2111-1-git-send-email-jsimmons@infradead.org>

From: Andrew Perepechko <andrew_perepechko@xyratex.com>

Assume dchild argument is fully initialized in ->unlink and
->rmdir callbacks, so additional lookup for ELC is not needed.

Signed-off-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Alexander Boyko <Alexander_Boyko@xyratex.com>
Reviewed-by: Vitaly Fertman <Vitaly_Fertman@xyratex.com>
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 <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 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

  parent reply	other threads:[~2016-04-10 13:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 13:13 [PATCH 00/17] staging : lustre : rest of missing patches from 2.5.0 release James Simmons
2016-04-10 13:13 ` [PATCH 01/17] staging: lustre: osc: fix race issues thanks to oap_lock James Simmons
2016-04-12  4:05   ` Greg Kroah-Hartman
2016-04-10 13:13 ` [PATCH 02/17] staging: lustre: clio: incorrect assertions in 'enable-invariants' James Simmons
2016-04-10 13:13 ` [PATCH 03/17] staging: lustre: ldlm: Fix a race during FLock handling James Simmons
2016-04-10 13:13 ` [PATCH 04/17] staging: lustre: ldlm: refine LU-2665 patch for POSIX compliance James Simmons
2016-04-10 13:13 ` [PATCH 05/17] staging: lustre: llite: variable rename in namei.c James Simmons
2016-04-10 13:13 ` James Simmons [this message]
2016-04-10 13:13 ` [PATCH 07/17] staging: lustre: llite: error setting max_cache_mb at mount time James Simmons
2016-04-10 13:13 ` [PATCH 08/17] staging: lustre: obd: MDT mount fails on MDS w/o MGS on it James Simmons
2016-04-10 13:13 ` [PATCH 09/17] staging: lustre: ptlrpc: return a meaningful status from ptlrpcd_init() James Simmons
2016-04-10 13:13 ` [PATCH 10/17] staging: lustre: llite: Truncate to restore file James Simmons
2016-04-10 13:13 ` [PATCH 11/17] staging: lustre: osc: osc_extent_wait() shouldn't be interruptible James Simmons
2016-04-10 13:13 ` [PATCH 12/17] staging: lustre: lprocfs: implement log2 using bitops James Simmons
2016-04-10 13:13 ` [PATCH 13/17] staging: lustre: lloop: Fix build failure on ppc64 James Simmons
2016-04-10 13:22   ` Jeff Mahoney
2016-04-10 14:04     ` James Simmons
2016-04-10 15:35       ` Greg Kroah-Hartman
2016-04-10 15:52         ` James Simmons
2016-04-10 21:13       ` Jeff Mahoney
2016-04-10 13:13 ` [PATCH 14/17] staging: lustre: lov: return minimal FIEMAP for released files James Simmons
2016-04-10 13:13 ` [PATCH 15/17] staging: lustre: lov: Don't wait for active target with OBD_STATFS_NODELAY James Simmons
2016-04-10 13:13 ` [PATCH 16/17] staging: lustre: hsm: permission checks for HSM ioctl operations James Simmons
2016-04-10 13:13 ` [PATCH 17/17] staging: lustre: hsm: don't use real suppgid James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460294020-2111-7-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=andrew_perepechko@xyratex.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®