mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
715189d836
commit
b59352359d
12
fs/hfs/mdb.c
12
fs/hfs/mdb.c
|
@ -260,7 +260,7 @@ void hfs_mdb_commit(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct hfs_mdb *mdb = HFS_SB(sb)->mdb;
|
struct hfs_mdb *mdb = HFS_SB(sb)->mdb;
|
||||||
|
|
||||||
lock_super(sb);
|
lock_buffer(HFS_SB(sb)->mdb_bh);
|
||||||
if (test_and_clear_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags)) {
|
if (test_and_clear_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags)) {
|
||||||
/* These parameters may have been modified, so write them back */
|
/* These parameters may have been modified, so write them back */
|
||||||
mdb->drLsMod = hfs_mtime();
|
mdb->drLsMod = hfs_mtime();
|
||||||
|
@ -284,9 +284,13 @@ void hfs_mdb_commit(struct super_block *sb)
|
||||||
&mdb->drXTFlSize, NULL);
|
&mdb->drXTFlSize, NULL);
|
||||||
hfs_inode_write_fork(HFS_SB(sb)->cat_tree->inode, mdb->drCTExtRec,
|
hfs_inode_write_fork(HFS_SB(sb)->cat_tree->inode, mdb->drCTExtRec,
|
||||||
&mdb->drCTFlSize, NULL);
|
&mdb->drCTFlSize, NULL);
|
||||||
|
|
||||||
|
lock_buffer(HFS_SB(sb)->alt_mdb_bh);
|
||||||
memcpy(HFS_SB(sb)->alt_mdb, HFS_SB(sb)->mdb, HFS_SECTOR_SIZE);
|
memcpy(HFS_SB(sb)->alt_mdb, HFS_SB(sb)->mdb, HFS_SECTOR_SIZE);
|
||||||
HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT);
|
HFS_SB(sb)->alt_mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT);
|
||||||
HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT);
|
HFS_SB(sb)->alt_mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT);
|
||||||
|
unlock_buffer(HFS_SB(sb)->alt_mdb_bh);
|
||||||
|
|
||||||
mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh);
|
mark_buffer_dirty(HFS_SB(sb)->alt_mdb_bh);
|
||||||
sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh);
|
sync_dirty_buffer(HFS_SB(sb)->alt_mdb_bh);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +313,11 @@ void hfs_mdb_commit(struct super_block *sb)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
len = min((int)sb->s_blocksize - off, size);
|
len = min((int)sb->s_blocksize - off, size);
|
||||||
|
|
||||||
|
lock_buffer(bh);
|
||||||
memcpy(bh->b_data + off, ptr, len);
|
memcpy(bh->b_data + off, ptr, len);
|
||||||
|
unlock_buffer(bh);
|
||||||
|
|
||||||
mark_buffer_dirty(bh);
|
mark_buffer_dirty(bh);
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
block++;
|
block++;
|
||||||
|
@ -318,7 +326,7 @@ void hfs_mdb_commit(struct super_block *sb)
|
||||||
size -= len;
|
size -= len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlock_super(sb);
|
unlock_buffer(HFS_SB(sb)->mdb_bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hfs_mdb_close(struct super_block *sb)
|
void hfs_mdb_close(struct super_block *sb)
|
||||||
|
|
Loading…
Reference in New Issue