linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] switch autofs4 to touch_atime()
@ 2005-11-04 22:29 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2005-11-04 22:29 UTC (permalink / raw)
  To: akpm, raven; +Cc: linux-fsdevel

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>

Index: linux-2.6/fs/autofs4/root.c
===================================================================
--- linux-2.6.orig/fs/autofs4/root.c	2005-10-31 12:23:55.000000000 +0100
+++ linux-2.6/fs/autofs4/root.c	2005-10-31 20:03:37.000000000 +0100
@@ -86,7 +86,7 @@
 
 /* Update usage from here to top of tree, so that scan of
    top-level directories will give a useful result */
-static void autofs4_update_usage(struct dentry *dentry)
+static void autofs4_update_usage(struct vfsmount *mnt, struct dentry *dentry)
 {
 	struct dentry *top = dentry->d_sb->s_root;
 
@@ -95,7 +95,7 @@
 		struct autofs_info *ino = autofs4_dentry_ino(dentry);
 
 		if (ino) {
-			update_atime(dentry->d_inode);
+			touch_atime(mnt, dentry);
 			ino->last_used = jiffies;
 		}
 	}
@@ -288,10 +288,10 @@
 	return autofs4_dcache_readdir(file, dirent, filldir);
 }
 
-static int try_to_fill_dentry(struct dentry *dentry, 
-			      struct super_block *sb,
-			      struct autofs_sb_info *sbi, int flags)
+static int try_to_fill_dentry(struct vfsmount *mnt, struct dentry *dentry, int flags)
 {
+	struct super_block *sb = mnt->mnt_sb;
+	struct autofs_sb_info *sbi = autofs4_sbi(sb);
 	struct autofs_info *de_info = autofs4_dentry_ino(dentry);
 	int status = 0;
 
@@ -366,7 +366,7 @@
 	/* We don't update the usages for the autofs daemon itself, this
 	   is necessary for recursive autofs mounts */
 	if (!autofs4_oz_mode(sbi))
-		autofs4_update_usage(dentry);
+		autofs4_update_usage(mnt, dentry);
 
 	spin_lock(&dentry->d_lock);
 	dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
@@ -391,7 +391,7 @@
 	/* Pending dentry */
 	if (autofs4_ispending(dentry)) {
 		if (!oz_mode)
-			status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags);
+			status = try_to_fill_dentry(nd->mnt, dentry, flags);
 		return status;
 	}
 
@@ -408,14 +408,14 @@
 			 dentry, dentry->d_name.len, dentry->d_name.name);
 		spin_unlock(&dcache_lock);
 		if (!oz_mode)
-			status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags);
+			status = try_to_fill_dentry(nd->mnt, dentry, flags);
 		return status;
 	}
 	spin_unlock(&dcache_lock);
 
 	/* Update the usage list */
 	if (!oz_mode)
-		autofs4_update_usage(dentry);
+		autofs4_update_usage(nd->mnt, dentry);
 
 	return 1;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-04 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 22:29 [PATCH 1/2] switch autofs4 to touch_atime() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).