linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Subject: [PATCHv5 14/16] HFS: kill hfs_buffer_sync
Date: Sun,  6 Jun 2010 17:50:27 +0300	[thread overview]
Message-ID: <1275835829-1478-15-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1275835829-1478-1-git-send-email-dedekind1@gmail.com>

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

and use 'sync_dirty_buffer()' instead, which is the right way
of doing synchronization.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/hfs/hfs_fs.h |   11 -----------
 fs/hfs/mdb.c    |    4 ++--
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h
index 99b5866..3514e7a 100644
--- a/fs/hfs/hfs_fs.h
+++ b/fs/hfs/hfs_fs.h
@@ -254,17 +254,6 @@ static inline void hfs_bitmap_dirty(struct super_block *sb)
 	sb_mark_dirty(sb);
 }
 
-static inline void hfs_buffer_sync(struct buffer_head *bh)
-{
-	while (buffer_locked(bh)) {
-		wait_on_buffer(bh);
-	}
-	if (buffer_dirty(bh)) {
-		ll_rw_block(WRITE, 1, &bh);
-		wait_on_buffer(bh);
-	}
-}
-
 #define sb_bread512(sb, sec, data) ({			\
 	struct buffer_head *__bh;			\
 	sector_t __block;				\
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 957945e..159ab88 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -220,7 +220,7 @@ int hfs_mdb_get(struct super_block *sb)
 		mdb->drLsMod = hfs_mtime();
 
 		mark_buffer_dirty(HFS_SB(sb)->mdb_bh);
-		hfs_buffer_sync(HFS_SB(sb)->mdb_bh);
+		sync_dirty_buffer(HFS_SB(sb)->mdb_bh);
 	}
 
 	return 0;
@@ -288,7 +288,7 @@ void hfs_mdb_commit(struct super_block *sb)
 		HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT);
 		HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT);
 		mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh);
-		hfs_buffer_sync(HFS_SB(sb)->alt_mdb_bh);
+		sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh);
 	}
 
 	if (test_and_clear_bit(HFS_FLG_BITMAP_DIRTY, &HFS_SB(sb)->flags)) {
-- 
1.7.0.1


  parent reply	other threads:[~2010-06-06 14:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06 14:50 [PATCHv5 00/16] kill unnecessary SB sync wake-ups + cleanups Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 01/16] VFS: introduce helpers for the s_dirt flag Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 02/16] VFS: rename s_dirt to s_dirty Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 03/16] writeback: lessen sync_supers wakeup count Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 04/16] VFS: add memory barrier to sb_mark_clean and sb_mark_dirty Artem Bityutskiy
2010-06-06 17:16   ` Artem Bityutskiy
2010-06-06 19:22     ` Artem Bityutskiy
2010-06-09 16:36   ` Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 05/16] AFFS: clean up dirty flag usage Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 06/16] AFFS: wait for sb synchronization when needed Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 07/16] AFFS: fix race condition in marking SB dirty Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 08/16] BFS: clean up the superblock usage Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 09/16] btrfs: remove junk sb_mark_dirty call Artem Bityutskiy
2010-06-12  7:36   ` Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 10/16] exofs: fix race condition in marking SB dirty Artem Bityutskiy
2010-06-06 16:12   ` Boaz Harrosh
2010-06-06 14:50 ` [PATCHv5 11/16] ext2: " Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 12/16] ext4: " Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 13/16] HFS: " Artem Bityutskiy
2010-06-06 14:50 ` Artem Bityutskiy [this message]
2010-06-06 14:50 ` [PATCHv5 15/16] HFS: wait for sb synchronization when needed Artem Bityutskiy
2010-06-06 14:50 ` [PATCHv5 16/16] HFSPLUS: wait for synchronization Artem Bityutskiy

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=1275835829-1478-15-git-send-email-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).