aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/autofs4/root.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 961ff377db03..81700f4a19da 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -405,8 +405,11 @@ static const struct dentry_operations autofs4_dentry_operations = {
405 .d_release = autofs4_dentry_release, 405 .d_release = autofs4_dentry_release,
406}; 406};
407 407
408static struct dentry *autofs4_lookup_active(struct autofs_sb_info *sbi, struct dentry *parent, struct qstr *name) 408static struct dentry *autofs4_lookup_active(struct dentry *dentry)
409{ 409{
410 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
411 struct dentry *parent = dentry->d_parent;
412 struct qstr *name = &dentry->d_name;
410 unsigned int len = name->len; 413 unsigned int len = name->len;
411 unsigned int hash = name->hash; 414 unsigned int hash = name->hash;
412 const unsigned char *str = name->name; 415 const unsigned char *str = name->name;
@@ -457,8 +460,11 @@ next:
457 return NULL; 460 return NULL;
458} 461}
459 462
460static struct dentry *autofs4_lookup_expiring(struct autofs_sb_info *sbi, struct dentry *parent, struct qstr *name) 463static struct dentry *autofs4_lookup_expiring(struct dentry *dentry)
461{ 464{
465 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
466 struct dentry *parent = dentry->d_parent;
467 struct qstr *name = &dentry->d_name;
462 unsigned int len = name->len; 468 unsigned int len = name->len;
463 unsigned int hash = name->hash; 469 unsigned int hash = name->hash;
464 const unsigned char *str = name->name; 470 const unsigned char *str = name->name;
@@ -530,7 +536,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
530 DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d", 536 DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
531 current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode); 537 current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode);
532 538
533 active = autofs4_lookup_active(sbi, dentry->d_parent, &dentry->d_name); 539 active = autofs4_lookup_active(dentry);
534 if (active) { 540 if (active) {
535 dentry = active; 541 dentry = active;
536 ino = autofs4_dentry_ino(dentry); 542 ino = autofs4_dentry_ino(dentry);
@@ -567,9 +573,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
567 573
568 if (!oz_mode) { 574 if (!oz_mode) {
569 mutex_unlock(&dir->i_mutex); 575 mutex_unlock(&dir->i_mutex);
570 expiring = autofs4_lookup_expiring(sbi, 576 expiring = autofs4_lookup_expiring(dentry);
571 dentry->d_parent,
572 &dentry->d_name);
573 if (expiring) { 577 if (expiring) {
574 /* 578 /*
575 * If we are racing with expire the request might not 579 * If we are racing with expire the request might not