aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 23:52:01 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:30 -0500
commit870f481793b585323fbda3e87c54efc116f46351 (patch)
tree08dce269f14c18ae1b1682d3cb0f149b938d40bb /fs/inode.c
parent3542c6e18f6470bad2bde1e94331e4f488a8d3f1 (diff)
[PATCH] replace inode_update_time with file_update_time
To allow various options to work per-mount instead of per-sb we need a struct vfsmount when updating ctime and mtime. This preparation patch replaces the inode_update_time routine with a file_update_atime routine so we can easily get at the vfsmount. (and the file makes more sense in this context anyway). Also get rid of the unused second argument - we always want to update the ctime when calling this routine. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@ftp.linux.org.uk> Cc: Anton Altaparmakov <aia21@cantab.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/fs/inode.c b/fs/inode.c
index e08767fd57b0..e177769f3b41 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1204,16 +1204,20 @@ void update_atime(struct inode *inode)
1204EXPORT_SYMBOL(update_atime); 1204EXPORT_SYMBOL(update_atime);
1205 1205
1206/** 1206/**
1207 * inode_update_time - update mtime and ctime time 1207 * file_update_time - update mtime and ctime time
1208 * @inode: inode accessed 1208 * @file: file accessed
1209 * @ctime_too: update ctime too
1210 * 1209 *
1211 * Update the mtime time on an inode and mark it for writeback. 1210 * Update the mtime and ctime members of an inode and mark the inode
1212 * When ctime_too is specified update the ctime too. 1211 * for writeback. Note that this function is meant exclusively for
1212 * usage in the file write path of filesystems, and filesystems may
1213 * choose to explicitly ignore update via this function with the
1214 * S_NOCTIME inode flag, e.g. for network filesystem where these
1215 * timestamps are handled by the server.
1213 */ 1216 */
1214 1217
1215void inode_update_time(struct inode *inode, int ctime_too) 1218void file_update_time(struct file *file)
1216{ 1219{
1220 struct inode *inode = file->f_dentry->d_inode;
1217 struct timespec now; 1221 struct timespec now;
1218 int sync_it = 0; 1222 int sync_it = 0;
1219 1223
@@ -1227,16 +1231,15 @@ void inode_update_time(struct inode *inode, int ctime_too)
1227 sync_it = 1; 1231 sync_it = 1;
1228 inode->i_mtime = now; 1232 inode->i_mtime = now;
1229 1233
1230 if (ctime_too) { 1234 if (!timespec_equal(&inode->i_ctime, &now))
1231 if (!timespec_equal(&inode->i_ctime, &now)) 1235 sync_it = 1;
1232 sync_it = 1; 1236 inode->i_ctime = now;
1233 inode->i_ctime = now; 1237
1234 }
1235 if (sync_it) 1238 if (sync_it)
1236 mark_inode_dirty_sync(inode); 1239 mark_inode_dirty_sync(inode);
1237} 1240}
1238 1241
1239EXPORT_SYMBOL(inode_update_time); 1242EXPORT_SYMBOL(file_update_time);
1240 1243
1241int inode_needs_sync(struct inode *inode) 1244int inode_needs_sync(struct inode *inode)
1242{ 1245{