summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_imeta.h
blob: f180664537b64765a39282f79e41875ed00451d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2020 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <darrick.wong@oracle.com>
 */
#ifndef __XFS_IMETA_H__
#define __XFS_IMETA_H__

/* Key for looking up metadata inodes. */
struct xfs_imeta_path {
	/* Temporary: integer to keep the static imeta definitions unique */
	int		bogus;
};

/* Cleanup widget for metadata inode creation and deletion. */
struct xfs_imeta_end {
	/* empty for now */
};

/* Lookup keys for static metadata inodes. */
extern const struct xfs_imeta_path XFS_IMETA_RTBITMAP;
extern const struct xfs_imeta_path XFS_IMETA_RTSUMMARY;
extern const struct xfs_imeta_path XFS_IMETA_USRQUOTA;
extern const struct xfs_imeta_path XFS_IMETA_GRPQUOTA;
extern const struct xfs_imeta_path XFS_IMETA_PRJQUOTA;

int xfs_imeta_lookup(struct xfs_mount *mp, const struct xfs_imeta_path *path,
		     xfs_ino_t *ino);

int xfs_imeta_create(struct xfs_trans **tpp, const struct xfs_imeta_path *path,
		     umode_t mode, struct xfs_inode **ipp,
		     struct xfs_imeta_end *cleanup);
int xfs_imeta_unlink(struct xfs_trans **tpp, const struct xfs_imeta_path *path,
		     struct xfs_inode *ip, struct xfs_imeta_end *cleanup);
int xfs_imeta_zap(struct xfs_trans **tpp, const struct xfs_imeta_path *path,
		  struct xfs_imeta_end *cleanup);
void xfs_imeta_end_update(struct xfs_mount *mp, struct xfs_imeta_end *cleanup,
			  int error);

bool xfs_is_static_meta_ino(struct xfs_mount *mp, xfs_ino_t ino);
int xfs_imeta_mount(struct xfs_mount *mp);

unsigned int xfs_imeta_create_space_res(struct xfs_mount *mp);
unsigned int xfs_imeta_unlink_space_res(struct xfs_mount *mp);

/* Must be implemented by the libxfs client */
int xfs_imeta_iget(struct xfs_mount *mp, xfs_ino_t ino, unsigned char ftype,
		  struct xfs_inode **ipp);
void xfs_imeta_irele(struct xfs_inode *ip);

#endif /* __XFS_IMETA_H__ */