]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: create a static name for the dot entry too
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:48 +0000 (12:30 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:48 +0000 (12:30 -0800)
Create an xfs_name_dot object so that upcoming scrub code can compare
against that.  Offline repair already has such an object, so we're
really just hoisting it to the kernel.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/libxfs/xfs_dir2.h

index 8c9403b33191b23036efac852c9832b847c2d53a..9018abb38d7f6140d3516e4534f3cc4c9f299868 100644 (file)
@@ -25,6 +25,12 @@ const struct xfs_name xfs_name_dotdot = {
        .type   = XFS_DIR3_FT_DIR,
 };
 
+const struct xfs_name xfs_name_dot = {
+       .name   = (const unsigned char *)".",
+       .len    = 1,
+       .type   = XFS_DIR3_FT_DIR,
+};
+
 /*
  * Convert inode mode to directory entry filetype
  */
index 19af22a16c415705ef545d7736c1244771a9fc24..7d7cd8d808e4dbc7134536a6d5fe3ef7e3dd9544 100644 (file)
@@ -22,6 +22,7 @@ struct xfs_dir3_icfree_hdr;
 struct xfs_dir3_icleaf_hdr;
 
 extern const struct xfs_name   xfs_name_dotdot;
+extern const struct xfs_name   xfs_name_dot;
 
 /*
  * Convert inode mode to directory entry filetype