aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-07-12 10:28:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 15:58:06 -0400
commitb59352359d6555aa8537d74ac9b15c1c6bcf3c68 (patch)
tree549447dfaf2a0ea136a3e7fd92a723f15406cd62 /fs/hfs
parent715189d836ab276b3d0fc114681f12b423686ffa (diff)
hfs: get rid of lock_super
Stop using lock_super for serializing the MDB changes - use the buffer-head own lock instead. Tested with fsstress. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfs')
-rw-r--r--fs/hfs/mdb.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 3f558d58fba2..7a3224049f30 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -260,7 +260,7 @@ void hfs_mdb_commit(struct super_block *sb)
260{ 260{
261 struct hfs_mdb *mdb = HFS_SB(sb)->mdb; 261 struct hfs_mdb *mdb = HFS_SB(sb)->mdb;
262 262
263 lock_super(sb); 263 lock_buffer(HFS_SB(sb)->mdb_bh);
264 if (test_and_clear_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags)) { 264 if (test_and_clear_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags)) {
265 /* These parameters may have been modified, so write them back */ 265 /* These parameters may have been modified, so write them back */
266 mdb->drLsMod = hfs_mtime(); 266 mdb->drLsMod = hfs_mtime();
@@ -284,9 +284,13 @@ void hfs_mdb_commit(struct super_block *sb)
284 &mdb->drXTFlSize, NULL); 284 &mdb->drXTFlSize, NULL);
285 hfs_inode_write_fork(HFS_SB(sb)->cat_tree->inode, mdb->drCTExtRec, 285 hfs_inode_write_fork(HFS_SB(sb)->cat_tree->inode, mdb->drCTExtRec,
286 &mdb->drCTFlSize, NULL); 286 &mdb->drCTFlSize, NULL);
287
288 lock_buffer(HFS_SB(sb)->alt_mdb_bh);
287 memcpy(HFS_SB(sb)->alt_mdb, HFS_SB(sb)->mdb, HFS_SECTOR_SIZE); 289 memcpy(HFS_SB(sb)->alt_mdb, HFS_SB(sb)->mdb, HFS_SECTOR_SIZE);
288 HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT); 290 HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT);
289 HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT); 291 HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT);
292 unlock_buffer(HFS_SB(sb)->alt_mdb_bh);
293
290 mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh); 294 mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh);
291 sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh); 295 sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh);
292 } 296 }
@@ -309,7 +313,11 @@ void hfs_mdb_commit(struct super_block *sb)
309 break; 313 break;
310 } 314 }
311 len = min((int)sb->s_blocksize - off, size); 315 len = min((int)sb->s_blocksize - off, size);
316
317 lock_buffer(bh);
312 memcpy(bh->b_data + off, ptr, len); 318 memcpy(bh->b_data + off, ptr, len);
319 unlock_buffer(bh);
320
313 mark_buffer_dirty(bh); 321 mark_buffer_dirty(bh);
314 brelse(bh); 322 brelse(bh);
315 block++; 323 block++;
@@ -318,7 +326,7 @@ void hfs_mdb_commit(struct super_block *sb)
318 size -= len; 326 size -= len;
319 } 327 }
320 } 328 }
321 unlock_super(sb); 329 unlock_buffer(HFS_SB(sb)->mdb_bh);
322} 330}
323 331
324void hfs_mdb_close(struct super_block *sb) 332void hfs_mdb_close(struct super_block *sb)