From: Christoph Hellwig <hch@lst.de>
To: akpm@osdl.org, Roman Zippel <zippel@linux-m68k.org>
Cc: linux-fsdevel@vger.kernel.org, mikulas@artax.karlin.mff.cuni.cz
Subject: [PATCH] remove superflous ctime/mtime updates in affs
Date: Tue, 1 Nov 2005 02:07:51 +0100 [thread overview]
Message-ID: <20051101010751.GA22040@lst.de> (raw)
In-Reply-To: <Pine.LNX.4.61.0511010200490.1386@scrub.home>
On Tue, Nov 01, 2005 at 02:03:29AM +0100, Roman Zippel wrote:
> > Both AFFS and HPFS update the ctime and mtime in the write path, after
> > generic_file_write returned and mark the inode dirty. Anyone's got an
> > idea why these two filesystems aren't happy with the ctime/mtime updates
> > vi generic_file_write before we copied the data into the pagecache?
>
> For affs I don't really know, my best guess is it has been there forever
> and there never was a reason to remove it.
Ok, what about the following patch?
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/affs/file.c
===================================================================
--- linux-2.6.orig/fs/affs/file.c 2005-10-31 15:44:42.000000000 +0100
+++ linux-2.6/fs/affs/file.c 2005-10-31 17:25:26.000000000 +0100
@@ -22,14 +22,13 @@
static struct buffer_head *affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext);
static inline struct buffer_head *affs_get_extblock(struct inode *inode, u32 ext);
static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext);
-static ssize_t affs_file_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos);
static int affs_file_open(struct inode *inode, struct file *filp);
static int affs_file_release(struct inode *inode, struct file *filp);
struct file_operations affs_file_operations = {
.llseek = generic_file_llseek,
.read = generic_file_read,
- .write = affs_file_write,
+ .write = generic_file_write,
.mmap = generic_file_mmap,
.open = affs_file_open,
.release = affs_file_release,
@@ -473,21 +472,6 @@
return ERR_PTR(err);
}
-static ssize_t
-affs_file_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- ssize_t retval;
-
- retval = generic_file_write (file, buf, count, ppos);
- if (retval >0) {
- struct inode *inode = file->f_dentry->d_inode;
- inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
- mark_inode_dirty(inode);
- }
- return retval;
-}
-
static int
affs_do_readpage_ofs(struct file *file, struct page *page, unsigned from, unsigned to)
{
next prev parent reply other threads:[~2005-11-01 1:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-31 23:53 ctime/mtime update in affs and hpfs write path Christoph Hellwig
2005-11-01 1:03 ` Roman Zippel
2005-11-01 1:07 ` Christoph Hellwig [this message]
2005-11-01 1:20 ` [PATCH] remove superflous ctime/mtime updates in affs Roman Zippel
2005-11-03 0:29 ` ctime/mtime update in affs and hpfs write path Mikulas Patocka
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=20051101010751.GA22040@lst.de \
--to=hch@lst.de \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mikulas@artax.karlin.mff.cuni.cz \
--cc=zippel@linux-m68k.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).