]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: create a static name for the dot entry too
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:00:52 +0000 (10:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:35 +0000 (11:37 -0700)
Source kernel commit: e99bfc9e687e208d4ba7e85167b8753e80cf4169

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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_dir2.c
libxfs/xfs_dir2.h
repair/phase6.c

index 914c751077535729c658ae79dac8713ddc310d43..ac372bf2aa32b62d1c9661c0075e15505680e4c1 100644 (file)
@@ -24,6 +24,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
index 36e71857fdc00815d77033abce82d3a4f3f7fcbd..ae8935a2642042c1a6755ebd20cabc5695421a3a 100644 (file)
@@ -23,10 +23,6 @@ static struct cred           zerocr;
 static struct fsxattr          zerofsx;
 static xfs_ino_t               orphanage_ino;
 
-static struct xfs_name         xfs_name_dot = {(unsigned char *)".",
-                                               1,
-                                               XFS_DIR3_FT_DIR};
-
 /*
  * Data structures used to keep track of directories where the ".."
  * entries are updated. These must be rebuilt after the initial pass