From patchwork Wed Dec 11 08:54:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13903172 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7A141EC4D9 for ; Wed, 11 Dec 2024 08:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733907448; cv=none; b=kjP2T9xINW+ZVj/v2sAg53zf2MOIQEjso3RkDp3vHOyEXP58BrGO3n9gGvgl2xV6e3FPviqGJU5hCNjCdD2+NhGZHh3++XKiSvygmzPedGuIegog685sminsElAKDS7Z/wcUbBoS4xODPSNjJ7y62MEdnqY1zPIe1ANs6u/w3ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733907448; c=relaxed/simple; bh=nFZMqGZDJ+xThLDFqB18AkpdYRuBy1M63H8E5QOLuoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mit/DwEMciKMMIJa6owt239Rc4su7w/Cows332PkckJzxWLEkoOt/fMZ7jC/TpsdOCSAvxhh0/Xl8kFXjg6JFgwHh4witDElByTY411+6ZEOHnFCppEtE8OMM88TOsq+Z4n7PJkif09U8sdB85F3mNRQWCTcmPT0VvmBrafb3HY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=poakpVIB; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="poakpVIB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=9ih1glqesyg3jRYW/PDCHgxp9N6qNLEGj5Hx5ALFNVc=; b=poakpVIBHVcejk3du3wSFrZYRA G58RaD/QkVctFkJtvoSY4o97lnXlYILXC9pqwVYDRSCr2ygnTC0SepBSSblT5ILMIbx+TNKNUaOIp bo+2Eoa75JcnobrqQumBtRN2Hbi6Ce3OnvJbnbc+F+Ww2AbddNONKiPyQBnZ0PvOHjoy1KhuJvGMw Za6aETfXjC7YhhLT0EibCgdEEyV2g/eB3WR1H0bW88D5Zv1qyGSbawzf7MNrQ7W6m9mvaX11Th2yR InzQ6mujnRjJGHFZ6eF5kAwReQbprkpO1JoPbEmOBk0fGtaz7Dz91MaMLu68STPykiY5OLnMaQ53/ R4101o4w==; Received: from [2001:4bb8:2ae:8817:935:3eb8:759c:c417] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tLIX8-0000000EJBj-02Ep; Wed, 11 Dec 2024 08:57:26 +0000 From: Christoph Hellwig To: Carlos Maiolino Cc: "Darrick J. Wong" , Hans Holmberg , linux-xfs@vger.kernel.org Subject: [PATCH 18/43] xfs: export zoned geometry via XFS_FSOP_GEOM Date: Wed, 11 Dec 2024 09:54:43 +0100 Message-ID: <20241211085636.1380516-19-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241211085636.1380516-1-hch@lst.de> References: <20241211085636.1380516-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Export the zoned geometry information so that userspace can query it. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_fs.h | 5 ++++- fs/xfs/libxfs/xfs_sb.c | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 2c3171262b44..5e66fb2b2cc7 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -189,7 +189,9 @@ struct xfs_fsop_geom { uint32_t checked; /* o: checked fs & rt metadata */ __u32 rgextents; /* rt extents in a realtime group */ __u32 rgcount; /* number of realtime groups */ - __u64 reserved[16]; /* reserved space */ + __u64 rtstart; /* start of internal rt section */ + __u64 rtreserved; /* RT (zoned) reserved blocks */ + __u64 reserved[14]; /* reserved space */ }; #define XFS_FSOP_GEOM_SICK_COUNTERS (1 << 0) /* summary counters */ @@ -247,6 +249,7 @@ typedef struct xfs_fsop_resblks { #define XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE (1 << 24) /* exchange range */ #define XFS_FSOP_GEOM_FLAGS_PARENT (1 << 25) /* linux parent pointers */ #define XFS_FSOP_GEOM_FLAGS_METADIR (1 << 26) /* metadata directories */ +#define XFS_FSOP_GEOM_FLAGS_ZONED (1 << 27) /* zoned rt device */ /* * Minimum and maximum sizes need for growth checks. diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 20b8318d4a59..6fc21c0a332b 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -1541,6 +1541,8 @@ xfs_fs_geometry( geo->flags |= XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE; if (xfs_has_metadir(mp)) geo->flags |= XFS_FSOP_GEOM_FLAGS_METADIR; + if (xfs_has_zoned(mp)) + geo->flags |= XFS_FSOP_GEOM_FLAGS_ZONED; geo->rtsectsize = sbp->sb_blocksize; geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp); @@ -1561,6 +1563,10 @@ xfs_fs_geometry( geo->rgcount = sbp->sb_rgcount; geo->rgextents = sbp->sb_rgextents; } + if (xfs_has_zoned(mp)) { + geo->rtstart = XFS_FSB_TO_BB(mp, sbp->sb_rtstart); + geo->rtreserved = sbp->sb_rtreserved; + } } /* Read a secondary superblock. */