]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libxfs/libxfs_priv.h
libxfs: disambiguate xfs.h
[thirdparty/xfsprogs-dev.git] / libxfs / libxfs_priv.h
1 /*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 /*
20 * This header is effectively a "namespace multiplexor" for the
21 * user level XFS code. It provides all of the necessary stuff
22 * such that we can build some parts of the XFS kernel code in
23 * user space in a controlled fashion, and translates the names
24 * used in the kernel into the names which libxfs is going to
25 * make available to user tools.
26 *
27 * It should only ever be #include'd by XFS "kernel" code being
28 * compiled in user space.
29 *
30 * Our goals here are to...
31 * o "share" large amounts of complex code between user and
32 * kernel space;
33 * o shield the user tools from changes in the bleeding
34 * edge kernel code, merging source changes when
35 * convenient and not immediately (no symlinks);
36 * o i.e. be able to merge changes to the kernel source back
37 * into the affected user tools in a controlled fashion;
38 * o provide a _minimalist_ life-support system for kernel
39 * code in user land, not the "everything + the kitchen
40 * sink" model which libsim had mutated into;
41 * o allow the kernel code to be completely free of code
42 * specifically there to support the user level build.
43 */
44
45 /*
46 * define a guard and something we can check to determine what include context
47 * we are running from.
48 */
49 #ifndef __LIBXFS_INTERNAL_XFS_H__
50 #define __LIBXFS_INTERNAL_XFS_H__
51
52 /*
53 * repair doesn't have a inode when it calls libxfs_dir2_data_freescan,
54 * so we map this internally for now.
55 */
56 #define xfs_dir2_data_freescan(ip, hdr, loghead) \
57 __xfs_dir2_data_freescan((ip)->i_mount->m_dir_geo, \
58 (ip)->d_ops, hdr, loghead)
59
60 /*
61 * start by remapping all the symbols we expect external users to call
62 * to the libxfs_ namespace. This ensures that all internal symbols are
63 * remapped correctly throughout all the included header files
64 * as well as in the C code.
65 */
66 #define xfs_alloc_fix_freelist libxfs_alloc_fix_freelist
67 #define xfs_attr_get libxfs_attr_get
68 #define xfs_attr_set libxfs_attr_set
69 #define xfs_attr_remove libxfs_attr_remove
70 #define xfs_rtfree_extent libxfs_rtfree_extent
71
72 #define xfs_fs_repair_cmn_err libxfs_fs_repair_cmn_err
73 #define xfs_fs_cmn_err libxfs_fs_cmn_err
74
75 #define xfs_bmap_finish libxfs_bmap_finish
76 #define xfs_trans_ichgtime libxfs_trans_ichgtime
77
78 #define xfs_trans_alloc libxfs_trans_alloc
79 #define xfs_trans_add_item libxfs_trans_add_item
80 #define xfs_trans_bhold libxfs_trans_bhold
81 #define xfs_trans_binval libxfs_trans_binval
82 #define xfs_trans_bjoin libxfs_trans_bjoin
83 #define xfs_trans_brelse libxfs_trans_brelse
84 #define xfs_trans_commit libxfs_trans_commit
85 #define xfs_trans_cancel libxfs_trans_cancel
86 #define xfs_trans_del_item libxfs_trans_del_item
87 #define xfs_trans_dup libxfs_trans_dup
88 #define xfs_trans_get_buf libxfs_trans_get_buf
89 #define xfs_trans_getsb libxfs_trans_getsb
90 #define xfs_trans_iget libxfs_trans_iget
91 #define xfs_trans_ijoin libxfs_trans_ijoin
92 #define xfs_trans_ijoin_ref libxfs_trans_ijoin_ref
93 #define xfs_trans_init libxfs_trans_init
94 #define xfs_trans_inode_alloc_buf libxfs_trans_inode_alloc_buf
95 #define xfs_trans_log_buf libxfs_trans_log_buf
96 #define xfs_trans_log_inode libxfs_trans_log_inode
97 #define xfs_trans_mod_sb libxfs_trans_mod_sb
98 #define xfs_trans_read_buf libxfs_trans_read_buf
99 #define xfs_trans_read_buf_map libxfs_trans_read_buf_map
100 #define xfs_trans_roll libxfs_trans_roll
101 #define xfs_trans_get_buf_map libxfs_trans_get_buf_map
102 #define xfs_trans_reserve libxfs_trans_reserve
103
104 /* xfs_attr_leaf.h */
105 #define xfs_attr_leaf_newentsize libxfs_attr_leaf_newentsize
106
107 /* xfs_bit.h */
108 #define xfs_highbit32 libxfs_highbit32
109 #define xfs_highbit64 libxfs_highbit64
110
111 /* xfs_bmap.h */
112 #define xfs_bmap_cancel libxfs_bmap_cancel
113 #define xfs_bmap_last_offset libxfs_bmap_last_offset
114 #define xfs_bmapi_write libxfs_bmapi_write
115 #define xfs_bmapi_read libxfs_bmapi_read
116 #define xfs_bunmapi libxfs_bunmapi
117
118 /* xfs_bmap_btree.h */
119 #define xfs_bmbt_get_all libxfs_bmbt_get_all
120
121 /* xfs_da_btree.h */
122 #define xfs_da_brelse libxfs_da_brelse
123 #define xfs_da_hashname libxfs_da_hashname
124 #define xfs_da_shrink_inode libxfs_da_shrink_inode
125 #define xfs_da_read_buf libxfs_da_read_buf
126
127 /* xfs_dir2.h */
128 #define xfs_dir_createname libxfs_dir_createname
129 #define xfs_dir_init libxfs_dir_init
130 #define xfs_dir_lookup libxfs_dir_lookup
131 #define xfs_dir_replace libxfs_dir_replace
132 #define xfs_dir2_isblock libxfs_dir2_isblock
133 #define xfs_dir2_isleaf libxfs_dir2_isleaf
134
135 /* xfs_dir2_data.h */
136 #define __xfs_dir2_data_freescan libxfs_dir2_data_freescan
137 #define xfs_dir2_data_log_entry libxfs_dir2_data_log_entry
138 #define xfs_dir2_data_log_header libxfs_dir2_data_log_header
139 #define xfs_dir2_data_make_free libxfs_dir2_data_make_free
140 #define xfs_dir2_data_use_free libxfs_dir2_data_use_free
141 #define xfs_dir2_shrink_inode libxfs_dir2_shrink_inode
142
143 /* xfs_inode.h */
144 #define xfs_dinode_from_disk libxfs_dinode_from_disk
145 #define xfs_dinode_to_disk libxfs_dinode_to_disk
146 #define xfs_dinode_calc_crc libxfs_dinode_calc_crc
147 #define xfs_idata_realloc libxfs_idata_realloc
148 #define xfs_idestroy_fork libxfs_idestroy_fork
149
150 #define xfs_dinode_verify libxfs_dinode_verify
151
152 /* xfs_sb.h */
153 #define xfs_log_sb libxfs_log_sb
154 #define xfs_sb_from_disk libxfs_sb_from_disk
155 #define xfs_sb_quota_from_disk libxfs_sb_quota_from_disk
156 #define xfs_sb_to_disk libxfs_sb_to_disk
157
158 /* xfs_symlink.h */
159 #define xfs_symlink_blocks libxfs_symlink_blocks
160 #define xfs_symlink_hdr_ok libxfs_symlink_hdr_ok
161
162 /* xfs_trans_resv.h */
163 #define xfs_trans_resv_calc libxfs_trans_resv_calc
164
165
166 /*
167 * Now we've renamed and mapped everything, include the rest of the external
168 * libxfs headers.
169 */
170 #include <xfs/platform_defs.h>
171
172 #include <xfs/list.h>
173 #include <xfs/hlist.h>
174 #include <xfs/cache.h>
175 #include <xfs/bitops.h>
176 #include <xfs/kmem.h>
177 #include <xfs/radix-tree.h>
178 #include <xfs/swab.h>
179 #include <xfs/atomic.h>
180
181 #include <xfs/xfs_types.h>
182 #include <xfs/xfs_arch.h>
183
184 #include <xfs/xfs_fs.h>
185
186 /* CRC stuff, buffer API dependent on it */
187 extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
188 extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
189
190 #define crc32(c,p,l) crc32_le((c),(unsigned char const *)(p),(l))
191 #define crc32c(c,p,l) crc32c_le((c),(unsigned char const *)(p),(l))
192
193 #include <xfs/xfs_cksum.h>
194
195 /*
196 * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
197 * every files via a similar include in the kernel xfs_linux.h.
198 */
199 #include <xfs/libxfs_io.h>
200
201 /* for all the support code that uses progname in error messages */
202 extern char *progname;
203
204 #undef ASSERT
205 #define ASSERT(ex) assert(ex)
206
207 typedef __uint32_t uint_t;
208 typedef __uint32_t inst_t; /* an instruction */
209
210 #ifndef EWRONGFS
211 #define EWRONGFS EINVAL
212 #endif
213
214 #define xfs_error_level 0
215
216 #define STATIC static
217
218 /* XXX: need to push these out to make LIBXFS_ATTR defines */
219 #define ATTR_ROOT 0x0002
220 #define ATTR_SECURE 0x0008
221 #define ATTR_CREATE 0x0010
222 #define ATTR_REPLACE 0x0020
223 #define ATTR_KERNOTIME 0
224 #define ATTR_KERNOVAL 0
225
226 #define IHOLD(ip) ((void) 0)
227
228 #define XFS_IGET_CREATE 0x1
229 #define XFS_IGET_UNTRUSTED 0x2
230
231 extern void cmn_err(int, char *, ...);
232 enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
233
234 #define xfs_notice(mp,fmt,args...) cmn_err(CE_NOTE,fmt, ## args)
235 #define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
236 #define xfs_hex_dump(d,n) ((void) 0)
237
238
239 /* stop unused var warnings by assigning mp to itself */
240 #define XFS_CORRUPTION_ERROR(e,l,mp,m) do { \
241 (mp) = (mp); \
242 cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e)); \
243 } while (0)
244
245 #define XFS_ERROR_REPORT(e,l,mp) do { \
246 (mp) = (mp); \
247 cmn_err(CE_ALERT, "%s: XFS_ERROR_REPORT", (e)); \
248 } while (0)
249
250 #define XFS_QM_DQATTACH(mp,ip,flags) 0
251 #define XFS_ERRLEVEL_LOW 1
252 #define XFS_FORCED_SHUTDOWN(mp) 0
253 #define XFS_ILOCK_EXCL 0
254 #define XFS_STATS_INC(count) do { } while (0)
255 #define XFS_STATS_DEC(count, x) do { } while (0)
256 #define XFS_STATS_ADD(count, x) do { } while (0)
257 #define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta) do { } while (0)
258 #define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
259 #define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
260 #define XFS_TEST_ERROR(expr,a,b,c) ( expr )
261 #define XFS_WANT_CORRUPTED_GOTO(mp, expr, l) \
262 { if (!(expr)) { error = EFSCORRUPTED; goto l; } }
263 #define XFS_WANT_CORRUPTED_RETURN(mp, expr) \
264 { if (!(expr)) { return EFSCORRUPTED; } }
265
266 #ifdef __GNUC__
267 #define __return_address __builtin_return_address(0)
268 #endif
269
270 #define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
271
272 /* miscellaneous kernel routines not in user space */
273 #define down_read(a) ((void) 0)
274 #define up_read(a) ((void) 0)
275 #define spin_lock_init(a) ((void) 0)
276 #define spin_lock(a) ((void) 0)
277 #define spin_unlock(a) ((void) 0)
278 #define likely(x) (x)
279 #define unlikely(x) (x)
280 #define rcu_read_lock() ((void) 0)
281 #define rcu_read_unlock() ((void) 0)
282 #define WARN_ON_ONCE(expr) ((void) 0)
283
284 #define percpu_counter_read(x) (*x)
285 #define percpu_counter_sum(x) (*x)
286
287 /*
288 * prandom_u32 is used for di_gen inode allocation, it must be zero for libxfs
289 * or all sorts of badness can occur!
290 */
291 #define prandom_u32() 0
292
293 #define PAGE_CACHE_SIZE getpagesize()
294
295 static inline int __do_div(unsigned long long *n, unsigned base)
296 {
297 int __res;
298 __res = (int)(((unsigned long) *n) % (unsigned) base);
299 *n = ((unsigned long) *n) / (unsigned) base;
300 return __res;
301 }
302
303 #define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
304 #define do_mod(a, b) ((a) % (b))
305 #define rol32(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
306
307 #define min_t(type,x,y) \
308 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
309 #define max_t(type,x,y) \
310 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
311
312
313
314 static inline __attribute__((const))
315 int is_power_of_2(unsigned long n)
316 {
317 return (n != 0 && ((n & (n - 1)) == 0));
318 }
319
320 /*
321 * xfs_iroundup: round up argument to next power of two
322 */
323 static inline uint
324 roundup_pow_of_two(uint v)
325 {
326 int i;
327 uint m;
328
329 if ((v & (v - 1)) == 0)
330 return v;
331 ASSERT((v & 0x80000000) == 0);
332 if ((v & (v + 1)) == 0)
333 return v + 1;
334 for (i = 0, m = 1; i < 31; i++, m <<= 1) {
335 if (v & m)
336 continue;
337 v |= m;
338 if ((v & (v + 1)) == 0)
339 return v + 1;
340 }
341 ASSERT(0);
342 return 0;
343 }
344
345 static inline __uint64_t
346 roundup_64(__uint64_t x, __uint32_t y)
347 {
348 x += y - 1;
349 do_div(x, y);
350 return x * y;
351 }
352
353 #define __round_mask(x, y) ((__typeof__(x))((y)-1))
354 #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
355 #define round_down(x, y) ((x) & ~__round_mask(x, y))
356
357 /* buffer management */
358 #define XFS_BUF_LOCK 0
359 #define XFS_BUF_TRYLOCK 0
360 #define XBF_LOCK XFS_BUF_LOCK
361 #define XBF_TRYLOCK XFS_BUF_TRYLOCK
362 #define XBF_DONT_BLOCK 0
363 #define XBF_UNMAPPED 0
364 #define XBF_DONE 0
365 #define XFS_BUF_GETERROR(bp) 0
366 #define XFS_BUF_DONE(bp) ((bp)->b_flags |= LIBXFS_B_UPTODATE)
367 #define XFS_BUF_ISDONE(bp) ((bp)->b_flags & LIBXFS_B_UPTODATE)
368 #define xfs_buf_stale(bp) ((bp)->b_flags |= LIBXFS_B_STALE)
369 #define XFS_BUF_UNDELAYWRITE(bp) ((bp)->b_flags &= ~LIBXFS_B_DIRTY)
370 #define XFS_BUF_SET_VTYPE(a,b) ((void) 0)
371 #define XFS_BUF_SET_VTYPE_REF(a,b,c) ((void) 0)
372 #define XFS_BUF_SET_BDSTRAT_FUNC(a,b) ((void) 0)
373
374 /* avoid gcc warning */
375 #define xfs_incore(bt,blkno,len,lockit) ({ \
376 typeof(blkno) __foo = (blkno); \
377 typeof(len) __bar = (len); \
378 (blkno) = __foo; \
379 (len) = __bar; /* no set-but-unused warning */ \
380 NULL; \
381 })
382 #define xfs_buf_relse(bp) libxfs_putbuf(bp)
383 #define xfs_buf_get(devp,blkno,len,f) (libxfs_getbuf((devp), (blkno), (len)))
384 #define xfs_bwrite(bp) libxfs_writebuf((bp), 0)
385 #define xfs_buf_delwri_queue(bp, bl) libxfs_writebuf((bp), 0)
386
387 #define XBRW_READ LIBXFS_BREAD
388 #define XBRW_WRITE LIBXFS_BWRITE
389 #define xfs_buf_iomove(bp,off,len,data,f) libxfs_iomove(bp,off,len,data,f)
390 #define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
391
392 /* mount stuff */
393 #define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES
394 #define XFS_MOUNT_ATTR2 LIBXFS_MOUNT_ATTR2
395 #define XFS_MOUNT_SMALL_INUMS 0 /* ignored in userspace */
396 #define XFS_MOUNT_WSYNC 0 /* ignored in userspace */
397 #define XFS_MOUNT_NOALIGN 0 /* ignored in userspace */
398 #define XFS_MOUNT_IKEEP 0 /* ignored in userspace */
399 #define XFS_MOUNT_SWALLOC 0 /* ignored in userspace */
400 #define XFS_MOUNT_RDONLY 0 /* ignored in userspace */
401
402
403 #define _xfs_trans_alloc(mp, type, f) libxfs_trans_alloc(mp, type)
404 #define xfs_trans_get_block_res(tp) 1
405 #define xfs_trans_set_sync(tp) ((void) 0)
406 #define xfs_trans_ordered_buf(tp, bp) ((void) 0)
407 #define xfs_trans_agblocks_delta(tp, d)
408 #define xfs_trans_agflist_delta(tp, d)
409 #define xfs_trans_agbtree_delta(tp, d)
410 #define xfs_trans_buf_set_type(tp, bp, t) ({ \
411 int __t = (t); \
412 __t = __t; /* no set-but-unused warning */ \
413 })
414
415 #define xfs_trans_buf_copy_type(dbp, sbp)
416
417 /* no readahead, need to avoid set-but-unused var warnings. */
418 #define xfs_buf_readahead(a,d,c,ops) ({ \
419 xfs_daddr_t __d = d; \
420 __d = __d; /* no set-but-unused warning */ \
421 })
422 #define xfs_buf_readahead_map(a,b,c,ops) ((void) 0) /* no readahead */
423 #define xfs_buftrace(x,y) ((void) 0) /* debug only */
424
425 #define xfs_cmn_err(tag,level,mp,fmt,args...) cmn_err(level,fmt, ## args)
426 #define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
427 #define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
428 #define xfs_alert_tag(mp,tag,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
429
430 #define xfs_dir2_trace_args(where, args) ((void) 0)
431 #define xfs_dir2_trace_args_b(where, args, bp) ((void) 0)
432 #define xfs_dir2_trace_args_bb(where, args, lbp, dbp) ((void) 0)
433 #define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) ((void) 0)
434 #define xfs_dir2_trace_args_db(where, args, db, bp) ((void) 0)
435 #define xfs_dir2_trace_args_i(where, args, i) ((void) 0)
436 #define xfs_dir2_trace_args_s(where, args, s) ((void) 0)
437 #define xfs_dir2_trace_args_sb(where, args, s, bp) ((void) 0)
438 #define xfs_sort qsort
439
440 #define xfs_icsb_reinit_counters(mp) do { } while (0)
441 #define xfs_initialize_perag_icache(pag) ((void) 0)
442
443 #define xfs_ilock(ip,mode) ((void) 0)
444 #define xfs_ilock_nowait(ip,mode) ((void) 0)
445 #define xfs_ilock_demote(ip,mode) ((void) 0)
446 #define xfs_ilock_data_map_shared(ip) (0)
447 #define xfs_ilock_attr_map_shared(ip) (0)
448 #define xfs_iunlock(ip,mode) ({ \
449 typeof(mode) __mode = mode; \
450 __mode = __mode; /* no set-but-unused warning */ \
451 })
452 #define __xfs_flock(ip) ((void) 0)
453
454 /* space allocation */
455 #define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)
456 #define xfs_extent_busy_insert(tp,ag,bno,len,flags) ((void) 0)
457 #define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
458 do { \
459 *(bno) = (fbno); \
460 *(len) = (flen); \
461 } while (0)
462
463 /* avoid unused variable warning */
464 #define xfs_alloc_busy_insert(tp,ag,b,len) ({ \
465 xfs_agnumber_t __foo = ag; \
466 __foo = 0; \
467 })
468
469 #define xfs_rotorstep 1
470 #define xfs_bmap_rtalloc(a) (ENOSYS)
471 #define xfs_rtpick_extent(mp,tp,len,p) (ENOSYS)
472 #define xfs_get_extsz_hint(ip) (0)
473 #define xfs_inode_is_filestream(ip) (0)
474 #define xfs_filestream_lookup_ag(ip) (0)
475 #define xfs_filestream_new_ag(ip,ag) (0)
476
477 #define xfs_log_force(mp,flags) ((void) 0)
478 #define XFS_LOG_SYNC 1
479
480 /* quota bits */
481 #define xfs_trans_mod_dquot_byino(t,i,f,d) ((void) 0)
482 #define xfs_trans_reserve_quota_nblks(t,i,b,n,f) (0)
483 #define xfs_trans_unreserve_quota_nblks(t,i,b,n,f) ((void) 0)
484 #define xfs_qm_dqattach(i,f) (0)
485
486 #define uuid_copy(s,d) platform_uuid_copy((s),(d))
487 #define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0)
488
489 #define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0)
490 #define xfs_sb_validate_fsb_count(sbp, nblks) (0)
491
492 /*
493 * Prototypes for kernel static functions that are aren't in their
494 * associated header files.
495 */
496 struct xfs_da_args;
497 struct xfs_bmap_free;
498 struct xfs_bmap_free_item;
499 struct xfs_mount;
500 struct xfs_sb;
501 struct xfs_trans;
502 struct xfs_inode;
503 struct xfs_log_item;
504 struct xfs_buf;
505 struct xfs_buf_map;
506 struct xfs_buf_log_item;
507 struct xfs_buftarg;
508
509 /* xfs_attr.c */
510 int xfs_attr_rmtval_get(struct xfs_da_args *);
511
512 /* xfs_bmap.c */
513 void xfs_bmap_del_free(struct xfs_bmap_free *, struct xfs_bmap_free_item *,
514 struct xfs_bmap_free_item *);
515
516 /* xfs_mount.c */
517 int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
518 void xfs_mount_common(struct xfs_mount *, struct xfs_sb *);
519
520 /*
521 * logitem.c and trans.c prototypes
522 */
523 void xfs_trans_init(struct xfs_mount *);
524 int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
525
526 /* xfs_trans_item.c */
527 void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *);
528 void xfs_trans_del_item(struct xfs_log_item *);
529 void xfs_trans_free_items(struct xfs_trans *, int);
530
531 /* xfs_inode_item.c */
532 void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
533
534 /* xfs_buf_item.c */
535 void xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
536 void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint);
537
538 /* xfs_trans_buf.c */
539 struct xfs_buf *xfs_trans_buf_item_match(struct xfs_trans *,
540 struct xfs_buftarg *, struct xfs_buf_map *, int);
541
542 /* local source files */
543 #define xfs_mod_fdblocks(mp, delta, rsvd) \
544 libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FDBLOCKS, delta, rsvd)
545 #define xfs_mod_frextents(mp, delta) \
546 libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FREXTENTS, delta, 0)
547 int libxfs_mod_incore_sb(struct xfs_mount *, int, int64_t, int);
548 void xfs_reinit_percpu_counters(struct xfs_mount *mp);
549
550 void xfs_trans_mod_sb(struct xfs_trans *, uint, long);
551 void xfs_trans_init(struct xfs_mount *);
552 int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
553 void xfs_verifier_error(struct xfs_buf *bp);
554
555 /* XXX: this is clearly a bug - a shared header needs to export this */
556 /* xfs_rtalloc.c */
557 int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
558
559 #endif /* __LIBXFS_INTERNAL_XFS_H__ */