]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: separate the icreate logic around INIT_XATTRS
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 Jul 2024 18:22:41 +0000 (11:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 2 Jul 2024 18:36:58 +0000 (11:36 -0700)
commitb11b11e3b7a72606cfef527255a9467537bcaaa5
treeccbb97f18e0a5eb3d6f42851cdfa60a95b632ca0
parenta9e583d34facc64b6edf3c9afb2ff4891038176d
xfs: separate the icreate logic around INIT_XATTRS

INIT_XATTRS is overloaded here -- it's set during the creat process when
we think that we're immediately going to set some ACL xattrs to save
time.  However, it's also used by the parent pointers code to enable the
attr fork in preparation to receive ppptr xattrs.  This results in
xfs_has_parent() branches scattered around the codebase to turn on
INIT_XATTRS.

Linkable files are created far more commonly than unlinkable temporary
files or directory tree roots, so we should centralize this logic in
xfs_inode_init.  For the three callers that don't want parent pointers
(online repiar tempfiles, unlinkable tempfiles, rootdir creation) we
provide an UNLINKABLE flag to skip attr fork initialization.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_inode_util.c
fs/xfs/libxfs/xfs_inode_util.h
fs/xfs/scrub/tempfile.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_qm.c
fs/xfs/xfs_symlink.c