From: Christoph Hellwig Subject: [PATCH] hfs: use sync_dirty_buffer Date: Wed, 6 Oct 2010 10:49:17 +0200 Message-ID: <20101006084917.GB8188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: viro@zeniv.linux.org.uk Return-path: Received: from verein.lst.de ([213.95.11.210]:44387 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758740Ab0JFItT (ORCPT ); Wed, 6 Oct 2010 04:49:19 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Use sync_dirty_buffer instead of the incorrect opencoding it. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/hfs/hfs_fs.h =================================================================== --- linux-2.6.orig/fs/hfs/hfs_fs.h 2010-06-21 20:22:56.726004281 +0200 +++ linux-2.6/fs/hfs/hfs_fs.h 2010-06-21 20:24:24.925031932 +0200 @@ -254,17 +254,6 @@ static inline void hfs_bitmap_dirty(stru sb->s_dirt = 1; } -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; \ Index: linux-2.6/fs/hfs/mdb.c =================================================================== --- linux-2.6.orig/fs/hfs/mdb.c 2010-06-21 20:24:04.365259623 +0200 +++ linux-2.6/fs/hfs/mdb.c 2010-06-21 20:24:22.122282881 +0200 @@ -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; @@ -287,7 +287,7 @@ void hfs_mdb_commit(struct super_block * 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)) {