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-scsi@vger.kernel.org, linux-btrace@vger.kernel.org,
kent.overstreet@gmail.com, jaegeuk@kernel.org,
damien.lemoal@wdc.com
Subject: Re: [COMPILE TESTED PATCH 6/8] target/pscsi: use helper in pscsi_get_blocks()
Date: Thu, 13 Jun 2019 15:36:24 +0000 [thread overview]
Message-ID: <ca5092fa-bc1b-08d5-888a-1ed6f909dfef@acm.org> (raw)
In-Reply-To: <20190613145955.4813-7-chaitanya.kulkarni@wdc.com>
On 6/13/19 7:59 AM, Chaitanya Kulkarni wrote:
> This patch updates the pscsi_get_blocks() with newly introduced helper
> function to read the nr_sects from block device's hd_parts with the
> help if part_nr_sects_read() protected by appropriate locking.
>
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> drivers/target/target_core_pscsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
> index c9d92b3e777d..da481edab2de 100644
> --- a/drivers/target/target_core_pscsi.c
> +++ b/drivers/target/target_core_pscsi.c
> @@ -1030,7 +1030,7 @@ static sector_t pscsi_get_blocks(struct se_device *dev)
> struct pscsi_dev_virt *pdv = PSCSI_DEV(dev);
>
> if (pdv->pdv_bd && pdv->pdv_bd->bd_part)
> - return pdv->pdv_bd->bd_part->nr_sects;
> + return bdev_nr_sects(pdv->pdv_bd);
>
> return 0;
> }
As far as I can see bd_part does not change between blkdev_get() and
blkdev_put(). Since the pscsi code guarantees that blkdev_put() is not
called concurrently with pscsi_get_blocks() this patch is not necessary.
Bart.
next prev parent reply other threads:[~2019-06-13 15:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 14:59 [PATCH 0/8] block: use right accessor to read nr_sects Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 1/8] block: add a helper function to read nr_setcs Chaitanya Kulkarni
2019-06-13 15:31 ` Bart Van Assche
2019-06-13 16:07 ` Douglas Gilbert
2019-06-13 16:28 ` James Bottomley
2019-06-13 19:26 ` Douglas Gilbert
2019-06-13 20:29 ` James Bottomley
2019-06-13 16:07 ` Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 2/8] blk-zoned: update blkdev_nr_zones() with helper Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 3/8] blk-zoned: update blkdev_report_zone() " Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 4/8] blk-zoned: update blkdev_reset_zones() " Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 5/8] bcache: update cached_dev_init() " Chaitanya Kulkarni
2019-06-13 14:59 ` [COMPILE TESTED PATCH 6/8] target/pscsi: use helper in pscsi_get_blocks() Chaitanya Kulkarni
2019-06-13 15:36 ` Bart Van Assche [this message]
2019-06-13 16:08 ` Chaitanya Kulkarni
2019-06-13 14:59 ` [COMPILE TESTED PATCH 7/8] f2fs: use helper in init_blkz_info() Chaitanya Kulkarni
2019-06-13 14:59 ` [PATCH 8/8] blktrace: use helper in blk_trace_setup_lba() 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=ca5092fa-bc1b-08d5-888a-1ed6f909dfef@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 \
--cc=linux-scsi@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