6b13f685e
김민수
BSP 최초 추가
|
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
#ifndef __XFS_ALLOC_H__
#define __XFS_ALLOC_H__
struct xfs_buf;
struct xfs_btree_cur;
struct xfs_mount;
struct xfs_perag;
struct xfs_trans;
extern struct workqueue_struct *xfs_alloc_wq;
#define XFS_ALLOCTYPE_ANY_AG 0x01 /* allocate anywhere, use rotor */
#define XFS_ALLOCTYPE_FIRST_AG 0x02 /* ... start at ag 0 */
#define XFS_ALLOCTYPE_START_AG 0x04 /* anywhere, start in this a.g. */
#define XFS_ALLOCTYPE_THIS_AG 0x08 /* anywhere in this a.g. */
#define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */
#define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */
#define XFS_ALLOCTYPE_THIS_BNO 0x40 /* at exactly this block */
typedef unsigned int xfs_alloctype_t;
#define XFS_ALLOC_TYPES \
{ XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \
{ XFS_ALLOCTYPE_FIRST_AG, "FIRST_AG" }, \
{ XFS_ALLOCTYPE_START_AG, "START_AG" }, \
{ XFS_ALLOCTYPE_THIS_AG, "THIS_AG" }, \
{ XFS_ALLOCTYPE_START_BNO, "START_BNO" }, \
{ XFS_ALLOCTYPE_NEAR_BNO, "NEAR_BNO" }, \
{ XFS_ALLOCTYPE_THIS_BNO, "THIS_BNO" }
#define XFS_ALLOC_FLAG_TRYLOCK 0x00000001 /* use trylock for buffer locking */
#define XFS_ALLOC_FLAG_FREEING 0x00000002 /* indicate caller is freeing extents*/
#define XFS_ALLOC_SET_ASIDE(mp) (4 + ((mp)->m_sb.sb_agcount * 4))
#define XFS_ALLOC_AG_MAX_USABLE(mp) \
((mp)->m_sb.sb_agblocks - XFS_BB_TO_FSB(mp, XFS_FSS_TO_BB(mp, 4)) - 7)
typedef struct xfs_alloc_arg {
struct xfs_trans *tp;
struct xfs_mount *mp;
struct xfs_buf *agbp;
struct xfs_perag *pag;
xfs_fsblock_t fsbno;
xfs_agnumber_t agno;
xfs_agblock_t agbno;
xfs_extlen_t minlen;
xfs_extlen_t maxlen;
xfs_extlen_t mod;
xfs_extlen_t prod;
xfs_extlen_t minleft;
xfs_extlen_t total;
xfs_extlen_t alignment;
xfs_extlen_t minalignslop;
xfs_extlen_t len;
xfs_alloctype_t type;
xfs_alloctype_t otype;
char wasdel;
char wasfromfl;
char isfl;
char userdata;
xfs_fsblock_t firstblock;
} xfs_alloc_arg_t;
#define XFS_ALLOC_USERDATA 1 /* allocation is for user data*/
#define XFS_ALLOC_INITIAL_USER_DATA 2 /* special case start of file */
xfs_extlen_t
xfs_alloc_longest_free_extent(struct xfs_mount *mp,
struct xfs_perag *pag);
void
xfs_alloc_compute_maxlevels(
struct xfs_mount *mp);
int
xfs_alloc_get_freelist(
struct xfs_trans *tp,
struct xfs_buf *agbp,
xfs_agblock_t *bnop,
int btreeblk);
void
xfs_alloc_log_agf(
struct xfs_trans *tp,
struct xfs_buf *bp,
int fields);
int
xfs_alloc_pagf_init(
struct xfs_mount *mp,
struct xfs_trans *tp,
xfs_agnumber_t agno,
int flags);
int
xfs_alloc_put_freelist(
struct xfs_trans *tp,
struct xfs_buf *agbp,
struct xfs_buf *agflbp,
xfs_agblock_t bno,
int btreeblk);
int
xfs_alloc_read_agf(
struct xfs_mount *mp,
struct xfs_trans *tp,
xfs_agnumber_t agno,
int flags,
struct xfs_buf **bpp);
int
xfs_alloc_vextent(
xfs_alloc_arg_t *args);
int
xfs_free_extent(
struct xfs_trans *tp,
xfs_fsblock_t bno,
xfs_extlen_t len);
int
xfs_alloc_lookup_le(
struct xfs_btree_cur *cur,
xfs_agblock_t bno,
xfs_extlen_t len,
int *stat);
int
xfs_alloc_lookup_ge(
struct xfs_btree_cur *cur,
xfs_agblock_t bno,
xfs_extlen_t len,
int *stat);
int
xfs_alloc_get_rec(
struct xfs_btree_cur *cur,
xfs_agblock_t *bno,
xfs_extlen_t *len,
int *stat);
#endif /* __XFS_ALLOC_H__ */
|