aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 23:52:02 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:31 -0500
commit9cf6f4b3a3d24d8a41515b509b8fb6448f9201e9 (patch)
tree858c953f9880e6dd67ffb71ab63fa429996f2a48 /fs/autofs4
parent870f481793b585323fbda3e87c54efc116f46351 (diff)
[PATCH] switch autofs4 to touch_atime()
After my lookup_hash patch ->d_revalidate always gets a valid struct nameidata passed (unless you use lookup_one_len which autofs4 doesn't), so we can switch it from update_atime to touch_atime. This is a bit of an academic excercise because autofs has a 1:1 vfsmount superblock relation, but I want to get rid of update_atime so filesystems authors can't easily screw up per-mountpoint noatime support. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/autofs4')
-rw-r--r--fs/autofs4/root.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 541b19e6fec..14aa70282e8 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -86,7 +86,7 @@ static int autofs4_root_readdir(struct file *file, void *dirent,
86 86
87/* Update usage from here to top of tree, so that scan of 87/* Update usage from here to top of tree, so that scan of
88 top-level directories will give a useful result */ 88 top-level directories will give a useful result */
89static void autofs4_update_usage(struct dentry *dentry) 89static void autofs4_update_usage(struct vfsmount *mnt, struct dentry *dentry)
90{ 90{
91 struct dentry *top = dentry->d_sb->s_root; 91 struct dentry *top = dentry->d_sb->s_root;
92 92
@@ -95,7 +95,7 @@ static void autofs4_update_usage(struct dentry *dentry)
95 struct autofs_info *ino = autofs4_dentry_ino(dentry); 95 struct autofs_info *ino = autofs4_dentry_ino(dentry);
96 96
97 if (ino) { 97 if (ino) {
98 update_atime(dentry->d_inode); 98 touch_atime(mnt, dentry);
99 ino->last_used = jiffies; 99 ino->last_used = jiffies;
100 } 100 }
101 } 101 }
@@ -289,10 +289,10 @@ out:
289 return autofs4_dcache_readdir(file, dirent, filldir); 289 return autofs4_dcache_readdir(file, dirent, filldir);
290} 290}
291 291
292static int try_to_fill_dentry(struct dentry *dentry, 292static int try_to_fill_dentry(struct vfsmount *mnt, struct dentry *dentry, int flags)
293 struct super_block *sb,
294 struct autofs_sb_info *sbi, int flags)
295{ 293{
294 struct super_block *sb = mnt->mnt_sb;
295 struct autofs_sb_info *sbi = autofs4_sbi(sb);
296 struct autofs_info *de_info = autofs4_dentry_ino(dentry); 296 struct autofs_info *de_info = autofs4_dentry_ino(dentry);
297 int status = 0; 297 int status = 0;
298 298
@@ -367,7 +367,7 @@ static int try_to_fill_dentry(struct dentry *dentry,
367 /* We don't update the usages for the autofs daemon itself, this 367 /* We don't update the usages for the autofs daemon itself, this
368 is necessary for recursive autofs mounts */ 368 is necessary for recursive autofs mounts */
369 if (!autofs4_oz_mode(sbi)) 369 if (!autofs4_oz_mode(sbi))
370 autofs4_update_usage(dentry); 370 autofs4_update_usage(mnt, dentry);
371 371
372 spin_lock(&dentry->d_lock); 372 spin_lock(&dentry->d_lock);
373 dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; 373 dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
@@ -392,7 +392,7 @@ static int autofs4_revalidate(struct dentry * dentry, struct nameidata *nd)
392 /* Pending dentry */ 392 /* Pending dentry */
393 if (autofs4_ispending(dentry)) { 393 if (autofs4_ispending(dentry)) {
394 if (!oz_mode) 394 if (!oz_mode)
395 status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags); 395 status = try_to_fill_dentry(nd->mnt, dentry, flags);
396 return status; 396 return status;
397 } 397 }
398 398
@@ -409,14 +409,14 @@ static int autofs4_revalidate(struct dentry * dentry, struct nameidata *nd)
409 dentry, dentry->d_name.len, dentry->d_name.name); 409 dentry, dentry->d_name.len, dentry->d_name.name);
410 spin_unlock(&dcache_lock); 410 spin_unlock(&dcache_lock);
411 if (!oz_mode) 411 if (!oz_mode)
412 status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags); 412 status = try_to_fill_dentry(nd->mnt, dentry, flags);
413 return status; 413 return status;
414 } 414 }
415 spin_unlock(&dcache_lock); 415 spin_unlock(&dcache_lock);
416 416
417 /* Update the usage list */ 417 /* Update the usage list */
418 if (!oz_mode) 418 if (!oz_mode)
419 autofs4_update_usage(dentry); 419 autofs4_update_usage(nd->mnt, dentry);
420 420
421 return 1; 421 return 1;
422} 422}