aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2010-11-23 08:37:43 -0500
committerChristoph Hellwig <hch@lst.de>2010-11-23 08:37:43 -0500
commit3b5ce8ae31e3c66655207907527476bbd3e5063b (patch)
tree5e4cb140be6865e3b67b45a705ab405f1cd94f30
parent6d1bbfc4c0458c514126ccf7d6ce9232d9dbc872 (diff)
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>
-rw-r--r--fs/hfsplus/super.c9
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)
215 if (!sb->s_fs_info) 215 if (!sb->s_fs_info)
216 return; 216 return;
217 217
218 if (sb->s_dirt)
219 hfsplus_write_super(sb);
220 if (!(sb->s_flags & MS_RDONLY) && sbi->s_vhdr) { 218 if (!(sb->s_flags & MS_RDONLY) && sbi->s_vhdr) {
221 struct hfsplus_vh *vhdr = sbi->s_vhdr; 219 struct hfsplus_vh *vhdr = sbi->s_vhdr;
222 220
223 vhdr->modify_date = hfsp_now2mt(); 221 vhdr->modify_date = hfsp_now2mt();
224 vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_UNMNT); 222 vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_UNMNT);
225 vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_INCNSTNT); 223 vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_INCNSTNT);
226 mark_buffer_dirty(sbi->s_vhbh); 224
227 sync_dirty_buffer(sbi->s_vhbh); 225 hfsplus_sync_fs(sb, 1);
228 } 226 }
229 227
230 hfs_btree_close(sbi->cat_tree); 228 hfs_btree_close(sbi->cat_tree);
@@ -447,8 +445,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
447 be32_add_cpu(&vhdr->write_count, 1); 445 be32_add_cpu(&vhdr->write_count, 1);
448 vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT); 446 vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT);
449 vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT); 447 vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT);
450 mark_buffer_dirty(sbi->s_vhbh); 448 hfsplus_sync_fs(sb, 1);
451 sync_dirty_buffer(sbi->s_vhbh);
452 449
453 if (!sbi->hidden_dir) { 450 if (!sbi->hidden_dir) {
454 mutex_lock(&sbi->vh_mutex); 451 mutex_lock(&sbi->vh_mutex);