projects/linux·blob master · refs

117 lines · 2.3 KiB

1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
5 */
6#ifndef __XFS_RTALLOC_H__
7#define __XFS_RTALLOC_H__
8
9/* kernel only definitions and functions */
10
11struct xfs_mount;
12struct xfs_trans;
13
14#ifdef CONFIG_XFS_RT
15/* rtgroup superblock initialization */
16int xfs_rtmount_readsb(struct xfs_mount *mp);
17void xfs_rtmount_freesb(struct xfs_mount *mp);
18
19/*
20 * Initialize realtime fields in the mount structure.
21 */
22int /* error */
23xfs_rtmount_init(
24 struct xfs_mount *mp); /* file system mount structure */
25void
26xfs_rtunmount_inodes(
27 struct xfs_mount *mp);
28
29/*
30 * Get the bitmap and summary inodes into the mount structure
31 * at mount time.
32 */
33int /* error */
34xfs_rtmount_inodes(
35 struct xfs_mount *mp); /* file system mount structure */
36
37/*
38 * Grow the realtime area of the filesystem.
39 */
40int
41xfs_growfs_rt(
42 struct xfs_mount *mp, /* file system mount structure */
43 xfs_growfs_rt_t *in); /* user supplied growfs struct */
44
45int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
46int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks,
47 xfs_rfsblock_t rblocks, xfs_agblock_t rextsize);
48#else
49static inline int
50xfs_growfs_rt(
51 struct xfs_mount *mp,
52 struct xfs_growfs_rt *in)
53{
54 return -ENOSYS;
55}
56
57static inline int
58xfs_rtalloc_reinit_frextents(
59 struct xfs_mount *mp)
60{
61 return 0;
62}
63
64static inline int
65xfs_rtmount_readsb(
66 struct xfs_mount *mp)
67{
68 return 0;
69}
70
71static inline void
72xfs_rtmount_freesb(
73 struct xfs_mount *mp)
74{
75}
76
77static inline int /* error */
78xfs_rtmount_init(
79 xfs_mount_t *mp) /* file system mount structure */
80{
81 if (mp->m_sb.sb_rblocks == 0)
82 return 0;
83
84 xfs_warn(mp, "Not built with CONFIG_XFS_RT");
85 return -ENOSYS;
86}
87
88static inline int
89xfs_rtmount_inodes(
90 struct xfs_mount *mp)
91{
92 if (mp->m_sb.sb_rblocks)
93 return -ENOSYS;
94 return 0;
95}
96
97static inline void
98xfs_rtunmount_inodes(
99 struct xfs_mount *mp)
100{
101}
102
103static inline int
104xfs_growfs_check_rtgeom(const struct xfs_mount *mp,
105 xfs_rfsblock_t dblocks, xfs_rfsblock_t rblocks,
106 xfs_extlen_t rextsize)
107{
108 return 0;
109}
110#endif /* CONFIG_XFS_RT */
111
112int xfs_rtallocate_rtgs(struct xfs_trans *tp, xfs_fsblock_t bno_hint,
113 xfs_rtxlen_t minlen, xfs_rtxlen_t maxlen, xfs_rtxlen_t prod,
114 bool wasdel, bool initial_user_data, xfs_rtblock_t *bno,
115 xfs_extlen_t *blen);
116
117#endif /* __XFS_RTALLOC_H__ */