diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-03-10 13:14:38 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-03-17 14:44:01 -0700 |
commit | 20173b0bed31c01cf27a8611725987ad99fd1f8a (patch) | |
tree | 2c656ee7c69fd847aaf767a22fba13d73ae5f8dd /fs/xfs/libxfs/xfs_dir2.c | |
parent | cf521c8fa3b520d238e1bf697e58803414d3dfcc (diff) |
xfs: constify xfs_name_dotdotxfs-fixes-5.18_2022-03-17
The symbol xfs_name_dotdot is a global variable that the xfs codebase
uses here and there to look up directory dotdot entries. Currently it's
a non-const variable, which means that it's a mutable global variable.
So far nobody's abused this to cause problems, but let's use the
compiler to enforce that.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 6b531a659b1e..5f1e4799e8fa 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c @@ -19,7 +19,11 @@ #include "xfs_error.h" #include "xfs_trace.h" -struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR }; +const struct xfs_name xfs_name_dotdot = { + .name = (const unsigned char *)"..", + .len = 2, + .type = XFS_DIR3_FT_DIR, +}; /* * Convert inode mode to directory entry filetype |