diff options
author | Aravind Ramesh <Aravind.Ramesh@wdc.com> | 2022-06-07 19:16:13 +0200 |
---|---|---|
committer | Aravind Ramesh <Aravind.Ramesh@wdc.com> | 2022-07-21 12:11:14 +0200 |
commit | 9efdb8cfe828888bda72246562845bb58f4eaa18 (patch) | |
tree | a04bf81c49ab9915e50e6d51f0ca887fc826ba89 /src/crimson/os/seastore/segment_manager | |
parent | crimson/zns: fix up log messages (diff) | |
download | ceph-9efdb8cfe828888bda72246562845bb58f4eaa18.tar.xz ceph-9efdb8cfe828888bda72246562845bb58f4eaa18.zip |
crimson/zns: fix ioctl parameters to get correct zone information
Fix BLKREPORTZONE ioctl parameters to report correct zone capacity.
Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Diffstat (limited to 'src/crimson/os/seastore/segment_manager')
-rw-r--r-- | src/crimson/os/seastore/segment_manager/zns.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/crimson/os/seastore/segment_manager/zns.cc b/src/crimson/os/seastore/segment_manager/zns.cc index a39e6bbc59c..c0dc6d8a8c7 100644 --- a/src/crimson/os/seastore/segment_manager/zns.cc +++ b/src/crimson/os/seastore/segment_manager/zns.cc @@ -118,25 +118,20 @@ static seastar::future<> reset_device( } static seastar::future<size_t> get_zone_capacity( - seastar::file &device, - uint32_t zone_size, + seastar::file &device, + uint32_t zone_size, uint32_t nr_zones) { return seastar::do_with( - blk_zone_range{}, ZoneReport(nr_zones), - [&] (auto &first_zone_range, auto &zr){ - first_zone_range.sector = 0; - first_zone_range.nr_sectors = zone_size; - return device.ioctl( - BLKOPENZONE, - &first_zone_range - ).then([&](int ret){ - return device.ioctl(BLKREPORTZONE, zr.hdr); - }).then([&] (int ret){ - return device.ioctl(BLKRESETZONE, &first_zone_range); - }).then([&](int ret){ - return seastar::make_ready_future<size_t>(zr.hdr->zones[0].wp); + [&] (auto &zr) { + zr.hdr->sector = 0; + zr.hdr->nr_zones = nr_zones; + return device.ioctl( + BLKREPORTZONE, + zr.hdr + ).then([&](int ret) { + return seastar::make_ready_future<size_t>(zr.hdr->zones[0].capacity); }); } ); @@ -322,10 +317,12 @@ ZNSSegmentManager::mkfs_ret ZNSSegmentManager::mkfs( } return device.ioctl(BLKGETZONESZ, (void *)&zone_size); }).then([&] (int ret){ + ceph_assert(zone_size); return reset_device(device, zone_size, nr_zones); }).then([&] { return get_zone_capacity(device, zone_size, nr_zones); }).then([&, FNAME, config] (auto zone_capacity){ + ceph_assert(zone_capacity); sb = make_metadata( config.meta, stat, |