From: Christoph Hellwig <hch@lst.de>
To: akpm@osdl.org
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH] replace inode_update_time with file_update_time
Date: Sat, 29 Oct 2005 18:52:09 +0200 [thread overview]
Message-ID: <20051029165209.GA26446@lst.de> (raw)
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>
Index: linux-2.6/fs/inode.c
===================================================================
--- linux-2.6.orig/fs/inode.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/fs/inode.c 2005-10-29 04:14:47.000000000 +0200
@@ -1203,16 +1203,16 @@
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.
*/
-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;
@@ -1226,16 +1226,15 @@
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)
{
Index: linux-2.6/fs/ncpfs/file.c
===================================================================
--- linux-2.6.orig/fs/ncpfs/file.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/fs/ncpfs/file.c 2005-10-29 04:14:47.000000000 +0200
@@ -262,7 +262,7 @@
}
vfree(bouncebuffer);
- inode_update_time(inode, 1);
+ file_update_time(file);
*ppos = pos;
Index: linux-2.6/fs/pipe.c
===================================================================
--- linux-2.6.orig/fs/pipe.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/fs/pipe.c 2005-10-29 04:14:47.000000000 +0200
@@ -347,7 +347,7 @@
kill_fasync(PIPE_FASYNC_READERS(*inode), SIGIO, POLL_IN);
}
if (ret > 0)
- inode_update_time(inode, 1); /* mtime and ctime */
+ file_update_time(filp);
return ret;
}
Index: linux-2.6/fs/reiserfs/file.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/file.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/fs/reiserfs/file.c 2005-10-29 04:14:47.000000000 +0200
@@ -1360,7 +1360,7 @@
if (res)
goto out;
- inode_update_time(inode, 1); /* Both mtime and ctime */
+ file_update_time(file);
// Ok, we are done with all the checks.
Index: linux-2.6/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_lrw.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/fs/xfs/linux-2.6/xfs_lrw.c 2005-10-29 04:14:47.000000000 +0200
@@ -740,7 +740,7 @@
*/
if (!(ioflags & IO_INVIS)) {
xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- inode_update_time(inode, 1);
+ file_update_time(file);
}
/*
Index: linux-2.6/include/linux/fs.h
===================================================================
--- linux-2.6.orig/include/linux/fs.h 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/include/linux/fs.h 2005-10-29 04:15:01.000000000 +0200
@@ -1651,7 +1651,7 @@
extern int inode_change_ok(struct inode *, struct iattr *);
extern int __must_check inode_setattr(struct inode *, struct iattr *);
-extern void inode_update_time(struct inode *inode, int ctime_too);
+extern void file_update_time(struct file *file);
static inline ino_t parent_ino(struct dentry *dentry)
{
Index: linux-2.6/mm/filemap.c
===================================================================
--- linux-2.6.orig/mm/filemap.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/mm/filemap.c 2005-10-29 04:14:47.000000000 +0200
@@ -2066,7 +2066,7 @@
if (err)
goto out;
- inode_update_time(inode, 1);
+ file_update_time(file);
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
if (unlikely(file->f_flags & O_DIRECT)) {
Index: linux-2.6/mm/filemap_xip.c
===================================================================
--- linux-2.6.orig/mm/filemap_xip.c 2005-10-29 04:14:44.000000000 +0200
+++ linux-2.6/mm/filemap_xip.c 2005-10-29 04:14:47.000000000 +0200
@@ -381,7 +381,7 @@
if (ret)
goto out_backing;
- inode_update_time(inode, 1);
+ file_update_time(filp);
ret = __xip_file_write (filp, buf, count, pos, ppos);
next reply other threads:[~2005-10-29 16:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-29 16:52 Christoph Hellwig [this message]
2005-10-31 22:54 ` [PATCH] replace inode_update_time with file_update_time Andrew Morton
2005-10-31 22:57 ` Christoph Hellwig
2005-11-07 21:40 ` Anton Altaparmakov
2005-11-07 21:52 ` Shaya Potter
2005-11-07 22:02 ` Anton Altaparmakov
2005-11-07 22:10 ` Shaya Potter
2005-11-07 22:13 ` Anton Altaparmakov
2005-11-08 4:34 ` Christoph Hellwig
2005-11-08 9:52 ` Anton Altaparmakov
2005-11-08 4:30 ` Christoph Hellwig
2005-11-08 9:50 ` Anton Altaparmakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051029165209.GA26446@lst.de \
--to=hch@lst.de \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).