diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-09-30 23:46:31 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-09-30 23:46:31 -0400 |
commit | 7fcc99f4f2ddb1c39abc05fbb9b32f05b03c7f8f (patch) | |
tree | b07045981f17d855f89f1ef59579e330d8ffce20 /fs/hfsplus/hfsplus_fs.h | |
parent | 89755dcace09b44b3aa024bf302d9b19b4c24cad (diff) |
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 { | |||
158 | 158 | ||
159 | 159 | ||
160 | struct hfsplus_inode_info { | 160 | struct hfsplus_inode_info { |
161 | struct mutex extents_lock; | ||
162 | u32 clump_blocks, alloc_blocks; | ||
163 | sector_t fs_blocks; | ||
164 | /* Allocation extents from catalog record or volume header */ | ||
165 | hfsplus_extent_rec first_extents; | ||
166 | u32 first_blocks; | ||
167 | hfsplus_extent_rec cached_extents; | ||
168 | u32 cached_start, cached_blocks; | ||
169 | atomic_t opencnt; | 161 | atomic_t opencnt; |
170 | 162 | ||
171 | struct inode *rsrc_inode; | 163 | /* |
164 | * Extent allocation information, protected by extents_lock. | ||
165 | */ | ||
166 | u32 first_blocks; | ||
167 | u32 clump_blocks; | ||
168 | u32 alloc_blocks; | ||
169 | u32 cached_start; | ||
170 | u32 cached_blocks; | ||
171 | hfsplus_extent_rec first_extents; | ||
172 | hfsplus_extent_rec cached_extents; | ||
172 | unsigned long flags; | 173 | unsigned long flags; |
174 | struct mutex extents_lock; | ||
173 | 175 | ||
176 | /* | ||
177 | * Immutable data. | ||
178 | */ | ||
179 | struct inode *rsrc_inode; | ||
174 | __be32 create_date; | 180 | __be32 create_date; |
175 | /* Device number in hfsplus_permissions in catalog */ | ||
176 | u32 dev; | 181 | u32 dev; |
177 | /* BSD system and user file flags */ | ||
178 | u8 rootflags; | ||
179 | u8 userflags; | ||
180 | 182 | ||
183 | /* | ||
184 | * Protected by i_mutex. | ||
185 | */ | ||
186 | sector_t fs_blocks; | ||
187 | u8 rootflags, userflags; /* BSD system and user file flags */ | ||
181 | struct list_head open_dir_list; | 188 | struct list_head open_dir_list; |
182 | loff_t phys_size; | 189 | loff_t phys_size; |
190 | |||
183 | struct inode vfs_inode; | 191 | struct inode vfs_inode; |
184 | }; | 192 | }; |
185 | 193 | ||