diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-02-04 09:24:25 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-02-04 09:24:25 -0500 |
commit | c487685d7c18a8481900755aa5c56a7a74193101 (patch) | |
tree | f2ff6c059e24d7fdf2e1fff498bbef0bb90bfbfc /fs/btrfs/disk-io.c | |
parent | 3935127c50c84106d654ef14962cff28c660bc62 (diff) |
Btrfs: hash_lock is no longer needed
Before metadata is written to disk, it is updated to reflect that writeout
has begun. Once this update is done, the block must be cow'd before it
can be modified again.
This update was originally synchronized by using a per-fs spinlock. Today
the buffers for the metadata blocks are locked before writeout begins,
and everyone that tests the flag has the buffer locked as well.
So, the per-fs spinlock (called hash_lock for no good reason) is no
longer required.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9c3810047976..549271607c17 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1503,7 +1503,6 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
1503 | INIT_LIST_HEAD(&fs_info->dead_roots); | 1503 | INIT_LIST_HEAD(&fs_info->dead_roots); |
1504 | INIT_LIST_HEAD(&fs_info->hashers); | 1504 | INIT_LIST_HEAD(&fs_info->hashers); |
1505 | INIT_LIST_HEAD(&fs_info->delalloc_inodes); | 1505 | INIT_LIST_HEAD(&fs_info->delalloc_inodes); |
1506 | spin_lock_init(&fs_info->hash_lock); | ||
1507 | spin_lock_init(&fs_info->delalloc_lock); | 1506 | spin_lock_init(&fs_info->delalloc_lock); |
1508 | spin_lock_init(&fs_info->new_trans_lock); | 1507 | spin_lock_init(&fs_info->new_trans_lock); |
1509 | spin_lock_init(&fs_info->ref_cache_lock); | 1508 | spin_lock_init(&fs_info->ref_cache_lock); |
@@ -2361,7 +2360,6 @@ int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid) | |||
2361 | int btree_lock_page_hook(struct page *page) | 2360 | int btree_lock_page_hook(struct page *page) |
2362 | { | 2361 | { |
2363 | struct inode *inode = page->mapping->host; | 2362 | struct inode *inode = page->mapping->host; |
2364 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
2365 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 2363 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
2366 | struct extent_buffer *eb; | 2364 | struct extent_buffer *eb; |
2367 | unsigned long len; | 2365 | unsigned long len; |
@@ -2376,9 +2374,7 @@ int btree_lock_page_hook(struct page *page) | |||
2376 | goto out; | 2374 | goto out; |
2377 | 2375 | ||
2378 | btrfs_tree_lock(eb); | 2376 | btrfs_tree_lock(eb); |
2379 | spin_lock(&root->fs_info->hash_lock); | ||
2380 | btrfs_set_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN); | 2377 | btrfs_set_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN); |
2381 | spin_unlock(&root->fs_info->hash_lock); | ||
2382 | btrfs_tree_unlock(eb); | 2378 | btrfs_tree_unlock(eb); |
2383 | free_extent_buffer(eb); | 2379 | free_extent_buffer(eb); |
2384 | out: | 2380 | out: |