]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
hfsplus: use alloc_mutex in hfsplus_sync_fs
authorChristoph Hellwig <hch@lst.de>
Fri, 1 Oct 2010 03:41:50 +0000 (05:41 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 1 Oct 2010 03:41:50 +0000 (05:41 +0200)
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>
fs/hfsplus/super.c

index 3dc62aa58728331cd78d883f95288394dcea2086..4936642debaa292358ea818993e9c3e66dfdf9eb 100644 (file)
@@ -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);
@@ -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;
 }