Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbZIXIbX (ORCPT ); Thu, 24 Sep 2009 04:31:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752366AbZIXIbV (ORCPT ); Thu, 24 Sep 2009 04:31:21 -0400 Received: from outbound.icp-qv1-irony-out5.iinet.net.au ([203.59.1.108]:8813 "EHLO outbound.icp-qv1-irony-out5.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbZIXIbU (ORCPT ); Thu, 24 Sep 2009 04:31:20 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIPJukrLO0En/2dsb2JhbADWMIQbBYFYZQ X-IronPort-AV: E=Sophos;i="4.44,444,1249228800"; d="scan'208";a="39449205" From: Ian Kent Subject: [RFC PATCH 07/11] autofs4 - cleanup active and expire lookup To: Sage Weil , linux-fsdevel , Kernel Mailing List Cc: Al Viro , Christoph Hellwig , Andreas Dilger , Yehuda Saheh , Jim Garlick Date: Thu, 24 Sep 2009 16:22:05 +0800 Message-ID: <20090924082205.22151.10759.stgit@zeus.themaw.net> In-Reply-To: <20090924082036.22151.85151.stgit@zeus.themaw.net> References: <20090924082036.22151.85151.stgit@zeus.themaw.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2616 Lines: 67 The lookup functions for active and expiring dentrys use parameters that can be easily obtained on entry so we change the call to to take just the dentry. This makes the subsequent change, to send all lookups to ->lookup(), a bit cleaner. Signed-off-by: Ian Kent --- fs/autofs4/root.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 961ff37..81700f4 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -405,8 +405,11 @@ static const struct dentry_operations autofs4_dentry_operations = { .d_release = autofs4_dentry_release, }; -static struct dentry *autofs4_lookup_active(struct autofs_sb_info *sbi, struct dentry *parent, struct qstr *name) +static struct dentry *autofs4_lookup_active(struct dentry *dentry) { + struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); + struct dentry *parent = dentry->d_parent; + struct qstr *name = &dentry->d_name; unsigned int len = name->len; unsigned int hash = name->hash; const unsigned char *str = name->name; @@ -457,8 +460,11 @@ next: return NULL; } -static struct dentry *autofs4_lookup_expiring(struct autofs_sb_info *sbi, struct dentry *parent, struct qstr *name) +static struct dentry *autofs4_lookup_expiring(struct dentry *dentry) { + struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); + struct dentry *parent = dentry->d_parent; + struct qstr *name = &dentry->d_name; unsigned int len = name->len; unsigned int hash = name->hash; const unsigned char *str = name->name; @@ -530,7 +536,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d", current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode); - active = autofs4_lookup_active(sbi, dentry->d_parent, &dentry->d_name); + active = autofs4_lookup_active(dentry); if (active) { dentry = active; ino = autofs4_dentry_ino(dentry); @@ -567,9 +573,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s if (!oz_mode) { mutex_unlock(&dir->i_mutex); - expiring = autofs4_lookup_expiring(sbi, - dentry->d_parent, - &dentry->d_name); + expiring = autofs4_lookup_expiring(dentry); if (expiring) { /* * If we are racing with expire the request might not -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/