1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (c) 2018-2024 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
6 #ifndef __XFS_METADIR_H__
7 #define __XFS_METADIR_H__
9 /* Cleanup widget for metadata inode creation and deletion. */
10 struct xfs_metadir_update
{
11 /* Parent directory */
14 /* Path to metadata file */
17 /* Parent pointer update context */
18 struct xfs_parent_args
*ppargs
;
20 /* Child metadata file */
25 enum xfs_metafile_type metafile_type
;
27 unsigned int dp_locked
:1;
28 unsigned int ip_locked
:1;
31 int xfs_metadir_load(struct xfs_trans
*tp
, struct xfs_inode
*dp
,
32 const char *path
, enum xfs_metafile_type metafile_type
,
33 struct xfs_inode
**ipp
);
35 int xfs_metadir_start_create(struct xfs_metadir_update
*upd
);
36 int xfs_metadir_create(struct xfs_metadir_update
*upd
, umode_t mode
);
38 int xfs_metadir_start_link(struct xfs_metadir_update
*upd
);
39 int xfs_metadir_link(struct xfs_metadir_update
*upd
);
41 int xfs_metadir_commit(struct xfs_metadir_update
*upd
);
42 void xfs_metadir_cancel(struct xfs_metadir_update
*upd
, int error
);
44 int xfs_metadir_mkdir(struct xfs_inode
*dp
, const char *path
,
45 struct xfs_inode
**ipp
);
47 #endif /* __XFS_METADIR_H__ */