[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dfb3bb5d-404c-90d9-5fa5-ee62639057bf@samsung.com>
Date: Tue, 16 Aug 2022 10:02:29 +0200
From: Pankaj Raghav <p.raghav@...sung.com>
To: Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
<snitzer@...nel.org>, <axboe@...nel.dk>, <hch@....de>,
<agk@...hat.com>
CC: <linux-block@...r.kernel.org>, <Johannes.Thumshirn@....com>,
<bvanassche@....org>, <matias.bjorling@....com>, <hare@...e.de>,
<gost.dev@...sung.com>, <linux-nvme@...ts.infradead.org>,
<jaegeuk@...nel.org>, <pankydev8@...il.com>,
<linux-kernel@...r.kernel.org>, <dm-devel@...hat.com>,
Damien Le Moal <damien.lemoal@....com>,
Joel Granados <j.granados@...sung.com>
Subject: Re: [PATCH v10 13/13] dm: add power-of-2 target for zoned devices
with non power-of-2 zone sizes
>
> I think this is way better. But I would still reorganize this like this:
>
> static int dm_po2z_map(struct dm_target *ti, struct bio *bio)
> {
> struct dm_po2z_target *dmh = ti->private;
> int split_io_pos;
>
> bio_set_dev(bio, dmh->dev->bdev);
>
> if (op_is_zone_mgmt(bio_op(bio)))
> return dm_po2z_remap_sector(dmh, bio);
>
> if (!bio_sectors(bio))
> return DM_MAPIO_REMAPPED;
>
> /*
> * Read operation on the emulated zone area (between zone capacity
> * and zone size) will fill the bio with zeroes. Any other operation
> * in the emulated area should return an error.
> */
> if (!bio_in_emulated_zone_area(dmh, bio, &split_io_pos))
> return dm_po2z_remap_sector(dmh, bio);
>
> if (bio_op(bio) == REQ_OP_READ) {
> if (split_io_pos > 0) {
> dm_accept_partial_bio(bio, split_io_pos);
> return dm_po2z_remap_sector(dmh, bio);
> }
> return dm_po2z_read_zeroes(bio);
> }
>
> return DM_MAPIO_KILL;
> }
>
> I find the code easier to follow this way.
>
I agree. It is definitely easier to follow. I will make these changes
and send the next version soon.
>
>
Powered by blists - more mailing lists