Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2343637imm; Thu, 9 Aug 2018 11:12:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw3SVPuUxY8R3AdTorq5tE4vpDcTVpOMZ3g7+6HS7XG6aMmsQcWgBUVtzlgH/gOGgwOd4M9 X-Received: by 2002:a63:8548:: with SMTP id u69-v6mr3159079pgd.346.1533838355533; Thu, 09 Aug 2018 11:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533838355; cv=none; d=google.com; s=arc-20160816; b=dwr2hHCakTq4ty6VkfWK7rNH6Vt7NC4jsCaxIBnv3p8KYjGLidsG7baAeu1taTmGqW c1jf6T8M0QpicJoFDkT8SAJW4E8/XlqvJWmutN+/8YU4pl3zG7+vuHHsaSGsNmCAkjdD M0yo1nRdOqmyP9S4r8JjmGxhIfZzg0gSN9uxdUgrfdd3oxDTaDWmPhZ0sph2uqLqdboa 3cPc/r3LhblRW8yI9NTMU1kCBh/cWpiwAVKC0h0HApZ/8eyVvVxh93LsT6P8tyrApgZR KgHYsXeuTFWEDxmIb3GxB7Sa563WCDtpzlhv389giaLnGKlFuWNNiCtpCjQlA65OY0v5 j3Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=kM+SE/GanJfI/Ih58/7lkGHceeH98C7iNNYae6MdgJg=; b=IbqRUYxSpyBOUfcD9PhoQTz5QP0HoEGxdfubCTQ34l86aBT22f+li0c70WhktTrX5X +UwNrQlcvErrqRE0Oj+gcZnfh+Z5FM/uMJgO2j5dQFaCC5/bM5EXZNpYSSsfW+djC2op QGNN7kZWii927DwvtANgIeBLLuKg4FF/0JJiG+tZRoWAzUese1+5psz3Fdlx8J61+GtI Hk32IUHSZUuIUQnN2f8B/uXT1neOyYkz8ljk0ILQIcy1IowwMBDArs+qpFK2lG5MMh3o FSeg517RXjv8/10rKHYL91Psx7rkq83wxCiWiAH/LcOaqd3nWMkOvd288RWnaJDf0Pyp wpRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Z1XIe6n1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si7678367pgk.135.2018.08.09.11.12.20; Thu, 09 Aug 2018 11:12:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Z1XIe6n1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbeHIUhR (ORCPT + 99 others); Thu, 9 Aug 2018 16:37:17 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:43089 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbeHIUhQ (ORCPT ); Thu, 9 Aug 2018 16:37:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id x6-v6so2870909plv.10; Thu, 09 Aug 2018 11:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kM+SE/GanJfI/Ih58/7lkGHceeH98C7iNNYae6MdgJg=; b=Z1XIe6n1fc4wP/Mgd54n7clah+FZowPBAoU/23bYMsdQiiKBNILFO7kkkSbPwopHo4 T8a4MSKnbIR4t62E8VGtUnucT2QekgMElMxjfkRk2qADp5H1dj2JjbqVWdPWiTPolUL2 tMlOSLACPs5xMDNX+ul21b5CyURDb4rJygSPVsioGbKBr9T411/z7eHLg5Z2CU9rFqf1 6tQKRfPe2M5af8wx1anfVH6Xjzr/w1LHApwgOl9s7HR7KzD0I1twE6EMEdbHrbp2PcTh Z6GKMW9L8wzqh4EJi4oLDtVWG5bzS0uTC7AwHZmD2EiSk4GAfFzftsUdjtUt4sKKkjkS OrBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kM+SE/GanJfI/Ih58/7lkGHceeH98C7iNNYae6MdgJg=; b=h9gXxOeQHML9S+JBoxcILqMR8waiQq8bUkRjGILnOPCKwgQJhLay3EiaSJmciX3MwB cbEPgJseweKRoiyYf5NJAvHxOEhPhwbYZPQ3hn4iirGR2ZBNKUzcTBfjQb978TxFQepF zcsshu4QL5pf3BVUQy0TV5FSWQHqQ2eNNFKu6mIflREufINUKau0JF4I1Iw2mokrBsu+ H6+/A5yu2l5gg1ICgPddYNjGN+hansQAnSTTUfuOhsOn8f7GpoEqXypHGgO5AWkT/xhq SVYWf88/a+gSF9Bww6QrsSwhXFFF5r9zHx6CppiMEIVvsr5KJzZsI1MadFWIcg3ErOi/ aZSA== X-Gm-Message-State: AOUpUlFFeFPpBjQug5ybOHsmtAG6UjnoOVfo7ditw7uxNoqo0GfhTSPy aIWYvuPoFt8Rqplx1K2+Kjk= X-Received: by 2002:a17:902:8482:: with SMTP id c2-v6mr3012007plo.45.1533838275970; Thu, 09 Aug 2018 11:11:15 -0700 (PDT) Received: from localhost (h101-111-148-072.catv02.itscom.jp. [101.111.148.72]) by smtp.gmail.com with ESMTPSA id w70-v6sm13850086pgd.18.2018.08.09.11.11.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 11:11:15 -0700 (PDT) From: Naohiro Aota To: David Sterba , linux-btrfs@vger.kernel.org Cc: Chris Mason , Josef Bacik , linux-kernel@vger.kernel.org, Hannes Reinecke , Damien Le Moal , Bart Van Assche , Matias Bjorling , Naohiro Aota Subject: [RFC PATCH 03/12] btrfs-progs: add new HMZONED feature flag Date: Fri, 10 Aug 2018 03:10:56 +0900 Message-Id: <20180809181105.12856-3-naota@elisp.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809181105.12856-1-naota@elisp.net> References: <20180809180450.5091-1-naota@elisp.net> <20180809181105.12856-1-naota@elisp.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With this feature enabled, a zoned block device aware btrfs allocates block groups aligned to the device zones and always write in sequential zones at the zone write pointer position. Enabling this feature also force disable conversion from ext4 volumes. Note: this flag can be moved to COMPAT_RO, so that older kernel can read but not write zoned block devices formatted with btrfs. Signed-off-by: Naohiro Aota --- cmds-inspect-dump-super.c | 3 ++- ctree.h | 4 +++- fsfeatures.c | 8 ++++++++ fsfeatures.h | 2 +- libbtrfsutil/btrfs.h | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index e965267c..4e365ead 100644 --- a/cmds-inspect-dump-super.c +++ b/cmds-inspect-dump-super.c @@ -228,7 +228,8 @@ static struct readable_flag_entry incompat_flags_array[] = { DEF_INCOMPAT_FLAG_ENTRY(EXTENDED_IREF), DEF_INCOMPAT_FLAG_ENTRY(RAID56), DEF_INCOMPAT_FLAG_ENTRY(SKINNY_METADATA), - DEF_INCOMPAT_FLAG_ENTRY(NO_HOLES) + DEF_INCOMPAT_FLAG_ENTRY(NO_HOLES), + DEF_INCOMPAT_FLAG_ENTRY(HMZONED) }; static const int incompat_flags_num = sizeof(incompat_flags_array) / sizeof(struct readable_flag_entry); diff --git a/ctree.h b/ctree.h index 4719962d..6d805ecd 100644 --- a/ctree.h +++ b/ctree.h @@ -489,6 +489,7 @@ struct btrfs_super_block { #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) +#define BTRFS_FEATURE_INCOMPAT_HMZONED (1ULL << 10) #define BTRFS_FEATURE_COMPAT_SUPP 0ULL @@ -509,7 +510,8 @@ struct btrfs_super_block { BTRFS_FEATURE_INCOMPAT_RAID56 | \ BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS | \ BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | \ - BTRFS_FEATURE_INCOMPAT_NO_HOLES) + BTRFS_FEATURE_INCOMPAT_NO_HOLES | \ + BTRFS_FEATURE_INCOMPAT_HMZONED) /* * A leaf is full of items. offset and size tell us where to find diff --git a/fsfeatures.c b/fsfeatures.c index 7d85d60f..53396dd4 100644 --- a/fsfeatures.c +++ b/fsfeatures.c @@ -86,6 +86,14 @@ static const struct btrfs_fs_feature { VERSION_TO_STRING2(4,0), NULL, 0, "no explicit hole extents for files" }, +#ifdef BTRFS_ZONED + { "hmzoned", BTRFS_FEATURE_INCOMPAT_HMZONED, + "hmzoned", + NULL, 0, + NULL, 0, + NULL, 0, + "support Host-Managed Zoned devices" }, +#endif /* Keep this one last */ { "list-all", BTRFS_FEATURE_LIST_ALL, NULL } }; diff --git a/fsfeatures.h b/fsfeatures.h index 3cc9452a..0918ee1a 100644 --- a/fsfeatures.h +++ b/fsfeatures.h @@ -25,7 +25,7 @@ | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) /* - * Avoid multi-device features (RAID56) and mixed block groups + * Avoid multi-device features (RAID56), mixed block groups, and hmzoned device */ #define BTRFS_CONVERT_ALLOWED_FEATURES \ (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF \ diff --git a/libbtrfsutil/btrfs.h b/libbtrfsutil/btrfs.h index c293f6bf..c6a60fbc 100644 --- a/libbtrfsutil/btrfs.h +++ b/libbtrfsutil/btrfs.h @@ -268,6 +268,7 @@ struct btrfs_ioctl_fs_info_args { #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) +#define BTRFS_FEATURE_INCOMPAT_HMZONED (1ULL << 10) struct btrfs_ioctl_feature_flags { __u64 compat_flags; -- 2.18.0