mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
3542c6e18f
commit
870f481793
11 changed files with 44 additions and 27 deletions
27
fs/inode.c
27
fs/inode.c
|
@ -1204,16 +1204,20 @@ void update_atime(struct inode *inode)
|
|||
EXPORT_SYMBOL(update_atime);
|
||||
|
||||
/**
|
||||
* inode_update_time - update mtime and ctime time
|
||||
* @inode: inode accessed
|
||||
* @ctime_too: update ctime too
|
||||
* file_update_time - update mtime and ctime time
|
||||
* @file: file accessed
|
||||
*
|
||||
* Update the mtime time on an inode and mark it for writeback.
|
||||
* When ctime_too is specified update the ctime too.
|
||||
* Update the mtime and ctime members of an inode and mark the inode
|
||||
* for writeback. Note that this function is meant exclusively for
|
||||
* usage in the file write path of filesystems, and filesystems may
|
||||
* choose to explicitly ignore update via this function with the
|
||||
* S_NOCTIME inode flag, e.g. for network filesystem where these
|
||||
* timestamps are handled by the server.
|
||||
*/
|
||||
|
||||
void inode_update_time(struct inode *inode, int ctime_too)
|
||||
void file_update_time(struct file *file)
|
||||
{
|
||||
struct inode *inode = file->f_dentry->d_inode;
|
||||
struct timespec now;
|
||||
int sync_it = 0;
|
||||
|
||||
|
@ -1227,16 +1231,15 @@ void inode_update_time(struct inode *inode, int ctime_too)
|
|||
sync_it = 1;
|
||||
inode->i_mtime = now;
|
||||
|
||||
if (ctime_too) {
|
||||
if (!timespec_equal(&inode->i_ctime, &now))
|
||||
sync_it = 1;
|
||||
inode->i_ctime = now;
|
||||
}
|
||||
if (!timespec_equal(&inode->i_ctime, &now))
|
||||
sync_it = 1;
|
||||
inode->i_ctime = now;
|
||||
|
||||
if (sync_it)
|
||||
mark_inode_dirty_sync(inode);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(inode_update_time);
|
||||
EXPORT_SYMBOL(file_update_time);
|
||||
|
||||
int inode_needs_sync(struct inode *inode)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue