diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-10-01 05:46:31 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-10-01 05:46:31 +0200 |
commit | 7fcc99f4f2ddb1c39abc05fbb9b32f05b03c7f8f (patch) | |
tree | b07045981f17d855f89f1ef59579e330d8ffce20 /fs/hfsplus/hfsplus_fs.h | |
parent | 89755dcace09b44b3aa024bf302d9b19b4c24cad (diff) | |
download | talos-op-linux-7fcc99f4f2ddb1c39abc05fbb9b32f05b03c7f8f.tar.gz talos-op-linux-7fcc99f4f2ddb1c39abc05fbb9b32f05b03c7f8f.zip |
hfsplus: add missing extent locking in hfsplus_write_inode
Most of the extent handling code already does proper SMP locking, but
hfsplus_write_inode was calling into hfsplus_ext_write_extent without
taking the extents_lock. Fix this by splitting hfsplus_ext_write_extent
into an internal helper that expects the lock, and a public interface
that first acquires it.
Also add a few locking asserts and document the locking rules in
hfsplus_fs.h.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/hfsplus_fs.h')
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index c521d44f0747..c007cc201279 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -158,28 +158,36 @@ struct hfsplus_sb_info { struct hfsplus_inode_info { - struct mutex extents_lock; - u32 clump_blocks, alloc_blocks; - sector_t fs_blocks; - /* Allocation extents from catalog record or volume header */ - hfsplus_extent_rec first_extents; - u32 first_blocks; - hfsplus_extent_rec cached_extents; - u32 cached_start, cached_blocks; atomic_t opencnt; - struct inode *rsrc_inode; + /* + * Extent allocation information, protected by extents_lock. + */ + u32 first_blocks; + u32 clump_blocks; + u32 alloc_blocks; + u32 cached_start; + u32 cached_blocks; + hfsplus_extent_rec first_extents; + hfsplus_extent_rec cached_extents; unsigned long flags; + struct mutex extents_lock; + /* + * Immutable data. + */ + struct inode *rsrc_inode; __be32 create_date; - /* Device number in hfsplus_permissions in catalog */ u32 dev; - /* BSD system and user file flags */ - u8 rootflags; - u8 userflags; + /* + * Protected by i_mutex. + */ + sector_t fs_blocks; + u8 rootflags, userflags; /* BSD system and user file flags */ struct list_head open_dir_list; loff_t phys_size; + struct inode vfs_inode; }; |