From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:19250 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754386AbcKEA2W (ORCPT ); Fri, 4 Nov 2016 20:28:22 -0400 Subject: [PATCH 35/39] xfs: query the per-AG reservation counters From: "Darrick J. Wong" Date: Fri, 04 Nov 2016 17:28:19 -0700 Message-ID: <147830569976.4165.6437344899663566177.stgit@birch.djwong.org> In-Reply-To: <147830546754.4165.17790362300876898017.stgit@birch.djwong.org> References: <147830546754.4165.17790362300876898017.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Establish an ioctl for userspace to query the original and current per-AG reservation counts. This will be used by xfs_scrub to check that the vfs counters are at least somewhat sane. Signed-off-by: Darrick J. Wong --- libxfs/xfs_fs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index c2275b1..deebb57 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -632,6 +632,15 @@ struct xfs_scrub_metadata { #define XFS_SCRUB_FLAGS_ALL (XFS_SCRUB_FLAGS_IN | XFS_SCRUB_FLAGS_OUT) /* + * AG reserved block counters + */ +struct xfs_fsop_ag_resblks { + __u64 resblks; /* blocks reserved now */ + __u64 resblks_orig; /* blocks reserved at mount time */ + __u64 reserved[2]; +}; + +/* * ioctl limits */ #ifdef XATTR_LIST_MAX @@ -705,6 +714,7 @@ struct xfs_scrub_metadata { #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) #define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom) #define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) +#define XFS_IOC_GET_AG_RESBLKS _IOR ('X', 126, struct xfs_fsop_ag_resblks) /* XFS_IOC_GETFSUUID ---------- deprecated 140 */ /* reflink ioctls; these MUST match the btrfs ioctl definitions */