Skip to contentSkip to conversation

remove update_atime

PATCH In review Christoph Hellwig 3 participants 3 messages Nov 4, 2005 – Nov 5, 2005 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 remove update_atime

all callers use touch_atime now which takes a vfsmount and allows us to implement per-mount noatime.

fs/inode.c +6 -3
Index: linux-2.6/fs/inode.c
===================================================================
@@ -1176,17 +1176,20 @@
 EXPORT_SYMBOL(bmap);
 
 /**
- *	update_atime	-	update the access time
+ *	touch_atime	-	update the access time
+ *	@mnt: mount the inode is accessed on
  *	@inode: inode accessed
  *
  *	Update the accessed time on an inode and mark it for writeback.
  *	This function automatically handles read only file systems and media,
  *	as well as the "noatime" flag and inode specific "noatime" markers.
  */
-void update_atime(struct inode *inode)
+void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
 {
+	struct inode *inode = dentry->d_inode;
 	struct timespec now;
 
+	/* per-mountpoint checks will go here */
 	if (IS_NOATIME(inode))
 		return;
 	if (IS_NODIRATIME(inode) && S_ISDIR(inode->i_mode))
@@ -1201,7 +1204,7 @@
 	}
 }
 
-EXPORT_SYMBOL(update_atime);
+EXPORT_SYMBOL(touch_atime);
 
 /**
  *	file_update_time	-	update mtime and ctime time
include/linux/fs.h +1 -9
Index: linux-2.6/include/linux/fs.h
===================================================================
@@ -230,9 +230,6 @@
 struct vm_area_struct;
 struct vfsmount;
 
-/* Used to be a macro which just called the function, now just a function */
-extern void update_atime (struct inode *);
-
 extern void __init inode_init(unsigned long);
 extern void __init inode_init_early(void);
 extern void __init mnt_init(unsigned long);
@@ -1075,12 +1072,7 @@
 	__mark_inode_dirty(inode, I_DIRTY_SYNC);
 }
 
-static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
-{
-	/* per-mountpoint checks will go here */
-	update_atime(dentry->d_inode);
-}
-
+extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
 static inline void file_accessed(struct file *file)
 {
 	if (!(file->f_flags & O_NOATIME))
#1 lore raw

fs/inode.c line 1207

Quoted 5 lines · Christoph Hellwig

all callers use touch_atime now which takes a vfsmount and allows us to implement per-mount noatime.

fs/inode.c +1 -1
-EXPORT_SYMBOL(update_atime);
+EXPORT_SYMBOL(touch_atime);

I would prefer to deprecate update_atime(), instead of removing it entirely, because it is an exported symbol.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

#2 lore raw
Quoted 9 lines · Andreas Dilger

fs/inode.c line 1207

Quoted 5 lines · Christoph Hellwig

all callers use touch_atime now which takes a vfsmount and allows us to implement per-mount noatime.

fs/inode.c +1 -1
-EXPORT_SYMBOL(update_atime);
+EXPORT_SYMBOL(touch_atime);

I would prefer to deprecate update_atime(), instead of removing it entirely, because it is an exported symbol.

No. I need to fix some nast corner cases in XFS, hopefully done this weekend and after that we can commit pre-mountpoint noatime. Any filesystem still using update_atime will silently break with this change otherwise.