public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Machida, Hiroyuki" <machida@sm.sony.co.jp>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	linux-kernel@vger.kernel.org
Cc: "Machida, Hiroyuki" <machida@sm.sony.co.jp>
Subject: [PATCH 2/2] replace ext2_sync_inode() with sync_inode_wodata(  (Re: [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime))
Date: Fri, 30 Sep 2005 02:49:22 +0900	[thread overview]
Message-ID: <433C2922.1000008@sm.sony.co.jp> (raw)
In-Reply-To: <433C25D9.9090602@sm.sony.co.jp>

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

This patch replaces ext2_sync_inode() with sync_inode_wodata(), which is
introduced by fs-sync-attr.patch attached at
"[PATCH 1/2] miss-sync changes on attributes"

Machida, Hiroyuki wrote:
> 
> I revise a previous patch. Now checking dirty flag is done
> at vfs layer, as OGAWA-san said. I realized ext2_sync_inode()
> is good for syncing inode without it's data. I moved it to vfs layer
> and rename it to sync_inode_wodata().
> 
> The first patch attached here is changes on vfs layer.
> Second patch attached at the next mail is changes on ext2 fs.
> 
> 
> OGAWA Hirofumi wrote:
> 
>> "Machida, Hiroyuki" <machida@sm.sony.co.jp> writes:
>>
>>
>>> +    if ( (!error) && IS_SYNC(inode)) {
>>> +        error = write_inode_now(inode, 1);
>>> +    }
>>
>>
>>
>> We don't need to sync the data pages at all here. And I think it is
>> not right place for doing this.  If we need this, since we need to see
>> O_SYNC for fchxxx() VFS would be right place to do it.
>>
>> But, personally, I'd like to kill the "-o sync" stuff for these
>> independent meta data rather. Then...
> 
> 
> 
> ------------------------------------------------------------------------

-- 
Hiroyuki Machida		machida@sm.sony.co.jp		


[-- Attachment #2: ext2-inode-sync.patch --]
[-- Type: text/plain, Size: 2919 bytes --]


This patch replaces ext2_sync_inode() with sync_inode_wodata().

* ext2-inode-sync.patch for 2.6.13

 ext2.h  |    1 -
 fsync.c |    2 +-
 inode.c |   11 +----------
 xattr.c |    2 +-

Signed-off-by: Hiroyuki Machida <machdia@sm.sony.co.jp>

 4 files changed, 3 insertions(+), 13 deletions(-)
--- linux-2.6.13/fs/ext2/ext2.h	2005-08-29 08:41:01.000000000 +0900
+++ linux-2.6.13-sync-attr/fs/ext2/ext2.h	2005-09-29 12:56:15.942213423 +0900
@@ -127,7 +127,6 @@ extern void ext2_read_inode (struct inod
 extern int ext2_write_inode (struct inode *, int);
 extern void ext2_put_inode (struct inode *);
 extern void ext2_delete_inode (struct inode *);
-extern int ext2_sync_inode (struct inode *);
 extern void ext2_discard_prealloc (struct inode *);
 extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
 extern void ext2_truncate (struct inode *);
diff -upr linux-2.6.13/fs/ext2/fsync.c linux-2.6.13-sync-attr/fs/ext2/fsync.c
--- linux-2.6.13/fs/ext2/fsync.c	2005-08-29 08:41:01.000000000 +0900
+++ linux-2.6.13-sync-attr/fs/ext2/fsync.c	2005-09-30 01:31:54.492518751 +0900
@@ -44,7 +44,7 @@ int ext2_sync_file(struct file *file, st
 	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
 		return ret;
 
-	err = ext2_sync_inode(inode);
+	err = sync_inode_wodata(inode);
 	if (ret == 0)
 		ret = err;
 	return ret;
diff -upr linux-2.6.13/fs/ext2/inode.c linux-2.6.13-sync-attr/fs/ext2/inode.c
--- linux-2.6.13/fs/ext2/inode.c	2005-08-29 08:41:01.000000000 +0900
+++ linux-2.6.13-sync-attr/fs/ext2/inode.c	2005-09-30 01:30:32.750569279 +0900
@@ -993,7 +993,7 @@ do_indirects:
 	inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
 	if (inode_needs_sync(inode)) {
 		sync_mapping_buffers(inode->i_mapping);
-		ext2_sync_inode (inode);
+		sync_inode_wodata(inode);
 	} else {
 		mark_inode_dirty(inode);
 	}
@@ -1282,15 +1282,6 @@ int ext2_write_inode(struct inode *inode
 	return ext2_update_inode(inode, wait);
 }
 
-int ext2_sync_inode(struct inode *inode)
-{
-	struct writeback_control wbc = {
-		.sync_mode = WB_SYNC_ALL,
-		.nr_to_write = 0,	/* sys_fsync did this */
-	};
-	return sync_inode(inode, &wbc);
-}
-
 int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
 {
 	struct inode *inode = dentry->d_inode;
diff -upr linux-2.6.13/fs/ext2/xattr.c linux-2.6.13-sync-attr/fs/ext2/xattr.c
--- linux-2.6.13/fs/ext2/xattr.c	2005-08-29 08:41:01.000000000 +0900
+++ linux-2.6.13-sync-attr/fs/ext2/xattr.c	2005-09-30 01:30:43.070815408 +0900
@@ -705,7 +705,7 @@ ext2_xattr_set2(struct inode *inode, str
 	EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0;
 	inode->i_ctime = CURRENT_TIME_SEC;
 	if (IS_SYNC(inode)) {
-		error = ext2_sync_inode (inode);
+		error = sync_inode_wodata(inode);
 		/* In case sync failed due to ENOSPC the inode was actually
 		 * written (only some dirty data were not) so we just proceed
 		 * as if nothing happened and cleanup the unused block */

  reply	other threads:[~2005-09-29 17:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 20:39 [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime) Machida, Hiroyuki
2005-09-15 13:15 ` OGAWA Hirofumi
2005-09-15 13:58   ` Machida, Hiroyuki
2005-09-29 17:35   ` [PATCH 1/2] miss-sync changes on attributes (Re: [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime)) Machida, Hiroyuki
2005-09-29 17:49     ` Machida, Hiroyuki [this message]
2005-09-29 19:20     ` Machida, Hiroyuki
2005-10-11 21:26     ` Andrew Morton
2005-10-12  4:02       ` OGAWA Hirofumi
2005-10-12  4:16         ` Andrew Morton
2005-10-12  4:58           ` OGAWA Hirofumi
2005-10-12  5:47             ` OGAWA Hirofumi
2005-10-12  5:54             ` Machida, Hiroyuki
2005-10-12  6:10               ` Andrew Morton
2005-10-12  9:04                 ` Machida, Hiroyuki
2005-10-12  6:21               ` OGAWA Hirofumi
2005-10-12  9:15                 ` Machida, Hiroyuki
2005-10-14 13:01                   ` [PATCH] generic_osync_inode() with OSYNC_INODE only passed (Re: [PATCH 1/2] miss-sync changes on attributes) Machida, Hiroyuki
2005-10-14 13:02                   ` Machida, Hiroyuki
2005-10-29  8:42           ` [PATCH] Fix !mapping_cap_writeback_dirty(inode->i_mapping) OGAWA Hirofumi
2005-10-29  8:58             ` [PATCH] Don't use pdflush for filesystems has BDI_CAP_NO_WRITEBACK OGAWA Hirofumi
2005-10-30 17:15               ` OGAWA Hirofumi

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=433C2922.1000008@sm.sony.co.jp \
    --to=machida@sm.sony.co.jp \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@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