Commit 6510c9d8 authored by Ian Kent's avatar Ian Kent Committed by Linus Torvalds

autofs4: cleanup active and expire lookup

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: default avatarIan Kent <raven@themaw.net>
Cc: Sage Weil <sage@newdream.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andreas Dilger <adilger@sun.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Yehuda Saheh <yehuda@newdream.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 90387c9c
...@@ -405,8 +405,11 @@ static const struct dentry_operations autofs4_dentry_operations = { ...@@ -405,8 +405,11 @@ static const struct dentry_operations autofs4_dentry_operations = {
.d_release = autofs4_dentry_release, .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 len = name->len;
unsigned int hash = name->hash; unsigned int hash = name->hash;
const unsigned char *str = name->name; const unsigned char *str = name->name;
...@@ -457,8 +460,11 @@ static struct dentry *autofs4_lookup_active(struct autofs_sb_info *sbi, struct d ...@@ -457,8 +460,11 @@ static struct dentry *autofs4_lookup_active(struct autofs_sb_info *sbi, struct d
return NULL; 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 len = name->len;
unsigned int hash = name->hash; unsigned int hash = name->hash;
const unsigned char *str = name->name; const unsigned char *str = name->name;
...@@ -530,7 +536,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s ...@@ -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", DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode); 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) { if (active) {
dentry = active; dentry = active;
ino = autofs4_dentry_ino(dentry); ino = autofs4_dentry_ino(dentry);
...@@ -567,9 +573,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s ...@@ -567,9 +573,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
if (!oz_mode) { if (!oz_mode) {
mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex);
expiring = autofs4_lookup_expiring(sbi, expiring = autofs4_lookup_expiring(dentry);
dentry->d_parent,
&dentry->d_name);
if (expiring) { if (expiring) {
/* /*
* If we are racing with expire the request might not * If we are racing with expire the request might not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment