From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH] remove superflous ctime/mtime updates in affs Date: Tue, 1 Nov 2005 02:07:51 +0100 Message-ID: <20051101010751.GA22040@lst.de> References: <20051031235306.GA21218@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, mikulas@artax.karlin.mff.cuni.cz Return-path: Received: from verein.lst.de ([213.95.11.210]:36520 "EHLO mail.lst.de") by vger.kernel.org with ESMTP id S964886AbVKABH6 (ORCPT ); Mon, 31 Oct 2005 20:07:58 -0500 To: akpm@osdl.org, Roman Zippel Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 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) {