Skip to content

Commit

Permalink
hfsplus: use alloc_mutex in hfsplus_sync_fs
Browse files Browse the repository at this point in the history
Use alloc_mutex to protect hfsplus_sync_fs against itself and concurrent
allocations, which allows to get rid of lock_super in hfsplus.

Note that most fields in the superblock still aren't protected against
concurrent allocations, that will follow later.

Signed-off-by: Christoph Hellwig <hch@tuxera.com>
  • Loading branch information
Christoph Hellwig committed Oct 1, 2010
1 parent 40bf48a commit a9fdbf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/hfsplus/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int hfsplus_sync_fs(struct super_block *sb, int wait)

dprint(DBG_SUPER, "hfsplus_write_super\n");

lock_super(sb);
mutex_lock(&HFSPLUS_SB(sb).alloc_mutex);
sb->s_dirt = 0;

vhdr->free_blocks = cpu_to_be32(HFSPLUS_SB(sb).free_blocks);
Expand Down Expand Up @@ -195,7 +195,7 @@ int hfsplus_sync_fs(struct super_block *sb, int wait)
}
HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP;
}
unlock_super(sb);
mutex_unlock(&HFSPLUS_SB(sb).alloc_mutex);
return 0;
}

Expand Down

0 comments on commit a9fdbf8

Please sign in to comment.