linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: "p.raghav@samsung.com" <p.raghav@samsung.com>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Cc: "javier.gonz@samsung.com" <javier.gonz@samsung.com>,
	"mcgrof@kernel.org" <mcgrof@kernel.org>,
	"pankydev8@gmail.com" <pankydev8@gmail.com>
Subject: Re: [f2fs-dev] [PATCH 2/3] libf2fs: add support to report zone size
Date: Tue, 12 Apr 2022 12:14:13 +0000	[thread overview]
Message-ID: <aa4133c915f61811b40cd11a738bdb18859fe3c0.camel@wdc.com> (raw)
In-Reply-To: <20220412112745.44108-3-p.raghav@samsung.com>

On Tue, 2022-04-12 at 13:27 +0200, Pankaj Raghav wrote:
> From: Luis Chamberlain <mcgrof@kernel.org>
> 
> Expand get_device_info() to report the zone size.
> This is now important give power of 2 zone sizees (PO2)

s/give/given that
s/sizees/size

> can exist, and so can non power of 2 zones sizes (NPO2),

No they cannot, not yet in Linux.

> and we should be aware of the differences in terms of
> support.
> 
> This will be used more in subsequent patch.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>  include/f2fs_fs.h   | 1 +
>  lib/libf2fs.c       | 5 +++--
>  lib/libf2fs_zoned.c | 5 +++--
>  3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
> index d236437..83c5b33 100644
> --- a/include/f2fs_fs.h
> +++ b/include/f2fs_fs.h
> @@ -386,6 +386,7 @@ struct device_info {
>  	u_int32_t nr_zones;
>  	u_int32_t nr_rnd_zones;
>  	size_t zone_blocks;
> +	uint64_t zone_size;
>  	size_t *zone_cap_blocks;
>  };
>  
> diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> index 420dfda..8fad1d7 100644
> --- a/lib/libf2fs.c
> +++ b/lib/libf2fs.c
> @@ -1055,8 +1055,9 @@ int get_device_info(int i)
>  		MSG(0, "Info: Host-%s zoned block device:\n",
>  				(dev->zoned_model == F2FS_ZONED_HA) ?
>  					"aware" : "managed");
> -		MSG(0, "      %u zones, %u randomly writeable zones\n",
> -				dev->nr_zones, dev->nr_rnd_zones);
> +		MSG(0, "      %u zones, %lu zone size: %u randomly writeable zones\n",

No unit mentioned for zone size in the message.

> +				dev->nr_zones, dev->zone_size,
> +				dev->nr_rnd_zones);
>  		MSG(0, "      %lu blocks per zone\n",
>  				dev->zone_blocks);
>  	}
> diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c
> index 1447181..0acae88 100644
> --- a/lib/libf2fs_zoned.c
> +++ b/lib/libf2fs_zoned.c
> @@ -189,8 +189,9 @@ int f2fs_get_zone_blocks(int i)
>  	if (!sectors)
>  		return -1;
>  
> -	dev->zone_blocks = sectors >> (F2FS_BLKSIZE_BITS - 9);
> -	sectors = (sectors << 9) / c.sector_size;
> +	dev->zone_size = sectors << SECTOR_SHIFT;
> +	dev->zone_blocks = sectors >> (F2FS_BLKSIZE_BITS - SECTOR_SHIFT);
> +	sectors = dev->zone_size / c.sector_size;
>  
>  	/*
>  	 * Total number of zones: there may

Overall, I really do not see the point of this patch.

-- 
Damien Le Moal
Western Digital Research


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2022-04-12 12:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220412112746eucas1p14f52961641ef07fdc7274e75887da9ad@eucas1p1.samsung.com>
2022-04-12 11:27 ` [f2fs-dev] [PATCH 0/3] f2fs-tools: return error for zoned devices with non power-of-2 zone size Pankaj Raghav
     [not found]   ` <CGME20220412112747eucas1p11e2747339407a5c51a93e7b7060ab965@eucas1p1.samsung.com>
2022-04-12 11:27     ` [f2fs-dev] [PATCH 1/3] libf2fs_zoned: factor out helper to get chunk sectors Pankaj Raghav
2022-04-12 12:17       ` Damien Le Moal via Linux-f2fs-devel
     [not found]   ` <CGME20220412112748eucas1p19a9e013fa04d5a82abd5364604a8ad31@eucas1p1.samsung.com>
2022-04-12 11:27     ` [f2fs-dev] [PATCH 2/3] libf2fs: add support to report zone size Pankaj Raghav
2022-04-12 12:14       ` Damien Le Moal via Linux-f2fs-devel [this message]
2022-04-12 16:23         ` Luis Chamberlain
2022-04-13  1:03           ` Damien Le Moal via Linux-f2fs-devel
     [not found]   ` <CGME20220412112749eucas1p28b82e6b3b563f2e25c78f479c1192451@eucas1p2.samsung.com>
2022-04-12 11:27     ` [f2fs-dev] [PATCH 3/3] libf2fs: don't allow mkfs / fsck on zoned NPO2 Pankaj Raghav
2022-04-12 12:16       ` Damien Le Moal via Linux-f2fs-devel
2022-04-12 15:30         ` Pankaj Raghav
2022-04-12 16:33   ` [f2fs-dev] [PATCH 0/3] f2fs-tools: return error for zoned devices with non power-of-2 zone size Jaegeuk Kim
2022-04-13 11:14     ` Pankaj Raghav
2022-04-13 16:22       ` Jaegeuk Kim
2022-04-13 17:53         ` Pankaj Raghav

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=aa4133c915f61811b40cd11a738bdb18859fe3c0.camel@wdc.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=Damien.LeMoal@wdc.com \
    --cc=javier.gonz@samsung.com \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=pankydev8@gmail.com \
    /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).