diff options
author | 2020-11-24 11:54:06 +0100 | |
---|---|---|
committer | 2020-12-01 14:53:38 -0700 | |
commit | 040f04bd2e825f1d80b14a0e0ac3d830339eb779 (patch) | |
tree | 344a715d906949d20f1131c6f169b26fdb8e6eea /fs/f2fs | |
parent | fs: remove get_super_thawed and get_super_exclusive_thawed (diff) | |
download | linux-040f04bd2e825f1d80b14a0e0ac3d830339eb779.tar.gz linux-040f04bd2e825f1d80b14a0e0ac3d830339eb779.tar.bz2 linux-040f04bd2e825f1d80b14a0e0ac3d830339eb779.zip |
fs: simplify freeze_bdev/thaw_bdev
Store the frozen superblock in struct block_device to avoid the awkward
interface that can return a sb only used a cookie, an ERR_PTR or NULL.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Chao Yu <yuchao0@huawei.com> [f2fs]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index ee861c6d9ff0..a9fc482a0e60 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2230,16 +2230,12 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) switch (in) { case F2FS_GOING_DOWN_FULLSYNC: - sb = freeze_bdev(sb->s_bdev); - if (IS_ERR(sb)) { - ret = PTR_ERR(sb); + ret = freeze_bdev(sb->s_bdev); + if (ret) goto out; - } - if (sb) { - f2fs_stop_checkpoint(sbi, false); - set_sbi_flag(sbi, SBI_IS_SHUTDOWN); - thaw_bdev(sb->s_bdev, sb); - } + f2fs_stop_checkpoint(sbi, false); + set_sbi_flag(sbi, SBI_IS_SHUTDOWN); + thaw_bdev(sb->s_bdev); break; case F2FS_GOING_DOWN_METASYNC: /* do checkpoint only */ |