From: Bart Van Assche <bvanassche@acm.org>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
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
Subject: Re: [PATCH V2 1/7] block: add a helper function to read nr_setcs
Date: Mon, 17 Jun 2019 15:47:52 +0000 [thread overview]
Message-ID: <67bcc55e-a674-7a71-7ce3-3a6745977740@acm.org> (raw)
In-Reply-To: <20190617012832.4311-2-chaitanya.kulkarni@wdc.com>
On 6/16/19 6:28 PM, Chaitanya Kulkarni wrote:
> This patch introduces helper function to read the number of sectors
> from struct block_device->bd_part member. For more details Please refer
> to the comment in the include/linux/genhd.h for part_nr_sects_read().
>
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> include/linux/blkdev.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 592669bcc536..2ef1de20fd22 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1475,6 +1475,16 @@ static inline void put_dev_sector(Sector p)
> put_page(p.v);
> }
>
> +/* Helper function to read the bdev->bd_part->nr_sects */
> +static inline sector_t bdev_nr_sects(struct block_device *bdev)
> +{
> + sector_t nr_sects;
> +
> + nr_sects = part_nr_sects_read(bdev->bd_part);
> +
> + return nr_sects;
> +}
Although this looks fine to me, is there any reason why the body of that
function has not been written as follows?
static inline sector_t bdev_nr_sects(struct block_device *bdev)
{
return part_nr_sects_read(bdev->bd_part);
}
Thanks,
Bart.
next prev parent reply other threads:[~2019-06-17 15:47 UTC|newest]
Thread overview: 16+ 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 ` [PATCH V2 1/7] block: add a helper function " Chaitanya Kulkarni
2019-06-17 15:47 ` Bart Van Assche [this message]
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 ` [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 ` [PATCH V2 5/7] bcache: update cached_dev_init() " Chaitanya Kulkarni
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 ` [PATCH V2 7/7] blktrace: use helper in blk_trace_setup_lba() 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 16:57 ` Chaitanya Kulkarni
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=67bcc55e-a674-7a71-7ce3-3a6745977740@acm.org \
--to=bvanassche@acm.org \
--cc=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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox