From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Pankaj Raghav <p.raghav@samsung.com>,
hch@lst.de, axboe@kernel.dk, snitzer@kernel.org,
Johannes.Thumshirn@wdc.com
Cc: matias.bjorling@wdc.com, gost.dev@samsung.com,
linux-kernel@vger.kernel.org, hare@suse.de,
linux-block@vger.kernel.org, pankydev8@gmail.com,
bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com,
linux-nvme@lists.infradead.org,
Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH v8 06/11] zonefs: allow non power of 2 zoned devices
Date: Thu, 28 Jul 2022 12:16:12 +0900 [thread overview]
Message-ID: <cf96b0e4-dbb1-350b-602b-a72682fca2fb@opensource.wdc.com> (raw)
In-Reply-To: <20220727162245.209794-7-p.raghav@samsung.com>
On 7/28/22 01:22, Pankaj Raghav wrote:
> The zone size shift variable is useful only if the zone sizes are known
> to be power of 2. Remove that variable and use generic helpers from
> block layer to calculate zone index in zonefs.
>
> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> ---
> fs/zonefs/super.c | 6 ++----
> fs/zonefs/zonefs.h | 1 -
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 860f0b1032c6..e549ef16738c 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -476,10 +476,9 @@ static void __zonefs_io_error(struct inode *inode, bool write)
> {
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct super_block *sb = inode->i_sb;
> - struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
> unsigned int noio_flag;
> unsigned int nr_zones =
> - zi->i_zone_size >> (sbi->s_zone_sectors_shift + SECTOR_SHIFT);
> + bdev_zone_no(sb->s_bdev, zi->i_zone_size >> SECTOR_SHIFT);
> struct zonefs_ioerr_data err = {
> .inode = inode,
> .write = write,
> @@ -1401,7 +1400,7 @@ static int zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> int ret = 0;
>
> - inode->i_ino = zone->start >> sbi->s_zone_sectors_shift;
> + inode->i_ino = bdev_zone_no(sb->s_bdev, zone->start);
> inode->i_mode = S_IFREG | sbi->s_perm;
>
> zi->i_ztype = type;
> @@ -1776,7 +1775,6 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent)
> * interface constraints.
> */
> sb_set_blocksize(sb, bdev_zone_write_granularity(sb->s_bdev));
> - sbi->s_zone_sectors_shift = ilog2(bdev_zone_sectors(sb->s_bdev));
> sbi->s_uid = GLOBAL_ROOT_UID;
> sbi->s_gid = GLOBAL_ROOT_GID;
> sbi->s_perm = 0640;
> diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h
> index 4b3de66c3233..39895195cda6 100644
> --- a/fs/zonefs/zonefs.h
> +++ b/fs/zonefs/zonefs.h
> @@ -177,7 +177,6 @@ struct zonefs_sb_info {
> kgid_t s_gid;
> umode_t s_perm;
> uuid_t s_uuid;
> - unsigned int s_zone_sectors_shift;
>
> unsigned int s_nr_files[ZONEFS_ZTYPE_MAX];
>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-07-28 3:16 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220727162246eucas1p1a758799f13d36ba99d30bf92cc5e2754@eucas1p1.samsung.com>
2022-07-27 16:22 ` [PATCH v8 00/11] support non power of 2 zoned device Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 01/11] block: make bdev_nr_zones and disk_zone_no generic for npo2 zsze Pankaj Raghav
2022-07-28 2:54 ` Damien Le Moal
2022-07-27 16:22 ` [PATCH v8 02/11] block: allow blk-zoned devices to have non-power-of-2 zone size Pankaj Raghav
2022-07-27 23:16 ` Bart Van Assche
2022-07-28 12:11 ` Pankaj Raghav
2022-07-28 13:29 ` Bart Van Assche
2022-07-29 9:09 ` Pankaj Raghav
2022-07-28 3:07 ` Damien Le Moal
2022-07-28 12:24 ` Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 03/11] nvme: zns: Allow ZNS drives that have non-power_of_2 " Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 04/11] nvmet: Allow ZNS target to support non-power_of_2 zone sizes Pankaj Raghav
2022-07-28 3:09 ` Damien Le Moal
2022-07-29 7:45 ` Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 05/11] null_blk: allow non power of 2 zoned devices Pankaj Raghav
2022-07-27 21:59 ` Chaitanya Kulkarni
2022-07-29 7:51 ` Pankaj Raghav
2022-07-28 3:14 ` Damien Le Moal
2022-07-27 16:22 ` [PATCH v8 06/11] zonefs: " Pankaj Raghav
2022-07-28 3:16 ` Damien Le Moal [this message]
2022-07-27 16:22 ` [PATCH v8 07/11] dm-zoned: ensure only power of 2 zone sizes are allowed Pankaj Raghav
2022-07-28 3:18 ` Damien Le Moal
2022-07-28 12:15 ` David Sterba
2022-07-29 8:00 ` Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 08/11] dm-zone: use generic helpers to calculate offset from zone start Pankaj Raghav
2022-07-28 3:20 ` Damien Le Moal
2022-07-27 16:22 ` [PATCH v8 09/11] dm-table: allow non po2 zoned devices Pankaj Raghav
2022-07-28 3:22 ` Damien Le Moal
2022-07-27 16:22 ` [PATCH v8 10/11] dm: call dm_zone_endio after the target endio callback for " Pankaj Raghav
2022-07-28 3:25 ` Damien Le Moal
2022-07-29 8:48 ` Pankaj Raghav
2022-07-27 16:22 ` [PATCH v8 11/11] dm: add power-of-2 zoned target for non-power-of-2 " Pankaj Raghav
2022-07-28 4:33 ` Damien Le Moal
2022-08-01 8:35 ` Pankaj Raghav
2022-07-27 23:19 ` [PATCH v8 00/11] support non power of 2 zoned device Bart Van Assche
2022-07-28 1:52 ` Damien Le Moal
2022-07-28 2:58 ` Bart Van Assche
2022-07-28 3:28 ` Damien Le Moal
2022-07-28 11:57 ` Pankaj Raghav
2022-07-28 13:30 ` Bart Van Assche
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=cf96b0e4-dbb1-350b-602b-a72682fca2fb@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dm-devel@redhat.com \
--cc=gost.dev@samsung.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jaegeuk@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=matias.bjorling@wdc.com \
--cc=mcgrof@kernel.org \
--cc=p.raghav@samsung.com \
--cc=pankydev8@gmail.com \
--cc=snitzer@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