]>
Commit | Line | Data |
---|---|---|
a8616431 DW |
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_RTBITMAP_H__ | |
7 | #define __XFS_RTBITMAP_H__ | |
8 | ||
9 | /* | |
10 | * XXX: Most of the realtime allocation functions deal in units of realtime | |
11 | * extents, not realtime blocks. This looks funny when paired with the type | |
12 | * name and screams for a larger cleanup. | |
13 | */ | |
14 | struct xfs_rtalloc_rec { | |
15 | xfs_rtblock_t ar_startext; | |
16 | xfs_rtblock_t ar_extcount; | |
17 | }; | |
18 | ||
19 | typedef int (*xfs_rtalloc_query_range_fn)( | |
20 | struct xfs_mount *mp, | |
21 | struct xfs_trans *tp, | |
22 | const struct xfs_rtalloc_rec *rec, | |
23 | void *priv); | |
24 | ||
25 | #ifdef CONFIG_XFS_RT | |
26 | int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp, | |
75986bcb | 27 | xfs_fileoff_t block, int issum, struct xfs_buf **bpp); |
a8616431 | 28 | int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp, |
73b5e770 | 29 | xfs_rtblock_t start, xfs_rtxlen_t len, int val, |
a8616431 DW |
30 | xfs_rtblock_t *new, int *stat); |
31 | int xfs_rtfind_back(struct xfs_mount *mp, struct xfs_trans *tp, | |
32 | xfs_rtblock_t start, xfs_rtblock_t limit, | |
33 | xfs_rtblock_t *rtblock); | |
34 | int xfs_rtfind_forw(struct xfs_mount *mp, struct xfs_trans *tp, | |
35 | xfs_rtblock_t start, xfs_rtblock_t limit, | |
36 | xfs_rtblock_t *rtblock); | |
37 | int xfs_rtmodify_range(struct xfs_mount *mp, struct xfs_trans *tp, | |
73b5e770 | 38 | xfs_rtblock_t start, xfs_rtxlen_t len, int val); |
a8616431 | 39 | int xfs_rtmodify_summary_int(struct xfs_mount *mp, struct xfs_trans *tp, |
75986bcb DW |
40 | int log, xfs_fileoff_t bbno, int delta, |
41 | struct xfs_buf **rbpp, xfs_fileoff_t *rsb, | |
a8616431 DW |
42 | xfs_suminfo_t *sum); |
43 | int xfs_rtmodify_summary(struct xfs_mount *mp, struct xfs_trans *tp, int log, | |
75986bcb DW |
44 | xfs_fileoff_t bbno, int delta, struct xfs_buf **rbpp, |
45 | xfs_fileoff_t *rsb); | |
a8616431 | 46 | int xfs_rtfree_range(struct xfs_mount *mp, struct xfs_trans *tp, |
73b5e770 | 47 | xfs_rtblock_t start, xfs_rtxlen_t len, |
75986bcb | 48 | struct xfs_buf **rbpp, xfs_fileoff_t *rsb); |
a8616431 DW |
49 | int xfs_rtalloc_query_range(struct xfs_mount *mp, struct xfs_trans *tp, |
50 | const struct xfs_rtalloc_rec *low_rec, | |
51 | const struct xfs_rtalloc_rec *high_rec, | |
52 | xfs_rtalloc_query_range_fn fn, void *priv); | |
53 | int xfs_rtalloc_query_all(struct xfs_mount *mp, struct xfs_trans *tp, | |
54 | xfs_rtalloc_query_range_fn fn, | |
55 | void *priv); | |
a8616431 | 56 | int xfs_rtalloc_extent_is_free(struct xfs_mount *mp, struct xfs_trans *tp, |
73b5e770 | 57 | xfs_rtblock_t start, xfs_rtxlen_t len, |
a8616431 DW |
58 | bool *is_free); |
59 | /* | |
60 | * Free an extent in the realtime subvolume. Length is expressed in | |
61 | * realtime extents, as is the block number. | |
62 | */ | |
63 | int /* error */ | |
64 | xfs_rtfree_extent( | |
65 | struct xfs_trans *tp, /* transaction pointer */ | |
66 | xfs_rtblock_t bno, /* starting block number to free */ | |
73b5e770 | 67 | xfs_rtxlen_t len); /* length of extent freed */ |
a8616431 DW |
68 | |
69 | /* Same as above, but in units of rt blocks. */ | |
70 | int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno, | |
71 | xfs_filblks_t rtlen); | |
72 | #else /* CONFIG_XFS_RT */ | |
73 | # define xfs_rtfree_extent(t,b,l) (-ENOSYS) | |
74 | # define xfs_rtfree_blocks(t,rb,rl) (-ENOSYS) | |
75 | # define xfs_rtalloc_query_range(m,t,l,h,f,p) (-ENOSYS) | |
76 | # define xfs_rtalloc_query_all(m,t,f,p) (-ENOSYS) | |
77 | # define xfs_rtbuf_get(m,t,b,i,p) (-ENOSYS) | |
78 | # define xfs_rtalloc_extent_is_free(m,t,s,l,i) (-ENOSYS) | |
79 | #endif /* CONFIG_XFS_RT */ | |
80 | ||
81 | #endif /* __XFS_RTBITMAP_H__ */ |