From patchwork Thu Feb 16 20:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13143856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD59FC636CC for ; Thu, 16 Feb 2023 20:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbjBPUxD (ORCPT ); Thu, 16 Feb 2023 15:53:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjBPUxD (ORCPT ); Thu, 16 Feb 2023 15:53:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 698122942C for ; Thu, 16 Feb 2023 12:53:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C756660AB9 for ; Thu, 16 Feb 2023 20:53:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 354DAC433EF; Thu, 16 Feb 2023 20:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676580780; bh=20R37CmzS6PYScFU/5eIJUoIYCjkC2btTL/gPACIofY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=jHfPNqCjxKmnI6QZDZhW28vx3wz6+uU1T2Zm55KtDnPKFooPcmydg+MxYBgq1PDOj EEw8Iu3UbCBgtp+a5bLNwv5ftXiO+fk0Ft7HUwl+0rI7uBchjkZsoIFuwJE9WNAu1c Q6yOLXsAEwEPvb2wcM2yBbb91Oo5M+d2R266W95vGXENbpg0Wlp3JCUtRXglDEKbVx d4SqocUppAGfnOJn6eC1SDCelthAYIXXsJum0YWQeoxoUhrDnXv0tSEafEZ8k9lbzF ezkba1nwXmTMVxfu/Juhw1hQjHH+nlxANhMGkk6BfOEwfRpM6HGPfyOYFlW6N6dAwc Yn8Fom2mzEM9Q== Date: Thu, 16 Feb 2023 12:52:59 -0800 Subject: [PATCH 1/3] xfs: rename xfs_pptr_info to xfs_getparents From: "Darrick J. Wong" To: djwong@kernel.org Cc: allison.henderson@oracle.com, linux-xfs@vger.kernel.org Message-ID: <167657876252.3475586.14453439715014094354.stgit@magnolia> In-Reply-To: <167657876236.3475586.14505209064881107848.stgit@magnolia> References: <167657876236.3475586.14505209064881107848.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Rename the head structure of the parent pointer ioctl to match the name of the ioctl (XFS_IOC_GETPARENTS). Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_fs.h | 51 +++++++++++++++++++++++---------------------- fs/xfs/xfs_ioctl.c | 34 +++++++++++++++--------------- fs/xfs/xfs_ondisk.h | 2 +- fs/xfs/xfs_parent_utils.c | 20 +++++++++--------- fs/xfs/xfs_parent_utils.h | 2 +- fs/xfs/xfs_trace.h | 14 ++++++------ 6 files changed, 62 insertions(+), 61 deletions(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index c65345d2ba7a..2a23c010a0a0 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -752,19 +752,20 @@ struct xfs_scrub_metadata { XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED) #define XFS_SCRUB_FLAGS_ALL (XFS_SCRUB_FLAGS_IN | XFS_SCRUB_FLAGS_OUT) -#define XFS_PPTR_MAXNAMELEN 256 +#define XFS_GETPARENTS_MAXNAMELEN 256 /* return parents of the handle, not the open fd */ -#define XFS_PPTR_IFLAG_HANDLE (1U << 0) +#define XFS_GETPARENTS_IFLAG_HANDLE (1U << 0) /* target was the root directory */ -#define XFS_PPTR_OFLAG_ROOT (1U << 1) +#define XFS_GETPARENTS_OFLAG_ROOT (1U << 1) /* Cursor is done iterating pptrs */ -#define XFS_PPTR_OFLAG_DONE (1U << 2) +#define XFS_GETPARENTS_OFLAG_DONE (1U << 2) - #define XFS_PPTR_FLAG_ALL (XFS_PPTR_IFLAG_HANDLE | XFS_PPTR_OFLAG_ROOT | \ - XFS_PPTR_OFLAG_DONE) +#define XFS_GETPARENTS_FLAG_ALL (XFS_GETPARENTS_IFLAG_HANDLE | \ + XFS_GETPARENTS_OFLAG_ROOT | \ + XFS_GETPARENTS_OFLAG_DONE) /* Get an inode parent pointer through ioctl */ struct xfs_parent_ptr { @@ -772,57 +773,57 @@ struct xfs_parent_ptr { __u32 xpp_gen; /* Inode generation */ __u32 xpp_rsvd; /* Reserved */ __u64 xpp_rsvd2; /* Reserved */ - __u8 xpp_name[XFS_PPTR_MAXNAMELEN]; /* File name */ + __u8 xpp_name[XFS_GETPARENTS_MAXNAMELEN]; /* File name */ }; /* Iterate through an inodes parent pointers */ -struct xfs_pptr_info { - /* File handle, if XFS_PPTR_IFLAG_HANDLE is set */ - struct xfs_handle pi_handle; +struct xfs_getparents { + /* File handle, if XFS_GETPARENTS_IFLAG_HANDLE is set */ + struct xfs_handle gp_handle; /* * Structure to track progress in iterating the parent pointers. * Must be initialized to zeroes before the first ioctl call, and * not touched by callers after that. */ - struct xfs_attrlist_cursor pi_cursor; + struct xfs_attrlist_cursor gp_cursor; - /* Operational flags: XFS_PPTR_*FLAG* */ - __u32 pi_flags; + /* Operational flags: XFS_GETPARENTS_*FLAG* */ + __u32 gp_flags; /* Must be set to zero */ - __u32 pi_reserved; + __u32 gp_reserved; /* # of entries in array */ - __u32 pi_ptrs_size; + __u32 gp_ptrs_size; /* # of entries filled in (output) */ - __u32 pi_ptrs_used; + __u32 gp_ptrs_used; /* Must be set to zero */ - __u64 pi_reserved2[6]; + __u64 gp_reserved2[6]; /* * An array of struct xfs_parent_ptr follows the header - * information. Use xfs_ppinfo_to_pp() to access the + * information. Use xfs_getparents_rec() to access the * parent pointer array entries. */ - struct xfs_parent_ptr pi_parents[]; + struct xfs_parent_ptr gp_parents[]; }; static inline size_t -xfs_pptr_info_sizeof(int nr_ptrs) +xfs_getparents_sizeof(int nr_ptrs) { - return sizeof(struct xfs_pptr_info) + + return sizeof(struct xfs_getparents) + (nr_ptrs * sizeof(struct xfs_parent_ptr)); } static inline struct xfs_parent_ptr* -xfs_ppinfo_to_pp( - struct xfs_pptr_info *info, - int idx) +xfs_getparents_rec( + struct xfs_getparents *info, + unsigned int idx) { - return &info->pi_parents[idx]; + return &info->gp_parents[idx]; } /* diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 4c36ddd19dbd..2687e9965310 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1679,12 +1679,12 @@ xfs_ioc_scrub_metadata( /* * IOCTL routine to get the parent pointers of an inode and return it to user - * space. Caller must pass a buffer space containing a struct xfs_pptr_info, + * space. Caller must pass a buffer space containing a struct xfs_getparents, * followed by a region large enough to contain an array of struct - * xfs_parent_ptr of a size specified in pi_ptrs_size. If the inode contains + * xfs_parent_ptr of a size specified in gp_ptrs_size. If the inode contains * more parent pointers than can fit in the buffer space, caller may re-call - * the function using the returned pi_cursor to resume iteration. The - * number of xfs_parent_ptr returned will be stored in pi_ptrs_used. + * the function using the returned gp_cursor to resume iteration. The + * number of xfs_parent_ptr returned will be stored in gp_ptrs_used. * * Returns 0 on success or non-zero on failure */ @@ -1693,7 +1693,7 @@ xfs_ioc_get_parent_pointer( struct file *filp, void __user *arg) { - struct xfs_pptr_info *ppi = NULL; + struct xfs_getparents *ppi = NULL; int error = 0; struct xfs_inode *file_ip = XFS_I(file_inode(filp)); struct xfs_inode *call_ip = file_ip; @@ -1702,42 +1702,42 @@ xfs_ioc_get_parent_pointer( if (!capable(CAP_SYS_ADMIN)) return -EPERM; - /* Allocate an xfs_pptr_info to put the user data */ - ppi = kvmalloc(sizeof(struct xfs_pptr_info), GFP_KERNEL); + /* Allocate an xfs_getparents to put the user data */ + ppi = kvmalloc(sizeof(struct xfs_getparents), GFP_KERNEL); if (!ppi) return -ENOMEM; /* Copy the data from the user */ - error = copy_from_user(ppi, arg, sizeof(struct xfs_pptr_info)); + error = copy_from_user(ppi, arg, sizeof(struct xfs_getparents)); if (error) { error = -EFAULT; goto out; } /* Check size of buffer requested by user */ - if (xfs_pptr_info_sizeof(ppi->pi_ptrs_size) > XFS_XATTR_LIST_MAX) { + if (xfs_getparents_sizeof(ppi->gp_ptrs_size) > XFS_XATTR_LIST_MAX) { error = -ENOMEM; goto out; } - if (ppi->pi_flags & ~XFS_PPTR_FLAG_ALL) { + if (ppi->gp_flags & ~XFS_GETPARENTS_FLAG_ALL) { error = -EINVAL; goto out; } - ppi->pi_flags &= ~(XFS_PPTR_OFLAG_ROOT | XFS_PPTR_OFLAG_DONE); + ppi->gp_flags &= ~(XFS_GETPARENTS_OFLAG_ROOT | XFS_GETPARENTS_OFLAG_DONE); /* * Now that we know how big the trailing buffer is, expand - * our kernel xfs_pptr_info to be the same size + * our kernel xfs_getparents to be the same size */ - ppi = kvrealloc(ppi, sizeof(struct xfs_pptr_info), - xfs_pptr_info_sizeof(ppi->pi_ptrs_size), + ppi = kvrealloc(ppi, sizeof(struct xfs_getparents), + xfs_getparents_sizeof(ppi->gp_ptrs_size), GFP_KERNEL | __GFP_ZERO); if (!ppi) return -ENOMEM; - if (ppi->pi_flags & XFS_PPTR_IFLAG_HANDLE) { - struct xfs_handle *hanp = &ppi->pi_handle; + if (ppi->gp_flags & XFS_GETPARENTS_IFLAG_HANDLE) { + struct xfs_handle *hanp = &ppi->gp_handle; if (memcmp(&hanp->ha_fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t))) { @@ -1765,7 +1765,7 @@ xfs_ioc_get_parent_pointer( /* Copy the parent pointers back to the user */ error = copy_to_user(arg, ppi, - xfs_pptr_info_sizeof(ppi->pi_ptrs_size)); + xfs_getparents_sizeof(ppi->gp_ptrs_size)); if (error) { error = -EFAULT; goto out; diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h index 5f32dea26221..ba85dec53b0f 100644 --- a/fs/xfs/xfs_ondisk.h +++ b/fs/xfs/xfs_ondisk.h @@ -158,7 +158,7 @@ xfs_check_ondisk_structs(void) /* parent pointer ioctls */ XFS_CHECK_STRUCT_SIZE(struct xfs_parent_ptr, 280); - XFS_CHECK_STRUCT_SIZE(struct xfs_pptr_info, 104); + XFS_CHECK_STRUCT_SIZE(struct xfs_getparents, 104); /* * The v5 superblock format extended several v4 header structures with diff --git a/fs/xfs/xfs_parent_utils.c b/fs/xfs/xfs_parent_utils.c index 284ca3c14a0f..d10d04a8a3c4 100644 --- a/fs/xfs/xfs_parent_utils.c +++ b/fs/xfs/xfs_parent_utils.c @@ -26,7 +26,7 @@ struct xfs_getparent_ctx { struct xfs_attr_list_context context; struct xfs_parent_name_irec pptr_irec; - struct xfs_pptr_info *ppi; + struct xfs_getparents *ppi; }; static void @@ -39,7 +39,7 @@ xfs_getparent_listent( int valuelen) { struct xfs_getparent_ctx *gp; - struct xfs_pptr_info *ppi; + struct xfs_getparents *ppi; struct xfs_parent_ptr *pptr; struct xfs_parent_name_irec *irec; struct xfs_mount *mp = context->dp->i_mount; @@ -69,7 +69,7 @@ xfs_getparent_listent( * to the caller that we did /not/ reach the end of the parent pointer * recordset. */ - if (ppi->pi_ptrs_used >= ppi->pi_ptrs_size) { + if (ppi->gp_ptrs_used >= ppi->gp_ptrs_size) { context->seen_enough = 1; return; } @@ -80,7 +80,7 @@ xfs_getparent_listent( trace_xfs_getparent_listent(context->dp, ppi, irec); /* Format the parent pointer directly into the caller buffer. */ - pptr = &ppi->pi_parents[ppi->pi_ptrs_used++]; + pptr = &ppi->gp_parents[ppi->gp_ptrs_used++]; pptr->xpp_ino = irec->p_ino; pptr->xpp_gen = irec->p_gen; pptr->xpp_rsvd2 = 0; @@ -95,7 +95,7 @@ xfs_getparent_listent( int xfs_getparent_pointers( struct xfs_inode *ip, - struct xfs_pptr_info *ppi) + struct xfs_getparents *ppi) { struct xfs_getparent_ctx *gp; int error; @@ -110,9 +110,9 @@ xfs_getparent_pointers( gp->context.bufsize = 1; /* always init cursor */ /* Copy the cursor provided by caller */ - memcpy(&gp->context.cursor, &ppi->pi_cursor, + memcpy(&gp->context.cursor, &ppi->gp_cursor, sizeof(struct xfs_attrlist_cursor)); - ppi->pi_ptrs_used = 0; + ppi->gp_ptrs_used = 0; trace_xfs_getparent_pointers(ip, ppi, &gp->context.cursor); @@ -126,17 +126,17 @@ xfs_getparent_pointers( /* Is this the root directory? */ if (ip->i_ino == ip->i_mount->m_sb.sb_rootino) - ppi->pi_flags |= XFS_PPTR_OFLAG_ROOT; + ppi->gp_flags |= XFS_GETPARENTS_OFLAG_ROOT; /* * If we did not run out of buffer space, then we reached the end of * the pptr recordset, so set the DONE flag. */ if (gp->context.seen_enough == 0) - ppi->pi_flags |= XFS_PPTR_OFLAG_DONE; + ppi->gp_flags |= XFS_GETPARENTS_OFLAG_DONE; /* Update the caller with the current cursor position */ - memcpy(&ppi->pi_cursor, &gp->context.cursor, + memcpy(&ppi->gp_cursor, &gp->context.cursor, sizeof(struct xfs_attrlist_cursor)); out_free: kfree(gp); diff --git a/fs/xfs/xfs_parent_utils.h b/fs/xfs/xfs_parent_utils.h index 9936c74e6f96..01f127dae086 100644 --- a/fs/xfs/xfs_parent_utils.h +++ b/fs/xfs/xfs_parent_utils.h @@ -6,6 +6,6 @@ #ifndef __XFS_PARENT_UTILS_H__ #define __XFS_PARENT_UTILS_H__ -int xfs_getparent_pointers(struct xfs_inode *ip, struct xfs_pptr_info *ppi); +int xfs_getparent_pointers(struct xfs_inode *ip, struct xfs_getparents *ppi); #endif /* __XFS_PARENT_UTILS_H__ */ diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 959aff69822d..d31f47eced4c 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -74,7 +74,7 @@ struct xfs_inobt_rec_incore; union xfs_btree_ptr; struct xfs_dqtrx; struct xfs_icwalk; -struct xfs_pptr_info; +struct xfs_getparents; struct xfs_parent_name_irec; struct xfs_attrlist_cursor_kern; @@ -4321,7 +4321,7 @@ TRACE_EVENT(xfs_force_shutdown, ); TRACE_EVENT(xfs_getparent_listent, - TP_PROTO(struct xfs_inode *ip, const struct xfs_pptr_info *ppi, + TP_PROTO(struct xfs_inode *ip, const struct xfs_getparents *ppi, const struct xfs_parent_name_irec *irec), TP_ARGS(ip, ppi, irec), TP_STRUCT__entry( @@ -4337,8 +4337,8 @@ TRACE_EVENT(xfs_getparent_listent, TP_fast_assign( __entry->dev = ip->i_mount->m_super->s_dev; __entry->ino = ip->i_ino; - __entry->pused = ppi->pi_ptrs_used; - __entry->psize = ppi->pi_ptrs_size; + __entry->pused = ppi->gp_ptrs_used; + __entry->psize = ppi->gp_ptrs_size; __entry->parent_ino = irec->p_ino; __entry->parent_gen = irec->p_gen; __entry->namelen = irec->p_namelen; @@ -4356,7 +4356,7 @@ TRACE_EVENT(xfs_getparent_listent, ); TRACE_EVENT(xfs_getparent_pointers, - TP_PROTO(struct xfs_inode *ip, const struct xfs_pptr_info *ppi, + TP_PROTO(struct xfs_inode *ip, const struct xfs_getparents *ppi, const struct xfs_attrlist_cursor_kern *cur), TP_ARGS(ip, ppi, cur), TP_STRUCT__entry( @@ -4372,8 +4372,8 @@ TRACE_EVENT(xfs_getparent_pointers, TP_fast_assign( __entry->dev = ip->i_mount->m_super->s_dev; __entry->ino = ip->i_ino; - __entry->flags = ppi->pi_flags; - __entry->psize = ppi->pi_ptrs_size; + __entry->flags = ppi->gp_flags; + __entry->psize = ppi->gp_ptrs_size; __entry->hashval = cur->hashval; __entry->blkno = cur->blkno; __entry->offset = cur->offset; From patchwork Thu Feb 16 20:53:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13143857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4678FC61DA4 for ; Thu, 16 Feb 2023 20:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjBPUxU (ORCPT ); Thu, 16 Feb 2023 15:53:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjBPUxT (ORCPT ); Thu, 16 Feb 2023 15:53:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 961F14CCBA for ; Thu, 16 Feb 2023 12:53:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 20DF4B826BA for ; Thu, 16 Feb 2023 20:53:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5673C433EF; Thu, 16 Feb 2023 20:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676580795; bh=8bd5QUn7OUwftD7iCR0MPNVYTOHYlzfGOWShMhwqQzY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=vAEi/dF2fW7EhgP/bTgF9q9oKhxLiSqpSjUZkVzf2V1J2Mk0hmzgErVpLtNZEsGnz 8X1tnAYffM7Aa3gT+LmY4WNeo+8Yt8nE6/xZexYKROUhAQOWbIpyJpHJqPqsrYRlRF D9wbUsW1VOFLyoE0W2+YeTnngdsOFayM6UVHYiGwfZ3nWoNyVEyUOSCYS4U0CSoyWR lkc5NZH52Die1zCYBe5crohM1CZqqkO8ay3GRaTFUkzhtJ4TxX8afQpTXTCZ12og9f uJdc1SLxmarfI1/OQBoq47iL1IQBjkDKjR3d0HnrL+QAde4OCj0SUCcTl2eAZyUWvf UDzGQVDllhbvA== Date: Thu, 16 Feb 2023 12:53:15 -0800 Subject: [PATCH 2/3] xfs: rename xfs_parent_ptr From: "Darrick J. Wong" To: djwong@kernel.org Cc: allison.henderson@oracle.com, linux-xfs@vger.kernel.org Message-ID: <167657876266.3475586.7183544100362573325.stgit@magnolia> In-Reply-To: <167657876236.3475586.14505209064881107848.stgit@magnolia> References: <167657876236.3475586.14505209064881107848.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Change the name to xfs_getparents_rec so that the name matches the head structure. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_fs.h | 22 +++++++++++----------- fs/xfs/xfs_ioctl.c | 4 ++-- fs/xfs/xfs_ondisk.h | 2 +- fs/xfs/xfs_parent_utils.c | 16 ++++++++-------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 2a23c010a0a0..ec6fdf78fde7 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -768,12 +768,12 @@ struct xfs_scrub_metadata { XFS_GETPARENTS_OFLAG_DONE) /* Get an inode parent pointer through ioctl */ -struct xfs_parent_ptr { - __u64 xpp_ino; /* Inode */ - __u32 xpp_gen; /* Inode generation */ - __u32 xpp_rsvd; /* Reserved */ - __u64 xpp_rsvd2; /* Reserved */ - __u8 xpp_name[XFS_GETPARENTS_MAXNAMELEN]; /* File name */ +struct xfs_getparents_rec { + __u64 gpr_ino; /* Inode */ + __u32 gpr_gen; /* Inode generation */ + __u32 gpr_rsvd; /* Reserved */ + __u64 gpr_rsvd2; /* Reserved */ + __u8 gpr_name[XFS_GETPARENTS_MAXNAMELEN]; /* File name */ }; /* Iterate through an inodes parent pointers */ @@ -804,21 +804,21 @@ struct xfs_getparents { __u64 gp_reserved2[6]; /* - * An array of struct xfs_parent_ptr follows the header + * An array of struct xfs_getparents_rec follows the header * information. Use xfs_getparents_rec() to access the * parent pointer array entries. */ - struct xfs_parent_ptr gp_parents[]; + struct xfs_getparents_rec gp_parents[]; }; static inline size_t xfs_getparents_sizeof(int nr_ptrs) { return sizeof(struct xfs_getparents) + - (nr_ptrs * sizeof(struct xfs_parent_ptr)); + (nr_ptrs * sizeof(struct xfs_getparents_rec)); } -static inline struct xfs_parent_ptr* +static inline struct xfs_getparents_rec* xfs_getparents_rec( struct xfs_getparents *info, unsigned int idx) @@ -871,7 +871,7 @@ xfs_getparents_rec( /* XFS_IOC_GETFSMAP ------ hoisted 59 */ #define XFS_IOC_SCRUB_METADATA _IOWR('X', 60, struct xfs_scrub_metadata) #define XFS_IOC_AG_GEOMETRY _IOWR('X', 61, struct xfs_ag_geometry) -#define XFS_IOC_GETPARENTS _IOWR('X', 62, struct xfs_parent_ptr) +#define XFS_IOC_GETPARENTS _IOWR('X', 62, struct xfs_getparents_rec) /* * ioctl commands that replace IRIX syssgi()'s diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 2687e9965310..b3154830ef91 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1681,10 +1681,10 @@ xfs_ioc_scrub_metadata( * IOCTL routine to get the parent pointers of an inode and return it to user * space. Caller must pass a buffer space containing a struct xfs_getparents, * followed by a region large enough to contain an array of struct - * xfs_parent_ptr of a size specified in gp_ptrs_size. If the inode contains + * xfs_getparents_rec of a size specified in gp_ptrs_size. If the inode contains * more parent pointers than can fit in the buffer space, caller may re-call * the function using the returned gp_cursor to resume iteration. The - * number of xfs_parent_ptr returned will be stored in gp_ptrs_used. + * number of xfs_getparents_rec returned will be stored in gp_ptrs_used. * * Returns 0 on success or non-zero on failure */ diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h index ba85dec53b0f..38d8113b832d 100644 --- a/fs/xfs/xfs_ondisk.h +++ b/fs/xfs/xfs_ondisk.h @@ -157,7 +157,7 @@ xfs_check_ondisk_structs(void) XFS_CHECK_OFFSET(struct xfs_efi_log_format_64, efi_extents, 16); /* parent pointer ioctls */ - XFS_CHECK_STRUCT_SIZE(struct xfs_parent_ptr, 280); + XFS_CHECK_STRUCT_SIZE(struct xfs_getparents_rec, 280); XFS_CHECK_STRUCT_SIZE(struct xfs_getparents, 104); /* diff --git a/fs/xfs/xfs_parent_utils.c b/fs/xfs/xfs_parent_utils.c index d10d04a8a3c4..801223d011e7 100644 --- a/fs/xfs/xfs_parent_utils.c +++ b/fs/xfs/xfs_parent_utils.c @@ -40,7 +40,7 @@ xfs_getparent_listent( { struct xfs_getparent_ctx *gp; struct xfs_getparents *ppi; - struct xfs_parent_ptr *pptr; + struct xfs_getparents_rec *pptr; struct xfs_parent_name_irec *irec; struct xfs_mount *mp = context->dp->i_mount; @@ -81,14 +81,14 @@ xfs_getparent_listent( /* Format the parent pointer directly into the caller buffer. */ pptr = &ppi->gp_parents[ppi->gp_ptrs_used++]; - pptr->xpp_ino = irec->p_ino; - pptr->xpp_gen = irec->p_gen; - pptr->xpp_rsvd2 = 0; - pptr->xpp_rsvd = 0; + pptr->gpr_ino = irec->p_ino; + pptr->gpr_gen = irec->p_gen; + pptr->gpr_rsvd2 = 0; + pptr->gpr_rsvd = 0; - memcpy(pptr->xpp_name, irec->p_name, irec->p_namelen); - memset(pptr->xpp_name + irec->p_namelen, 0, - sizeof(pptr->xpp_name) - irec->p_namelen); + memcpy(pptr->gpr_name, irec->p_name, irec->p_namelen); + memset(pptr->gpr_name + irec->p_namelen, 0, + sizeof(pptr->gpr_name) - irec->p_namelen); } /* Retrieve the parent pointers for a given inode. */ From patchwork Thu Feb 16 20:53:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13143858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D95EC61DA4 for ; Thu, 16 Feb 2023 20:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjBPUxg (ORCPT ); Thu, 16 Feb 2023 15:53:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjBPUxf (ORCPT ); Thu, 16 Feb 2023 15:53:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14C8E2942C for ; Thu, 16 Feb 2023 12:53:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9AE2DB82962 for ; Thu, 16 Feb 2023 20:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61750C433D2; Thu, 16 Feb 2023 20:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676580811; bh=PKJ5qPmhtzuLyHTPqNJroGsO6L+JODNx/UbrL5Ikaek=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=PJ/HtEClA7HmyQUpQVk2Gejw1Ik8V2udu/2dFrPzhnD4q+gYLU+txaYslsgq2jytl ce6pQrVAnqjBw/JdVFyIZZqP8TPjN3sw0DztsI4lNLuX9fwch/q1EWIUbSC/y8h2e6 zOG7rUJqTMdpIcfi89G+vXyiwCQhlHTHDk1LQ8LnVJ8KGLMWiBmiVcqSoRhASnWGPU yxAqWB88wbNzppBbNF5FrEEcatxPHHFq/OR8/oRAH2NOi+qvlRfPDY6b+i3bj6cwV2 lgEuvnP0vSA/WGfLELievug6kcaI8GIOZkX+GIjkTcwvkV2B2KtnPZb/WjJauJ5kQt m2gjfwUpXJERg== Date: Thu, 16 Feb 2023 12:53:30 -0800 Subject: [PATCH 3/3] xfs: convert GETPARENTS structures to flex arrays From: "Darrick J. Wong" To: djwong@kernel.org Cc: allison.henderson@oracle.com, linux-xfs@vger.kernel.org Message-ID: <167657876281.3475586.6793318307162105453.stgit@magnolia> In-Reply-To: <167657876236.3475586.14505209064881107848.stgit@magnolia> References: <167657876236.3475586.14505209064881107848.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong The current definition of the GETPARENTS ioctl doesn't use the buffer space terribly efficiently because each parent pointer record struct incorporates enough space to hold the maximally sized dirent name. Most dirent names are much less than 255 bytes long, which means we're wasting a lot of space. Convert the xfs_getparents_rec structure to use a flex array to store the dirent name as a null terminated string, which allows us to pack the information much more densely. For this to work, augment the xfs_getparents struct to end with a flex array of buffer offsets to each xfs_getparents_rec object, much as we do for the attrlist multi ioctl. Record objects are allocated from the end of the buffer towards the head. Finally, reduce the amount of data that we copy to userspace to the head array containg the offsets, and however much of the buffer's end is used for the parent records. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_fs.h | 38 ++++++++++++++------------------------ fs/xfs/xfs_ioctl.c | 43 ++++++++++++++++++++++++++++++++++++------- fs/xfs/xfs_ondisk.h | 4 ++-- fs/xfs/xfs_parent_utils.c | 31 ++++++++++++++++++++++--------- fs/xfs/xfs_parent_utils.h | 9 +++++++++ fs/xfs/xfs_trace.h | 22 +++++++++++----------- 6 files changed, 94 insertions(+), 53 deletions(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index ec6fdf78fde7..c8be149398a6 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -769,11 +769,11 @@ struct xfs_scrub_metadata { /* Get an inode parent pointer through ioctl */ struct xfs_getparents_rec { - __u64 gpr_ino; /* Inode */ - __u32 gpr_gen; /* Inode generation */ - __u32 gpr_rsvd; /* Reserved */ - __u64 gpr_rsvd2; /* Reserved */ - __u8 gpr_name[XFS_GETPARENTS_MAXNAMELEN]; /* File name */ + __u64 gpr_ino; /* Inode */ + __u32 gpr_gen; /* Inode generation */ + __u32 gpr_rsvd; /* Reserved */ + __u64 gpr_rsvd2; /* Reserved */ + __u8 gpr_name[]; /* File name and null terminator */ }; /* Iterate through an inodes parent pointers */ @@ -794,36 +794,26 @@ struct xfs_getparents { /* Must be set to zero */ __u32 gp_reserved; - /* # of entries in array */ - __u32 gp_ptrs_size; + /* size of the memory buffer in bytes, including this header */ + __u32 gp_bufsize; /* # of entries filled in (output) */ - __u32 gp_ptrs_used; + __u32 gp_count; /* Must be set to zero */ - __u64 gp_reserved2[6]; + __u64 gp_reserved2[5]; - /* - * An array of struct xfs_getparents_rec follows the header - * information. Use xfs_getparents_rec() to access the - * parent pointer array entries. - */ - struct xfs_getparents_rec gp_parents[]; + /* Byte offset of each xfs_getparents_rec object within the buffer. */ + __u32 gp_offsets[]; }; -static inline size_t -xfs_getparents_sizeof(int nr_ptrs) -{ - return sizeof(struct xfs_getparents) + - (nr_ptrs * sizeof(struct xfs_getparents_rec)); -} - static inline struct xfs_getparents_rec* xfs_getparents_rec( struct xfs_getparents *info, unsigned int idx) { - return &info->gp_parents[idx]; + return (struct xfs_getparents_rec *)((char *)info + + info->gp_offsets[idx]); } /* @@ -871,7 +861,7 @@ xfs_getparents_rec( /* XFS_IOC_GETFSMAP ------ hoisted 59 */ #define XFS_IOC_SCRUB_METADATA _IOWR('X', 60, struct xfs_scrub_metadata) #define XFS_IOC_AG_GEOMETRY _IOWR('X', 61, struct xfs_ag_geometry) -#define XFS_IOC_GETPARENTS _IOWR('X', 62, struct xfs_getparents_rec) +#define XFS_IOC_GETPARENTS _IOWR('X', 62, struct xfs_getparents) /* * ioctl commands that replace IRIX syssgi()'s diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index b3154830ef91..14138ce5100a 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1684,7 +1684,7 @@ xfs_ioc_scrub_metadata( * xfs_getparents_rec of a size specified in gp_ptrs_size. If the inode contains * more parent pointers than can fit in the buffer space, caller may re-call * the function using the returned gp_cursor to resume iteration. The - * number of xfs_getparents_rec returned will be stored in gp_ptrs_used. + * number of xfs_getparents_rec returned will be stored in gp_count. * * Returns 0 on success or non-zero on failure */ @@ -1698,6 +1698,9 @@ xfs_ioc_get_parent_pointer( struct xfs_inode *file_ip = XFS_I(file_inode(filp)); struct xfs_inode *call_ip = file_ip; struct xfs_mount *mp = file_ip->i_mount; + void __user *o_pptr; + struct xfs_getparents_rec *i_pptr; + unsigned int bytes; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -1715,10 +1718,14 @@ xfs_ioc_get_parent_pointer( } /* Check size of buffer requested by user */ - if (xfs_getparents_sizeof(ppi->gp_ptrs_size) > XFS_XATTR_LIST_MAX) { + if (ppi->gp_bufsize > XFS_XATTR_LIST_MAX) { error = -ENOMEM; goto out; } + if (ppi->gp_bufsize < sizeof(struct xfs_getparents)) { + error = -EINVAL; + goto out; + } if (ppi->gp_flags & ~XFS_GETPARENTS_FLAG_ALL) { error = -EINVAL; @@ -1730,8 +1737,7 @@ xfs_ioc_get_parent_pointer( * Now that we know how big the trailing buffer is, expand * our kernel xfs_getparents to be the same size */ - ppi = kvrealloc(ppi, sizeof(struct xfs_getparents), - xfs_getparents_sizeof(ppi->gp_ptrs_size), + ppi = kvrealloc(ppi, sizeof(struct xfs_getparents), ppi->gp_bufsize, GFP_KERNEL | __GFP_ZERO); if (!ppi) return -ENOMEM; @@ -1763,9 +1769,32 @@ xfs_ioc_get_parent_pointer( if (error) goto out; - /* Copy the parent pointers back to the user */ - error = copy_to_user(arg, ppi, - xfs_getparents_sizeof(ppi->gp_ptrs_size)); + /* + * If we ran out of buffer space before copying any parent pointers at + * all, the caller's buffer was too short. Tell userspace that, erm, + * the message is too long. + */ + if (ppi->gp_count == 0 && !(ppi->gp_flags & XFS_GETPARENTS_OFLAG_DONE)) { + error = -EMSGSIZE; + goto out; + } + + /* Copy the parent pointer head back to the user */ + bytes = xfs_getparents_arraytop(ppi, ppi->gp_count); + error = copy_to_user(arg, ppi, bytes); + if (error) { + error = -EFAULT; + goto out; + } + + if (ppi->gp_count == 0) + goto out; + + /* Copy the parent pointer records back to the user. */ + o_pptr = (__user char*)arg + ppi->gp_offsets[ppi->gp_count - 1]; + i_pptr = xfs_getparents_rec(ppi, ppi->gp_count - 1); + bytes = ((char *)ppi + ppi->gp_bufsize) - (char *)i_pptr; + error = copy_to_user(o_pptr, i_pptr, bytes); if (error) { error = -EFAULT; goto out; diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h index 38d8113b832d..b7f29b4acac3 100644 --- a/fs/xfs/xfs_ondisk.h +++ b/fs/xfs/xfs_ondisk.h @@ -157,8 +157,8 @@ xfs_check_ondisk_structs(void) XFS_CHECK_OFFSET(struct xfs_efi_log_format_64, efi_extents, 16); /* parent pointer ioctls */ - XFS_CHECK_STRUCT_SIZE(struct xfs_getparents_rec, 280); - XFS_CHECK_STRUCT_SIZE(struct xfs_getparents, 104); + XFS_CHECK_STRUCT_SIZE(struct xfs_getparents_rec, 24); + XFS_CHECK_STRUCT_SIZE(struct xfs_getparents, 96); /* * The v5 superblock format extended several v4 header structures with diff --git a/fs/xfs/xfs_parent_utils.c b/fs/xfs/xfs_parent_utils.c index 801223d011e7..04e2e93a1986 100644 --- a/fs/xfs/xfs_parent_utils.c +++ b/fs/xfs/xfs_parent_utils.c @@ -29,6 +29,14 @@ struct xfs_getparent_ctx { struct xfs_getparents *ppi; }; +static inline unsigned int +xfs_getparents_rec_sizeof( + const struct xfs_parent_name_irec *irec) +{ + return round_up(sizeof(struct xfs_getparents_rec) + irec->p_namelen + 1, + sizeof(uint32_t)); +} + static void xfs_getparent_listent( struct xfs_attr_list_context *context, @@ -43,6 +51,7 @@ xfs_getparent_listent( struct xfs_getparents_rec *pptr; struct xfs_parent_name_irec *irec; struct xfs_mount *mp = context->dp->i_mount; + int arraytop; gp = container_of(context, struct xfs_getparent_ctx, context); ppi = gp->ppi; @@ -64,31 +73,34 @@ xfs_getparent_listent( return; } + xfs_parent_irec_from_disk(&gp->pptr_irec, (void *)name, namelen, value, + valuelen); + /* * We found a parent pointer, but we've filled up the buffer. Signal * to the caller that we did /not/ reach the end of the parent pointer * recordset. */ - if (ppi->gp_ptrs_used >= ppi->gp_ptrs_size) { + arraytop = xfs_getparents_arraytop(ppi, ppi->gp_count + 1); + context->firstu -= xfs_getparents_rec_sizeof(irec); + if (context->firstu < arraytop) { context->seen_enough = 1; return; } - xfs_parent_irec_from_disk(&gp->pptr_irec, (void *)name, namelen, value, - valuelen); - trace_xfs_getparent_listent(context->dp, ppi, irec); /* Format the parent pointer directly into the caller buffer. */ - pptr = &ppi->gp_parents[ppi->gp_ptrs_used++]; + ppi->gp_offsets[ppi->gp_count] = context->firstu; + pptr = xfs_getparents_rec(ppi, ppi->gp_count); pptr->gpr_ino = irec->p_ino; pptr->gpr_gen = irec->p_gen; pptr->gpr_rsvd2 = 0; pptr->gpr_rsvd = 0; memcpy(pptr->gpr_name, irec->p_name, irec->p_namelen); - memset(pptr->gpr_name + irec->p_namelen, 0, - sizeof(pptr->gpr_name) - irec->p_namelen); + pptr->gpr_name[irec->p_namelen] = 0; + ppi->gp_count++; } /* Retrieve the parent pointers for a given inode. */ @@ -107,12 +119,13 @@ xfs_getparent_pointers( gp->context.dp = ip; gp->context.resynch = 1; gp->context.put_listent = xfs_getparent_listent; - gp->context.bufsize = 1; /* always init cursor */ + gp->context.bufsize = round_down(ppi->gp_bufsize, sizeof(uint32_t)); + gp->context.firstu = gp->context.bufsize; /* Copy the cursor provided by caller */ memcpy(&gp->context.cursor, &ppi->gp_cursor, sizeof(struct xfs_attrlist_cursor)); - ppi->gp_ptrs_used = 0; + ppi->gp_count = 0; trace_xfs_getparent_pointers(ip, ppi, &gp->context.cursor); diff --git a/fs/xfs/xfs_parent_utils.h b/fs/xfs/xfs_parent_utils.h index 01f127dae086..48de5b700f9c 100644 --- a/fs/xfs/xfs_parent_utils.h +++ b/fs/xfs/xfs_parent_utils.h @@ -6,6 +6,15 @@ #ifndef __XFS_PARENT_UTILS_H__ #define __XFS_PARENT_UTILS_H__ +static inline unsigned int +xfs_getparents_arraytop( + const struct xfs_getparents *ppi, + unsigned int nr) +{ + return sizeof(struct xfs_getparents) + + (nr * sizeof(ppi->gp_offsets[0])); +} + int xfs_getparent_pointers(struct xfs_inode *ip, struct xfs_getparents *ppi); #endif /* __XFS_PARENT_UTILS_H__ */ diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index d31f47eced4c..f831ee910235 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -4327,8 +4327,8 @@ TRACE_EVENT(xfs_getparent_listent, TP_STRUCT__entry( __field(dev_t, dev) __field(xfs_ino_t, ino) - __field(unsigned int, pused) - __field(unsigned int, psize) + __field(unsigned int, count) + __field(unsigned int, bufsize) __field(xfs_ino_t, parent_ino) __field(unsigned int, parent_gen) __field(unsigned int, namelen) @@ -4337,18 +4337,18 @@ TRACE_EVENT(xfs_getparent_listent, TP_fast_assign( __entry->dev = ip->i_mount->m_super->s_dev; __entry->ino = ip->i_ino; - __entry->pused = ppi->gp_ptrs_used; - __entry->psize = ppi->gp_ptrs_size; + __entry->count = ppi->gp_count; + __entry->bufsize = ppi->gp_bufsize; __entry->parent_ino = irec->p_ino; __entry->parent_gen = irec->p_gen; __entry->namelen = irec->p_namelen; memcpy(__get_str(name), irec->p_name, irec->p_namelen); ), - TP_printk("dev %d:%d ino 0x%llx pptr %u/%u: parent_ino 0x%llx parent_gen 0x%x name '%.*s'", + TP_printk("dev %d:%d ino 0x%llx bufsize %u count %u: parent_ino 0x%llx parent_gen 0x%x name '%.*s'", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, - __entry->pused, - __entry->psize, + __entry->bufsize, + __entry->count, __entry->parent_ino, __entry->parent_gen, __entry->namelen, @@ -4363,7 +4363,7 @@ TRACE_EVENT(xfs_getparent_pointers, __field(dev_t, dev) __field(xfs_ino_t, ino) __field(unsigned int, flags) - __field(unsigned int, psize) + __field(unsigned int, bufsize) __field(unsigned int, hashval) __field(unsigned int, blkno) __field(unsigned int, offset) @@ -4373,17 +4373,17 @@ TRACE_EVENT(xfs_getparent_pointers, __entry->dev = ip->i_mount->m_super->s_dev; __entry->ino = ip->i_ino; __entry->flags = ppi->gp_flags; - __entry->psize = ppi->gp_ptrs_size; + __entry->bufsize = ppi->gp_bufsize; __entry->hashval = cur->hashval; __entry->blkno = cur->blkno; __entry->offset = cur->offset; __entry->initted = cur->initted; ), - TP_printk("dev %d:%d ino 0x%llx flags 0x%x psize %u cur_init? %d hashval 0x%x blkno %u offset %u", + TP_printk("dev %d:%d ino 0x%llx flags 0x%x bufsize %u cur_init? %d hashval 0x%x blkno %u offset %u", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, __entry->flags, - __entry->psize, + __entry->bufsize, __entry->initted, __entry->hashval, __entry->blkno,