From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
"dennis@kernel.org" <dennis@kernel.org>,
"hare@suse.com" <hare@suse.com>,
"sagi@grimberg.me" <sagi@grimberg.me>,
"dennisszhou@gmail.com" <dennisszhou@gmail.com>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"osandov@fb.com" <osandov@fb.com>,
"ming.lei@redhat.com" <ming.lei@redhat.com>,
"tj@kernel.org" <tj@kernel.org>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH 2/4] blk-zoned: implement REQ_OP_ZONE_RESET_ALL
Date: Thu, 1 Aug 2019 08:40:00 +0000 [thread overview]
Message-ID: <BYAPR04MB58166CF08BEE9427361B30A4E7DE0@BYAPR04MB5816.namprd04.prod.outlook.com> (raw)
In-Reply-To: BYAPR04MB5749C69F6D0A1321DD21B5CD86DE0@BYAPR04MB5749.namprd04.prod.outlook.com
On 2019/08/01 13:51, Chaitanya Kulkarni wrote:>>> +/*
>>> + * Special case of zone reset operation to reset all zones in one command,
>>> + * useful for applications like mkfs.
>>> + */
>>> +static int __blkdev_reset_all_zones(struct block_device *bdev, gfp_t gfp_mask)
>>> +{
>>> + struct bio *bio = NULL;
>>
>> There is no need to initialize the bio to NULL here.
>
> [CK] Would you prefer something like following that declares and allocate in
> one line which is similar in blk-lib.c:-blk_next_bio() function ? or we
> should keep declaration and allocation on the different line :-
Whichever is fine with me.
> /*
> * Special case of zone reset operation to reset all zones in one command,
> * useful for applications like mkfs.
> */
> static int __blkdev_reset_all_zones(struct block_device *bdev, gfp_t gfp_mask)
> {
> struct bio *bio = bio_alloc(gfp_mask, 0);
> int ret;
>
> /* across the zones operations, don't need any sectors */
May be change this comment to something less cryptic, e.g.:
/* For REQ_OP_ZONE_RESET_ALL, BIO sector and size are not needed */
> bio_set_dev(bio, bdev);
> bio_set_op_attrs(bio, REQ_OP_ZONE_RESET_ALL, 0);
>
> ret = submit_bio_wait(bio);
> bio_put(bio);
>
> return ret;
> }
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2019-08-01 8:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 21:00 [PATCH 0/4] block: introduce REQ_OP_ZONE_RESET_ALL Chaitanya Kulkarni
2019-07-31 21:00 ` [PATCH 1/4] block: add req op to reset all zones and flag Chaitanya Kulkarni
2019-08-01 0:53 ` Damien Le Moal
2019-07-31 21:01 ` [PATCH 2/4] blk-zoned: implement REQ_OP_ZONE_RESET_ALL Chaitanya Kulkarni
2019-08-01 0:55 ` Damien Le Moal
2019-08-01 4:51 ` Chaitanya Kulkarni
2019-08-01 8:40 ` Damien Le Moal [this message]
2019-07-31 21:01 ` [PATCH 3/4] scsi: " Chaitanya Kulkarni
2019-08-01 1:00 ` Damien Le Moal
2019-07-31 21:01 ` [PATCH 4/4] null_blk: " Chaitanya Kulkarni
2019-08-01 1:03 ` Damien Le Moal
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=BYAPR04MB58166CF08BEE9427361B30A4E7DE0@BYAPR04MB5816.namprd04.prod.outlook.com \
--to=damien.lemoal@wdc.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dennis@kernel.org \
--cc=dennisszhou@gmail.com \
--cc=hare@suse.com \
--cc=jejb@linux.ibm.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
--cc=sagi@grimberg.me \
--cc=tj@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;
as well as URLs for NNTP newsgroup(s).