relocation.c (1136fa0c07de570dc17858745af8be169d1440ba) relocation.c (b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2009 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/pagemap.h>
8#include <linux/writeback.h>

--- 3946 unchanged lines hidden (view full) ---

3955 struct btrfs_root *extent_root = btrfs_extent_root(fs_info, group_start);
3956 struct reloc_control *rc;
3957 struct inode *inode;
3958 struct btrfs_path *path;
3959 int ret;
3960 int rw = 0;
3961 int err = 0;
3962
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2009 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/pagemap.h>
8#include <linux/writeback.h>

--- 3946 unchanged lines hidden (view full) ---

3955 struct btrfs_root *extent_root = btrfs_extent_root(fs_info, group_start);
3956 struct reloc_control *rc;
3957 struct inode *inode;
3958 struct btrfs_path *path;
3959 int ret;
3960 int rw = 0;
3961 int err = 0;
3962
3963 /*
3964 * This only gets set if we had a half-deleted snapshot on mount. We
3965 * cannot allow relocation to start while we're still trying to clean up
3966 * these pending deletions.
3967 */
3968 ret = wait_on_bit(&fs_info->flags, BTRFS_FS_UNFINISHED_DROPS, TASK_INTERRUPTIBLE);
3969 if (ret)
3970 return ret;
3971
3972 /* We may have been woken up by close_ctree, so bail if we're closing. */
3973 if (btrfs_fs_closing(fs_info))
3974 return -EINTR;
3975
3963 bg = btrfs_lookup_block_group(fs_info, group_start);
3964 if (!bg)
3965 return -ENOENT;
3966
3967 if (btrfs_pinned_by_swapfile(fs_info, bg)) {
3968 btrfs_put_block_group(bg);
3969 return -ETXTBSY;
3970 }

--- 504 unchanged lines hidden ---
3976 bg = btrfs_lookup_block_group(fs_info, group_start);
3977 if (!bg)
3978 return -ENOENT;
3979
3980 if (btrfs_pinned_by_swapfile(fs_info, bg)) {
3981 btrfs_put_block_group(bg);
3982 return -ETXTBSY;
3983 }

--- 504 unchanged lines hidden ---