From: Darrick J. Wong <djwong@xxxxxxxxxx> Replace the dirent name buffer at the end of struct xrep_parent with a xfs_parent_name_irec object. The namebuf and p_name usage do not overlap, so we can save 256 bytes of memory by allowing them to overlap. Doing so makes the code a bit more complex, so this is called out separately. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- fs/xfs/scrub/parent_repair.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/xfs/scrub/parent_repair.c b/fs/xfs/scrub/parent_repair.c index 099620fc119e9..68cc3aee1d5c8 100644 --- a/fs/xfs/scrub/parent_repair.c +++ b/fs/xfs/scrub/parent_repair.c @@ -24,6 +24,7 @@ #include "xfs_trans_space.h" #include "xfs_health.h" #include "xfs_swapext.h" +#include "xfs_parent.h" #include "scrub/xfs_scrub.h" #include "scrub/scrub.h" #include "scrub/common.h" @@ -63,8 +64,12 @@ struct xrep_parent { /* Orphanage reparenting request. */ struct xrep_adoption adoption; - /* Directory entry name, plus the trailing null. */ - unsigned char namebuf[MAXNAMELEN]; + /* + * Scratch buffer for scanning dirents to create pptr xattrs. At the + * very end of the repair, it can also be used to compute the + * lost+found filename if we need to reparent the file. + */ + struct xfs_parent_name_irec pptr; }; /* Tear down all the incore stuff we created. */ @@ -236,7 +241,7 @@ xrep_parent_move_to_orphanage( if (error) return error; - error = xrep_adoption_compute_name(&rp->adoption, rp->namebuf); + error = xrep_adoption_compute_name(&rp->adoption, rp->pptr.p_name); if (error) return error;