Loading fs/btrfs/ctree.h +9 −0 Original line number Diff line number Diff line Loading @@ -2354,6 +2354,15 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *node, struct extent_buffer *parent); static inline int btrfs_fs_closing(struct btrfs_fs_info *fs_info) { /* * Get synced with close_ctree() */ smp_mb(); return fs_info->closing; } /* root-item.c */ int btrfs_find_root_ref(struct btrfs_root *tree_root, struct btrfs_path *path, Loading fs/btrfs/extent-tree.c +1 −2 Original line number Diff line number Diff line Loading @@ -366,8 +366,7 @@ static int caching_kthread(void *data) nritems = btrfs_header_nritems(leaf); while (1) { smp_mb(); if (fs_info->closing > 1) { if (btrfs_fs_closing(fs_info) > 1) { last = (u64)-1; break; } Loading fs/btrfs/file.c +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, if (!btrfs_test_opt(root, AUTO_DEFRAG)) return 0; if (root->fs_info->closing) if (btrfs_fs_closing(root->fs_info)) return 0; if (BTRFS_I(inode)->in_defrag) Loading Loading @@ -229,7 +229,7 @@ int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) first_ino = defrag->ino + 1; rb_erase(&defrag->rb_node, &fs_info->defrag_inodes); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) goto next_free; spin_unlock(&fs_info->defrag_inodes_lock); Loading fs/btrfs/free-space-cache.c +4 −6 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root, return inode; spin_lock(&block_group->lock); if (!root->fs_info->closing) { if (!btrfs_fs_closing(root->fs_info)) { block_group->inode = igrab(inode); block_group->iref = 1; } Loading Loading @@ -493,8 +493,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info, * If we're unmounting then just return, since this does a search on the * normal root and not the commit root and we could deadlock. */ smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) return 0; /* Loading Loading @@ -2513,7 +2512,7 @@ struct inode *lookup_free_ino_inode(struct btrfs_root *root, return inode; spin_lock(&root->cache_lock); if (!root->fs_info->closing) if (!btrfs_fs_closing(root->fs_info)) root->cache_inode = igrab(inode); spin_unlock(&root->cache_lock); Loading Loading @@ -2543,8 +2542,7 @@ int load_free_ino_cache(struct btrfs_fs_info *fs_info, struct btrfs_root *root) * If we're unmounting then just return, since this does a search on the * normal root and not the commit root and we could deadlock. */ smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) return 0; path = btrfs_alloc_path(); Loading fs/btrfs/inode-map.c +1 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,7 @@ static int caching_kthread(void *data) goto out; while (1) { smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) goto out; leaf = path->nodes[0]; Loading Loading
fs/btrfs/ctree.h +9 −0 Original line number Diff line number Diff line Loading @@ -2354,6 +2354,15 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *node, struct extent_buffer *parent); static inline int btrfs_fs_closing(struct btrfs_fs_info *fs_info) { /* * Get synced with close_ctree() */ smp_mb(); return fs_info->closing; } /* root-item.c */ int btrfs_find_root_ref(struct btrfs_root *tree_root, struct btrfs_path *path, Loading
fs/btrfs/extent-tree.c +1 −2 Original line number Diff line number Diff line Loading @@ -366,8 +366,7 @@ static int caching_kthread(void *data) nritems = btrfs_header_nritems(leaf); while (1) { smp_mb(); if (fs_info->closing > 1) { if (btrfs_fs_closing(fs_info) > 1) { last = (u64)-1; break; } Loading
fs/btrfs/file.c +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, if (!btrfs_test_opt(root, AUTO_DEFRAG)) return 0; if (root->fs_info->closing) if (btrfs_fs_closing(root->fs_info)) return 0; if (BTRFS_I(inode)->in_defrag) Loading Loading @@ -229,7 +229,7 @@ int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) first_ino = defrag->ino + 1; rb_erase(&defrag->rb_node, &fs_info->defrag_inodes); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) goto next_free; spin_unlock(&fs_info->defrag_inodes_lock); Loading
fs/btrfs/free-space-cache.c +4 −6 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root, return inode; spin_lock(&block_group->lock); if (!root->fs_info->closing) { if (!btrfs_fs_closing(root->fs_info)) { block_group->inode = igrab(inode); block_group->iref = 1; } Loading Loading @@ -493,8 +493,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info, * If we're unmounting then just return, since this does a search on the * normal root and not the commit root and we could deadlock. */ smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) return 0; /* Loading Loading @@ -2513,7 +2512,7 @@ struct inode *lookup_free_ino_inode(struct btrfs_root *root, return inode; spin_lock(&root->cache_lock); if (!root->fs_info->closing) if (!btrfs_fs_closing(root->fs_info)) root->cache_inode = igrab(inode); spin_unlock(&root->cache_lock); Loading Loading @@ -2543,8 +2542,7 @@ int load_free_ino_cache(struct btrfs_fs_info *fs_info, struct btrfs_root *root) * If we're unmounting then just return, since this does a search on the * normal root and not the commit root and we could deadlock. */ smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) return 0; path = btrfs_alloc_path(); Loading
fs/btrfs/inode-map.c +1 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,7 @@ static int caching_kthread(void *data) goto out; while (1) { smp_mb(); if (fs_info->closing) if (btrfs_fs_closing(fs_info)) goto out; leaf = path->nodes[0]; Loading