diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/autofs4/autofs_i.h | 8 | ||||
-rw-r--r-- | fs/autofs4/root.c | 9 |
2 files changed, 4 insertions, 13 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index f54c5b21f876..eea25934da62 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -41,14 +41,6 @@ | |||
41 | 41 | ||
42 | #define AUTOFS_SUPER_MAGIC 0x0187 | 42 | #define AUTOFS_SUPER_MAGIC 0x0187 |
43 | 43 | ||
44 | /* | ||
45 | * If the daemon returns a negative response (AUTOFS_IOC_FAIL) then the | ||
46 | * kernel will keep the negative response cached for up to the time given | ||
47 | * here, although the time can be shorter if the kernel throws the dcache | ||
48 | * entry away. This probably should be settable from user space. | ||
49 | */ | ||
50 | #define AUTOFS_NEGATIVE_TIMEOUT (60*HZ) /* 1 minute */ | ||
51 | |||
52 | /* Unified info structure. This is pointed to by both the dentry and | 44 | /* Unified info structure. This is pointed to by both the dentry and |
53 | inode structures. Each file in the filesystem has an instance of this | 45 | inode structures. Each file in the filesystem has an instance of this |
54 | structure. It holds a reference to the dentry, so dentries are never | 46 | structure. It holds a reference to the dentry, so dentries are never |
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index af9a4c6bbadf..c7ff35774344 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -294,14 +294,13 @@ static int try_to_fill_dentry(struct vfsmount *mnt, struct dentry *dentry, int f | |||
294 | 294 | ||
295 | /* Turn this into a real negative dentry? */ | 295 | /* Turn this into a real negative dentry? */ |
296 | if (status == -ENOENT) { | 296 | if (status == -ENOENT) { |
297 | dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT; | ||
298 | spin_lock(&dentry->d_lock); | 297 | spin_lock(&dentry->d_lock); |
299 | dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; | 298 | dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; |
300 | spin_unlock(&dentry->d_lock); | 299 | spin_unlock(&dentry->d_lock); |
301 | return 1; | 300 | return 0; |
302 | } else if (status) { | 301 | } else if (status) { |
303 | /* Return a negative dentry, but leave it "pending" */ | 302 | /* Return a negative dentry, but leave it "pending" */ |
304 | return 1; | 303 | return 0; |
305 | } | 304 | } |
306 | /* Trigger mount for path component or follow link */ | 305 | /* Trigger mount for path component or follow link */ |
307 | } else if (flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY) || | 306 | } else if (flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY) || |
@@ -360,13 +359,13 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
360 | 359 | ||
361 | /* Negative dentry.. invalidate if "old" */ | 360 | /* Negative dentry.. invalidate if "old" */ |
362 | if (dentry->d_inode == NULL) | 361 | if (dentry->d_inode == NULL) |
363 | return (dentry->d_time - jiffies <= AUTOFS_NEGATIVE_TIMEOUT); | 362 | return 0; |
364 | 363 | ||
365 | /* Check for a non-mountpoint directory with no contents */ | 364 | /* Check for a non-mountpoint directory with no contents */ |
366 | spin_lock(&dcache_lock); | 365 | spin_lock(&dcache_lock); |
367 | if (S_ISDIR(dentry->d_inode->i_mode) && | 366 | if (S_ISDIR(dentry->d_inode->i_mode) && |
368 | !d_mountpoint(dentry) && | 367 | !d_mountpoint(dentry) && |
369 | list_empty(&dentry->d_subdirs)) { | 368 | simple_empty_nolock(dentry)) { |
370 | DPRINTK("dentry=%p %.*s, emptydir", | 369 | DPRINTK("dentry=%p %.*s, emptydir", |
371 | dentry, dentry->d_name.len, dentry->d_name.name); | 370 | dentry, dentry->d_name.len, dentry->d_name.name); |
372 | spin_unlock(&dcache_lock); | 371 | spin_unlock(&dcache_lock); |