summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_metafile.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-11-03 20:18:50 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-11-05 13:38:31 -0800
commitdcf606914334c640fd90853ae86e275b21ba0309 (patch)
treed6bb63a466fdd32055b45ecbcb080d15abcbb52f /fs/xfs/libxfs/xfs_metafile.h
parent4f3d4dd1b04b2ba0bf236fbaa3c3c0c669aa5a47 (diff)
xfs: iget for metadata inodes
Create a xfs_trans_metafile_iget function for metadata inodes to ensure that when we try to iget a metadata file, the inode is allocated and its file mode matches the metadata file type the caller expects. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_metafile.h')
-rw-r--r--fs/xfs/libxfs/xfs_metafile.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_metafile.h b/fs/xfs/libxfs/xfs_metafile.h
new file mode 100644
index 000000000000..60fe18906112
--- /dev/null
+++ b/fs/xfs/libxfs/xfs_metafile.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2018-2024 Oracle. All Rights Reserved.
+ * Author: Darrick J. Wong <djwong@kernel.org>
+ */
+#ifndef __XFS_METAFILE_H__
+#define __XFS_METAFILE_H__
+
+/* Code specific to kernel/userspace; must be provided externally. */
+
+int xfs_trans_metafile_iget(struct xfs_trans *tp, xfs_ino_t ino,
+ enum xfs_metafile_type metafile_type, struct xfs_inode **ipp);
+int xfs_metafile_iget(struct xfs_mount *mp, xfs_ino_t ino,
+ enum xfs_metafile_type metafile_type, struct xfs_inode **ipp);
+
+#endif /* __XFS_METAFILE_H__ */