summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-26 20:43:37 +0300
committerJens Axboe <axboe@kernel.dk>2020-12-02 00:53:40 +0300
commita782483cc1f875355690625d8253a232f2581418 (patch)
tree492d3bf67cdd2535afd826dde93aa35dcfb42180 /fs/f2fs
parente6cb53827ed60019bbbc5cf189dd204b3b0e8121 (diff)
downloadlinux-a782483cc1f875355690625d8253a232f2581418.tar.xz
block: remove the nr_sects field in struct hd_struct
Now that the hd_struct always has a block device attached to it, there is no need for having two size field that just get out of sync. Additionally the field in hd_struct did not use proper serialization, possibly allowing for torn writes. By only using the block_device field this problem also gets fixed. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Coly Li <colyli@suse.de> [bcache] 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/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 00eff2f51807..d4e7fab352ba 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3151,7 +3151,7 @@ static int f2fs_report_zone_cb(struct blk_zone *zone, unsigned int idx,
static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
{
struct block_device *bdev = FDEV(devi).bdev;
- sector_t nr_sectors = bdev->bd_part->nr_sects;
+ sector_t nr_sectors = bdev_nr_sectors(bdev);
struct f2fs_report_zones_args rep_zone_arg;
int ret;