diff options
author | David Sterba <dsterba@suse.cz> | 2011-05-31 12:07:27 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-06-04 08:11:22 -0400 |
commit | 7841cb2898f66a73062c64d0ef5733dde7279e46 (patch) | |
tree | b7a94d96d44971845951a59e9fb7b5c2e30c46b3 /fs/btrfs/free-space-cache.c | |
parent | 4b9465cb9e3859186eefa1ca3b990a5849386320 (diff) |
btrfs: add helper for fs_info->closing
wrap checking of filesystem 'closing' flag and fix a few missing memory
barriers.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index bffa5c4a633b..ad144736a5fd 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -98,7 +98,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root, | |||
98 | return inode; | 98 | return inode; |
99 | 99 | ||
100 | spin_lock(&block_group->lock); | 100 | spin_lock(&block_group->lock); |
101 | if (!root->fs_info->closing) { | 101 | if (!btrfs_fs_closing(root->fs_info)) { |
102 | block_group->inode = igrab(inode); | 102 | block_group->inode = igrab(inode); |
103 | block_group->iref = 1; | 103 | block_group->iref = 1; |
104 | } | 104 | } |
@@ -493,8 +493,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info, | |||
493 | * If we're unmounting then just return, since this does a search on the | 493 | * If we're unmounting then just return, since this does a search on the |
494 | * normal root and not the commit root and we could deadlock. | 494 | * normal root and not the commit root and we could deadlock. |
495 | */ | 495 | */ |
496 | smp_mb(); | 496 | if (btrfs_fs_closing(fs_info)) |
497 | if (fs_info->closing) | ||
498 | return 0; | 497 | return 0; |
499 | 498 | ||
500 | /* | 499 | /* |
@@ -2513,7 +2512,7 @@ struct inode *lookup_free_ino_inode(struct btrfs_root *root, | |||
2513 | return inode; | 2512 | return inode; |
2514 | 2513 | ||
2515 | spin_lock(&root->cache_lock); | 2514 | spin_lock(&root->cache_lock); |
2516 | if (!root->fs_info->closing) | 2515 | if (!btrfs_fs_closing(root->fs_info)) |
2517 | root->cache_inode = igrab(inode); | 2516 | root->cache_inode = igrab(inode); |
2518 | spin_unlock(&root->cache_lock); | 2517 | spin_unlock(&root->cache_lock); |
2519 | 2518 | ||
@@ -2543,8 +2542,7 @@ int load_free_ino_cache(struct btrfs_fs_info *fs_info, struct btrfs_root *root) | |||
2543 | * If we're unmounting then just return, since this does a search on the | 2542 | * If we're unmounting then just return, since this does a search on the |
2544 | * normal root and not the commit root and we could deadlock. | 2543 | * normal root and not the commit root and we could deadlock. |
2545 | */ | 2544 | */ |
2546 | smp_mb(); | 2545 | if (btrfs_fs_closing(fs_info)) |
2547 | if (fs_info->closing) | ||
2548 | return 0; | 2546 | return 0; |
2549 | 2547 | ||
2550 | path = btrfs_alloc_path(); | 2548 | path = btrfs_alloc_path(); |