From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Subject: [PATCH V2 3/7] blk-zoned: update blkdev_report_zone() with helper Date: Sun, 16 Jun 2019 18:28:28 -0700 [thread overview] Message-ID: <20190617012832.4311-4-chaitanya.kulkarni@wdc.com> (raw) In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> This patch updates the blkdev_report_zone(s)() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- block/blk-zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 5051db35c3fd..9faf4488339d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -106,7 +106,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep) return false; rep->start -= offset; - if (rep->start + rep->len > bdev->bd_part->nr_sects) + if (rep->start + rep->len > bdev_nr_sects(bdev)) return false; if (rep->type == BLK_ZONE_TYPE_CONVENTIONAL) @@ -176,13 +176,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector, if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones)) return -EOPNOTSUPP; - if (!*nr_zones || sector >= bdev->bd_part->nr_sects) { + if (!*nr_zones || sector >= bdev_nr_sects(bdev)) { *nr_zones = 0; return 0; } nrz = min(*nr_zones, - __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector)); + __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector)); ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector, zones, &nrz, gfp_mask); if (ret) -- 2.19.1
WARNING: multiple messages have this Message-ID (diff)
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> To: linux-block@vger.kernel.org Cc: colyli@suse.de, linux-bcache@vger.kernel.org, linux-btrace@vger.kernel.org, kent.overstreet@gmail.com, jaegeuk@kernel.org, damien.lemoal@wdc.com, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Subject: [PATCH V2 3/7] blk-zoned: update blkdev_report_zone() with helper Date: Mon, 17 Jun 2019 01:28:28 +0000 [thread overview] Message-ID: <20190617012832.4311-4-chaitanya.kulkarni@wdc.com> (raw) In-Reply-To: <20190617012832.4311-1-chaitanya.kulkarni@wdc.com> This patch updates the blkdev_report_zone(s)() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- block/blk-zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 5051db35c3fd..9faf4488339d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -106,7 +106,7 @@ static bool blkdev_report_zone(struct block_device *bdev, struct blk_zone *rep) return false; rep->start -= offset; - if (rep->start + rep->len > bdev->bd_part->nr_sects) + if (rep->start + rep->len > bdev_nr_sects(bdev)) return false; if (rep->type = BLK_ZONE_TYPE_CONVENTIONAL) @@ -176,13 +176,13 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector, if (WARN_ON_ONCE(!bdev->bd_disk->fops->report_zones)) return -EOPNOTSUPP; - if (!*nr_zones || sector >= bdev->bd_part->nr_sects) { + if (!*nr_zones || sector >= bdev_nr_sects(bdev)) { *nr_zones = 0; return 0; } nrz = min(*nr_zones, - __blkdev_nr_zones(q, bdev->bd_part->nr_sects - sector)); + __blkdev_nr_zones(q, bdev_nr_sects(bdev) - sector)); ret = blk_report_zones(bdev->bd_disk, get_start_sect(bdev) + sector, zones, &nrz, gfp_mask); if (ret) -- 2.19.1
next prev parent reply other threads:[~2019-06-17 1:28 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-17 1:28 [PATCH V2 0/7] block: use right accessor to read nr_setcs Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 1/7] block: add a helper function " Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 15:47 ` Bart Van Assche 2019-06-17 15:47 ` Bart Van Assche 2019-06-17 16:55 ` Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 2/7] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni [this message] 2019-06-17 1:28 ` [PATCH V2 3/7] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 4/7] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 5/7] bcache: update cached_dev_init() " Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 6:53 ` Coly Li 2019-06-17 6:53 ` Coly Li 2019-06-17 16:56 ` Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 6/7] f2fs: use helper in init_blkz_info() Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 1:28 ` [PATCH V2 7/7] blktrace: use helper in blk_trace_setup_lba() Chaitanya Kulkarni 2019-06-17 1:28 ` Chaitanya Kulkarni 2019-06-17 15:45 ` [PATCH V2 0/7] block: use right accessor to read nr_setcs Bart Van Assche 2019-06-17 15:45 ` Bart Van Assche 2019-06-17 16:57 ` Chaitanya Kulkarni 2019-06-17 15:53 ` Bart Van Assche 2019-06-17 15:53 ` Bart Van Assche 2019-06-17 16:58 ` Chaitanya Kulkarni
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190617012832.4311-4-chaitanya.kulkarni@wdc.com \ --to=chaitanya.kulkarni@wdc.com \ --cc=colyli@suse.de \ --cc=damien.lemoal@wdc.com \ --cc=jaegeuk@kernel.org \ --cc=kent.overstreet@gmail.com \ --cc=linux-bcache@vger.kernel.org \ --cc=linux-block@vger.kernel.org \ --cc=linux-btrace@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.