diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-11-23 14:37:43 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-11-23 14:37:43 +0100 |
commit | 3b5ce8ae31e3c66655207907527476bbd3e5063b (patch) | |
tree | 5e4cb140be6865e3b67b45a705ab405f1cd94f30 /fs/hfsplus | |
parent | 6d1bbfc4c0458c514126ccf7d6ce9232d9dbc872 (diff) | |
download | linux-3b5ce8ae31e3c66655207907527476bbd3e5063b.tar.gz linux-3b5ce8ae31e3c66655207907527476bbd3e5063b.tar.bz2 linux-3b5ce8ae31e3c66655207907527476bbd3e5063b.zip |
hfsplus: always use hfsplus_sync_fs to write the volume header
Remove opencoded writing of the volume header in hfsplus_fill_super
and hfsplus_put_super and offload it to hfsplus_sync_fs. In the
put_super case this means we only write the superblock once instead
of twice.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/super.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 9bda9fd35511..6a2349058618 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -215,16 +215,14 @@ static void hfsplus_put_super(struct super_block *sb) if (!sb->s_fs_info) return; - if (sb->s_dirt) - hfsplus_write_super(sb); if (!(sb->s_flags & MS_RDONLY) && sbi->s_vhdr) { struct hfsplus_vh *vhdr = sbi->s_vhdr; vhdr->modify_date = hfsp_now2mt(); vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_UNMNT); vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_INCNSTNT); - mark_buffer_dirty(sbi->s_vhbh); - sync_dirty_buffer(sbi->s_vhbh); + + hfsplus_sync_fs(sb, 1); } hfs_btree_close(sbi->cat_tree); @@ -447,8 +445,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) be32_add_cpu(&vhdr->write_count, 1); vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT); vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT); - mark_buffer_dirty(sbi->s_vhbh); - sync_dirty_buffer(sbi->s_vhbh); + hfsplus_sync_fs(sb, 1); if (!sbi->hidden_dir) { mutex_lock(&sbi->vh_mutex); |