diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-09-30 23:45:08 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-09-30 23:45:08 -0400 |
commit | 7ac9fb9c2a50963b699b3548e6f00698c1554dc6 (patch) | |
tree | 3660bfb2985c65838b5969694e54043ae6639b3a /fs/hfsplus/super.c | |
parent | 58a818f532e83f337689358c102ba2048d1b37f5 (diff) |
hfsplus: add per-superblock lock for volume header updates
Lock updates to the mutal fields in the volume header, and document the
locing in the hfsplus_sb_info structure.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r-- | fs/hfsplus/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 923f385b32ca..b766c170e4d8 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -160,6 +160,7 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) | |||
160 | 160 | ||
161 | dprint(DBG_SUPER, "hfsplus_write_super\n"); | 161 | dprint(DBG_SUPER, "hfsplus_write_super\n"); |
162 | 162 | ||
163 | mutex_lock(&sbi->vh_mutex); | ||
163 | mutex_lock(&sbi->alloc_mutex); | 164 | mutex_lock(&sbi->alloc_mutex); |
164 | sb->s_dirt = 0; | 165 | sb->s_dirt = 0; |
165 | 166 | ||
@@ -194,6 +195,7 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) | |||
194 | sbi->flags &= ~HFSPLUS_SB_WRITEBACKUP; | 195 | sbi->flags &= ~HFSPLUS_SB_WRITEBACKUP; |
195 | } | 196 | } |
196 | mutex_unlock(&sbi->alloc_mutex); | 197 | mutex_unlock(&sbi->alloc_mutex); |
198 | mutex_unlock(&sbi->vh_mutex); | ||
197 | return 0; | 199 | return 0; |
198 | } | 200 | } |
199 | 201 | ||
@@ -319,6 +321,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
319 | 321 | ||
320 | sb->s_fs_info = sbi; | 322 | sb->s_fs_info = sbi; |
321 | mutex_init(&sbi->alloc_mutex); | 323 | mutex_init(&sbi->alloc_mutex); |
324 | mutex_init(&sbi->vh_mutex); | ||
322 | hfsplus_fill_defaults(sbi); | 325 | hfsplus_fill_defaults(sbi); |
323 | if (!hfsplus_parse_options(data, sbi)) { | 326 | if (!hfsplus_parse_options(data, sbi)) { |
324 | printk(KERN_ERR "hfs: unable to parse mount options\n"); | 327 | printk(KERN_ERR "hfs: unable to parse mount options\n"); |
@@ -453,9 +456,13 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
453 | 456 | ||
454 | if (!sbi->hidden_dir) { | 457 | if (!sbi->hidden_dir) { |
455 | printk(KERN_DEBUG "hfs: create hidden dir...\n"); | 458 | printk(KERN_DEBUG "hfs: create hidden dir...\n"); |
459 | |||
460 | mutex_lock(&sbi->vh_mutex); | ||
456 | sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR); | 461 | sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR); |
457 | hfsplus_create_cat(sbi->hidden_dir->i_ino, sb->s_root->d_inode, | 462 | hfsplus_create_cat(sbi->hidden_dir->i_ino, sb->s_root->d_inode, |
458 | &str, sbi->hidden_dir); | 463 | &str, sbi->hidden_dir); |
464 | mutex_unlock(&sbi->vh_mutex); | ||
465 | |||
459 | mark_inode_dirty(sbi->hidden_dir); | 466 | mark_inode_dirty(sbi->hidden_dir); |
460 | } | 467 | } |
461 | out: | 468 | out: |