linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH] libzoned: use blk_zone_v2 and blk_zone_report_v2 by default
Date: Mon, 28 Dec 2020 12:00:11 -0800	[thread overview]
Message-ID: <20201228200011.2435042-1-jaegeuk@kernel.org> (raw)

Old blk_zone and blk_zone_report should be compatible with v2.
And, old blk_zone_report uses reserved[4] which breaks the build.

struct blk_zone_report {
	__u64		sector;
	__u32		nr_zones;
	__u8		reserved[4];
	struct blk_zone zones[0];
};

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 include/f2fs_fs.h | 49 +++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index ccf1e2b7a548..a51a35998ffb 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -1358,6 +1358,30 @@ static inline int get_inline_xattr_addrs(struct f2fs_inode *inode)
 
 #ifdef HAVE_LINUX_BLKZONED_H
 
+/* Let's just use v2, since v1 should be compatible with v2 */
+#define BLK_ZONE_REP_CAPACITY   (1 << 0)
+struct blk_zone_v2 {
+	__u64   start;          /* Zone start sector */
+	__u64   len;            /* Zone length in number of sectors */
+	__u64   wp;             /* Zone write pointer position */
+	__u8    type;           /* Zone type */
+	__u8    cond;           /* Zone condition */
+	__u8    non_seq;        /* Non-sequential write resources active */
+	__u8    reset;          /* Reset write pointer recommended */
+	__u8    resv[4];
+	__u64   capacity;       /* Zone capacity in number of sectors */
+	__u8    reserved[24];
+};
+#define blk_zone blk_zone_v2
+
+struct blk_zone_report_v2 {
+	__u64   sector;
+	__u32   nr_zones;
+	__u32   flags;
+	struct blk_zone zones[0];
+};
+#define blk_zone_report blk_zone_report_v2
+
 #define blk_zone_type(z)        (z)->type
 #define blk_zone_conv(z)	((z)->type == BLK_ZONE_TYPE_CONVENTIONAL)
 #define blk_zone_seq_req(z)	((z)->type == BLK_ZONE_TYPE_SEQWRITE_REQ)
@@ -1407,31 +1431,6 @@ blk_zone_cond_str(struct blk_zone *blkz)
 /*
  * Handle kernel zone capacity support
  */
-#ifdef HAVE_BLK_ZONE_REP_V2
-#define BLK_ZONE_REP_CAPACITY   (1 << 0)
-struct blk_zone_v2 {
-	__u64   start;          /* Zone start sector */
-	__u64   len;            /* Zone length in number of sectors */
-	__u64   wp;             /* Zone write pointer position */
-	__u8    type;           /* Zone type */
-	__u8    cond;           /* Zone condition */
-	__u8    non_seq;        /* Non-sequential write resources active */
-	__u8    reset;          /* Reset write pointer recommended */
-	__u8    resv[4];
-	__u64   capacity;       /* Zone capacity in number of sectors */
-	__u8    reserved[24];
-};
-#define blk_zone blk_zone_v2
-
-struct blk_zone_report_v2 {
-	__u64   sector;
-	__u32   nr_zones;
-	__u32   flags;
-struct blk_zone zones[0];
-};
-#define blk_zone_report blk_zone_report_v2
-#endif /* HAVE_BLK_ZONE_REP_V2 */
-
 #define blk_zone_empty(z)	(blk_zone_cond(z) == BLK_ZONE_COND_EMPTY)
 #define blk_zone_sector(z)	(z)->start
 #define blk_zone_length(z)	(z)->len
-- 
2.29.2.729.g45daf8777d-goog



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

                 reply	other threads:[~2020-12-28 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20201228200011.2435042-1-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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).