]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - libxfs/xfs.h
libxfs: update to match 3.19-rc1 kernel code
[thirdparty/xfsprogs-dev.git] / libxfs / xfs.h
CommitLineData
2bd0ea18 1/*
da23017d
NS
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
2bd0ea18 4 *
da23017d
NS
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
2bd0ea18
NS
7 * published by the Free Software Foundation.
8 *
da23017d
NS
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.
2bd0ea18 13 *
da23017d
NS
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
2bd0ea18
NS
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.
dfc130f3 29 *
2bd0ea18
NS
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
f616e2bf
DC
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 * start by remapping all the symbols we expect external users to call
54 * to the libxfs_ namespace. This ensures that all internal symbols are
55 * remapped correctly throughout all the included header files
56 * as well as in the C code.
57 */
58#define xfs_alloc_fix_freelist libxfs_alloc_fix_freelist
59#define xfs_attr_get libxfs_attr_get
60#define xfs_attr_set libxfs_attr_set
61#define xfs_attr_remove libxfs_attr_remove
62#define xfs_rtfree_extent libxfs_rtfree_extent
63
64#define xfs_fs_repair_cmn_err libxfs_fs_repair_cmn_err
65#define xfs_fs_cmn_err libxfs_fs_cmn_err
66
67#define xfs_bmap_finish libxfs_bmap_finish
68#define xfs_trans_ichgtime libxfs_trans_ichgtime
69#define xfs_mod_incore_sb libxfs_mod_incore_sb
70
71#define xfs_trans_alloc libxfs_trans_alloc
72#define xfs_trans_add_item libxfs_trans_add_item
73#define xfs_trans_bhold libxfs_trans_bhold
74#define xfs_trans_binval libxfs_trans_binval
75#define xfs_trans_bjoin libxfs_trans_bjoin
76#define xfs_trans_brelse libxfs_trans_brelse
77#define xfs_trans_commit libxfs_trans_commit
78#define xfs_trans_cancel libxfs_trans_cancel
79#define xfs_trans_del_item libxfs_trans_del_item
80#define xfs_trans_dup libxfs_trans_dup
81#define xfs_trans_get_buf libxfs_trans_get_buf
82#define xfs_trans_getsb libxfs_trans_getsb
83#define xfs_trans_iget libxfs_trans_iget
84#define xfs_trans_ijoin libxfs_trans_ijoin
85#define xfs_trans_ijoin_ref libxfs_trans_ijoin_ref
86#define xfs_trans_init libxfs_trans_init
87#define xfs_trans_inode_alloc_buf libxfs_trans_inode_alloc_buf
88#define xfs_trans_log_buf libxfs_trans_log_buf
89#define xfs_trans_log_inode libxfs_trans_log_inode
90#define xfs_trans_mod_sb libxfs_trans_mod_sb
91#define xfs_trans_read_buf libxfs_trans_read_buf
92#define xfs_trans_read_buf_map libxfs_trans_read_buf_map
93#define xfs_trans_roll libxfs_trans_roll
94#define xfs_trans_get_buf_map libxfs_trans_get_buf_map
95#define xfs_trans_reserve libxfs_trans_reserve
96
97/* xfs_attr_leaf.h */
98#define xfs_attr_leaf_newentsize libxfs_attr_leaf_newentsize
99
100/* xfs_bit.h */
101#define xfs_highbit32 libxfs_highbit32
102#define xfs_highbit64 libxfs_highbit64
103
104/* xfs_bmap.h */
105#define xfs_bmap_cancel libxfs_bmap_cancel
106#define xfs_bmap_last_offset libxfs_bmap_last_offset
107#define xfs_bmapi_write libxfs_bmapi_write
108#define xfs_bmapi_read libxfs_bmapi_read
109#define xfs_bunmapi libxfs_bunmapi
110
111/* xfs_bmap_btree.h */
ff105f75 112#define xfs_bmbt_get_all libxfs_bmbt_get_all
f616e2bf
DC
113
114/* xfs_da_btree.h */
115#define xfs_da_brelse libxfs_da_brelse
116#define xfs_da_hashname libxfs_da_hashname
117#define xfs_da_shrink_inode libxfs_da_shrink_inode
118#define xfs_da_read_buf libxfs_da_read_buf
119
120/* xfs_dir2.h */
121#define xfs_dir_createname libxfs_dir_createname
122#define xfs_dir_init libxfs_dir_init
123#define xfs_dir_lookup libxfs_dir_lookup
124#define xfs_dir_replace libxfs_dir_replace
125#define xfs_dir2_isblock libxfs_dir2_isblock
126#define xfs_dir2_isleaf libxfs_dir2_isleaf
127
128/* xfs_dir2_data.h */
129#define xfs_dir2_data_freescan libxfs_dir2_data_freescan
130#define xfs_dir2_data_log_entry libxfs_dir2_data_log_entry
131#define xfs_dir2_data_log_header libxfs_dir2_data_log_header
132#define xfs_dir2_data_make_free libxfs_dir2_data_make_free
133#define xfs_dir2_data_use_free libxfs_dir2_data_use_free
134#define xfs_dir2_shrink_inode libxfs_dir2_shrink_inode
135
136/* xfs_inode.h */
137#define xfs_dinode_from_disk libxfs_dinode_from_disk
138#define xfs_dinode_to_disk libxfs_dinode_to_disk
139#define xfs_dinode_calc_crc libxfs_dinode_calc_crc
140#define xfs_idata_realloc libxfs_idata_realloc
141#define xfs_idestroy_fork libxfs_idestroy_fork
142
143#define xfs_dinode_verify libxfs_dinode_verify
144
145/* xfs_sb.h */
146#define xfs_mod_sb libxfs_mod_sb
147#define xfs_sb_from_disk libxfs_sb_from_disk
148#define xfs_sb_quota_from_disk libxfs_sb_quota_from_disk
149#define xfs_sb_to_disk libxfs_sb_to_disk
150
151/* xfs_symlink.h */
152#define xfs_symlink_blocks libxfs_symlink_blocks
153#define xfs_symlink_hdr_ok libxfs_symlink_hdr_ok
154
155/* xfs_trans_resv.h */
156#define xfs_trans_resv_calc libxfs_trans_resv_calc
157
158
159/*
160 * Now we've renamed and mapped everything, include the rest of the external
161 * libxfs headers.
162 */
1d7e80ee 163#include <xfs/libxfs.h>
a2ceac1f 164#include "xfs_dir2_priv.h"
2bd0ea18 165
a2ceac1f
DC
166#undef ASSERT
167#define ASSERT(ex) assert(ex)
5e656dbb 168
a2ceac1f 169typedef __uint32_t uint_t;
5e656dbb
BN
170typedef __uint32_t inst_t; /* an instruction */
171
613e6057
DC
172/*
173 * Argument structure for xfs_bmap_alloc.
174 */
175typedef struct xfs_bmalloca {
176 xfs_fsblock_t *firstblock; /* i/o first block allocated */
177 struct xfs_bmap_free *flist; /* bmap freelist */
178 struct xfs_trans *tp; /* transaction pointer */
179 struct xfs_inode *ip; /* incore inode pointer */
180 struct xfs_bmbt_irec prev; /* extent before the new one */
181 struct xfs_bmbt_irec got; /* extent after, or delayed */
182
183 xfs_fileoff_t offset; /* offset in file filling in */
184 xfs_extlen_t length; /* i/o length asked/allocated */
185 xfs_fsblock_t blkno; /* starting block of new extent */
186
187 struct xfs_btree_cur *cur; /* btree cursor */
188 xfs_extnum_t idx; /* current extent index */
189 int nallocs;/* number of extents alloc'd */
190 int logflags;/* flags for transaction logging */
191
192 xfs_extlen_t total; /* total blocks needed for xaction */
193 xfs_extlen_t minlen; /* minimum allocation size (blocks) */
194 xfs_extlen_t minleft; /* amount must be left after alloc */
195 char eof; /* set if allocating past last extent */
196 char wasdel; /* replacing a delayed allocation */
197 char userdata;/* set if is user data */
198 char aeof; /* allocated space at eof */
199 char conv; /* overwriting unwritten extents */
200 char stack_switch;
201 int flags;
202} xfs_bmalloca_t;
203
204#define xfs_bmapi_allocate __xfs_bmapi_allocate
205
a2ceac1f
DC
206#ifndef EWRONGFS
207#define EWRONGFS EINVAL
208#endif
5e656dbb 209
56b2de80 210#define xfs_error_level 0
5e656dbb
BN
211
212#define STATIC static
5e656dbb
BN
213
214#define ATTR_ROOT LIBXFS_ATTR_ROOT
215#define ATTR_SECURE LIBXFS_ATTR_SECURE
216#define ATTR_CREATE LIBXFS_ATTR_CREATE
217#define ATTR_REPLACE LIBXFS_ATTR_REPLACE
218#define ATTR_KERNOTIME 0
219#define ATTR_KERNOVAL 0
220
221#define IHOLD(ip) ((void) 0)
222
5dcd1db5
DC
223#define XFS_IGET_CREATE 0x1
224#define XFS_IGET_UNTRUSTED 0x2
225
a2ceac1f 226/* stop unused var warnings by assigning mp to itself */
e0607266
DC
227#define XFS_CORRUPTION_ERROR(e,l,mp,m) do { \
228 (mp) = (mp); \
229 cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e)); \
230} while (0)
231
232#define XFS_ERROR_REPORT(e,l,mp) do { \
233 (mp) = (mp); \
234 cmn_err(CE_ALERT, "%s: XFS_ERROR_REPORT", (e)); \
235} while (0)
236
5e656dbb 237#define XFS_QM_DQATTACH(mp,ip,flags) 0
5e656dbb
BN
238#define XFS_ERRLEVEL_LOW 1
239#define XFS_FORCED_SHUTDOWN(mp) 0
240#define XFS_ILOCK_EXCL 0
241#define XFS_STATS_INC(count) do { } while (0)
242#define XFS_STATS_DEC(count, x) do { } while (0)
243#define XFS_STATS_ADD(count, x) do { } while (0)
244#define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta) do { } while (0)
245#define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
246#define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
247#define XFS_TEST_ERROR(expr,a,b,c) ( expr )
248#define XFS_WANT_CORRUPTED_GOTO(expr,l) \
249 { if (!(expr)) { error = EFSCORRUPTED; goto l; } }
250#define XFS_WANT_CORRUPTED_RETURN(expr) \
251 { if (!(expr)) { return EFSCORRUPTED; } }
252
5e656dbb
BN
253#ifdef __GNUC__
254#define __return_address __builtin_return_address(0)
255#endif
256
364e85ec
DC
257#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
258
5e656dbb
BN
259/* miscellaneous kernel routines not in user space */
260#define down_read(a) ((void) 0)
261#define up_read(a) ((void) 0)
262#define spin_lock_init(a) ((void) 0)
263#define spin_lock(a) ((void) 0)
264#define spin_unlock(a) ((void) 0)
265#define likely(x) (x)
266#define unlikely(x) (x)
56b2de80
DC
267#define rcu_read_lock() ((void) 0)
268#define rcu_read_unlock() ((void) 0)
5e656dbb 269
2bd0ea18 270/*
49f693fa 271 * prandom_u32 is used for di_gen inode allocation, it must be zero for libxfs
5e656dbb 272 * or all sorts of badness can occur!
2bd0ea18 273 */
49f693fa 274#define prandom_u32() 0
2bd0ea18 275
5e656dbb 276#define PAGE_CACHE_SIZE getpagesize()
2bd0ea18 277
5e656dbb
BN
278static inline int __do_div(unsigned long long *n, unsigned base)
279{
280 int __res;
281 __res = (int)(((unsigned long) *n) % (unsigned) base);
282 *n = ((unsigned long) *n) / (unsigned) base;
283 return __res;
284}
285
286#define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
287#define do_mod(a, b) ((a) % (b))
288#define rol32(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
2bd0ea18 289
5e656dbb
BN
290#define min_t(type,x,y) \
291 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
292#define max_t(type,x,y) \
293 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
57c9fccb 294
91eba724 295
91eba724 296
5e656dbb
BN
297static inline __attribute__((const))
298int is_power_of_2(unsigned long n)
299{
300 return (n != 0 && ((n & (n - 1)) == 0));
301}
2bd0ea18
NS
302
303/*
5e656dbb 304 * xfs_iroundup: round up argument to next power of two
2bd0ea18 305 */
5e656dbb
BN
306static inline uint
307roundup_pow_of_two(uint v)
308{
309 int i;
310 uint m;
311
312 if ((v & (v - 1)) == 0)
313 return v;
314 ASSERT((v & 0x80000000) == 0);
315 if ((v & (v + 1)) == 0)
316 return v + 1;
317 for (i = 0, m = 1; i < 31; i++, m <<= 1) {
318 if (v & m)
319 continue;
320 v |= m;
321 if ((v & (v + 1)) == 0)
322 return v + 1;
323 }
324 ASSERT(0);
325 return 0;
326}
2bd0ea18 327
88cd79be
DC
328static inline __uint64_t
329roundup_64(__uint64_t x, __uint32_t y)
330{
331 x += y - 1;
332 do_div(x, y);
333 return x * y;
334}
335
2bd0ea18
NS
336/* buffer management */
337#define XFS_BUF_LOCK 0
2bd0ea18 338#define XFS_BUF_TRYLOCK 0
56b2de80
DC
339#define XBF_LOCK XFS_BUF_LOCK
340#define XBF_TRYLOCK XFS_BUF_TRYLOCK
341#define XBF_DONT_BLOCK 0
a2ceac1f 342#define XBF_UNMAPPED 0
e9d35108 343#define XBF_DONE 0
2bd0ea18 344#define XFS_BUF_GETERROR(bp) 0
f1b058f9
NS
345#define XFS_BUF_DONE(bp) ((bp)->b_flags |= LIBXFS_B_UPTODATE)
346#define XFS_BUF_ISDONE(bp) ((bp)->b_flags & LIBXFS_B_UPTODATE)
a2ceac1f 347#define xfs_buf_stale(bp) ((bp)->b_flags |= LIBXFS_B_STALE)
f1b058f9 348#define XFS_BUF_UNDELAYWRITE(bp) ((bp)->b_flags &= ~LIBXFS_B_DIRTY)
2bd0ea18
NS
349#define XFS_BUF_SET_VTYPE(a,b) ((void) 0)
350#define XFS_BUF_SET_VTYPE_REF(a,b,c) ((void) 0)
351#define XFS_BUF_SET_BDSTRAT_FUNC(a,b) ((void) 0)
5e656dbb 352
9d6fabc0
DC
353/* avoid gcc warning */
354#define xfs_incore(bt,blkno,len,lockit) ({ \
355 typeof(blkno) __foo = (blkno); \
6bddecbc 356 typeof(len) __bar = (len); \
9d6fabc0 357 (blkno) = __foo; \
6bddecbc 358 (len) = __bar; /* no set-but-unused warning */ \
9d6fabc0
DC
359 NULL; \
360})
2bd0ea18 361#define xfs_buf_relse(bp) libxfs_putbuf(bp)
75c8b434 362#define xfs_buf_get(devp,blkno,len,f) (libxfs_getbuf((devp), (blkno), (len)))
9d6fabc0 363#define xfs_bwrite(bp) libxfs_writebuf((bp), 0)
e9d35108 364#define xfs_buf_delwri_queue(bp, bl) libxfs_writebuf((bp), 0)
57c9fccb 365
56b2de80
DC
366#define XBRW_READ LIBXFS_BREAD
367#define XBRW_WRITE LIBXFS_BWRITE
368#define xfs_buf_iomove(bp,off,len,data,f) libxfs_iomove(bp,off,len,data,f)
369#define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
2bd0ea18 370
5e656dbb
BN
371/* mount stuff */
372#define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES
373#define XFS_MOUNT_ATTR2 LIBXFS_MOUNT_ATTR2
374#define XFS_MOUNT_SMALL_INUMS 0 /* ignored in userspace */
375#define XFS_MOUNT_WSYNC 0 /* ignored in userspace */
376#define XFS_MOUNT_NOALIGN 0 /* ignored in userspace */
3439d03a 377#define XFS_MOUNT_IKEEP 0 /* ignored in userspace */
ff105f75
DC
378#define XFS_MOUNT_SWALLOC 0 /* ignored in userspace */
379#define XFS_MOUNT_RDONLY 0 /* ignored in userspace */
5e656dbb 380
56b2de80
DC
381#define xfs_icsb_modify_counters(mp, field, delta, rsvd) \
382 xfs_mod_incore_sb(mp, field, delta, rsvd)
383
5e656dbb
BN
384
385#define xfs_trans_get_block_res(tp) 1
386#define xfs_trans_set_sync(tp) ((void) 0)
e9d35108 387#define xfs_trans_ordered_buf(tp, bp) ((void) 0)
5e656dbb
BN
388#define xfs_trans_agblocks_delta(tp, d)
389#define xfs_trans_agflist_delta(tp, d)
390#define xfs_trans_agbtree_delta(tp, d)
6bddecbc
DC
391#define xfs_trans_buf_set_type(tp, bp, t) ({ \
392 int __t = (t); \
393 __t = __t; /* no set-but-unused warning */ \
394})
395
8b4dc4a9 396#define xfs_trans_buf_copy_type(dbp, sbp)
5e656dbb 397
10851b18
DC
398/* no readahead, need to avoid set-but-unused var warnings. */
399#define xfs_buf_readahead(a,d,c,ops) ({ \
400 xfs_daddr_t __d = d; \
401 __d = __d; /* no set-but-unused warning */ \
402})
a2ceac1f 403#define xfs_buf_readahead_map(a,b,c,ops) ((void) 0) /* no readahead */
a2ceac1f 404#define xfs_buftrace(x,y) ((void) 0) /* debug only */
5e656dbb
BN
405
406#define xfs_cmn_err(tag,level,mp,fmt,args...) cmn_err(level,fmt, ## args)
a2ceac1f
DC
407#define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
408#define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
409#define xfs_alert_tag(mp,tag,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
5e656dbb 410
2bd0ea18
NS
411#define xfs_dir2_trace_args(where, args) ((void) 0)
412#define xfs_dir2_trace_args_b(where, args, bp) ((void) 0)
413#define xfs_dir2_trace_args_bb(where, args, lbp, dbp) ((void) 0)
414#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) ((void) 0)
415#define xfs_dir2_trace_args_db(where, args, db, bp) ((void) 0)
416#define xfs_dir2_trace_args_i(where, args, i) ((void) 0)
417#define xfs_dir2_trace_args_s(where, args, s) ((void) 0)
418#define xfs_dir2_trace_args_sb(where, args, s, bp) ((void) 0)
5e656dbb 419#define xfs_sort qsort
2bd0ea18 420
5e656dbb
BN
421#define xfs_icsb_reinit_counters(mp) do { } while (0)
422#define xfs_initialize_perag_icache(pag) ((void) 0)
27c21191 423
5e656dbb 424#define xfs_ilock(ip,mode) ((void) 0)
a2ceac1f
DC
425#define xfs_ilock_nowait(ip,mode) ((void) 0)
426#define xfs_ilock_demote(ip,mode) ((void) 0)
ff105f75
DC
427#define xfs_ilock_data_map_shared(ip) (0)
428#define xfs_ilock_attr_map_shared(ip) (0)
429#define xfs_iunlock(ip,mode) ({ \
430 typeof(mode) __mode = mode; \
431 __mode = __mode; /* no set-but-unused warning */ \
432})
a2ceac1f 433#define __xfs_flock(ip) ((void) 0)
2bd0ea18 434
5e656dbb 435/* space allocation */
a2ceac1f
DC
436#define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)
437#define xfs_extent_busy_insert(tp,ag,bno,len,flags) ((void) 0)
438#define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
439do { \
440 *(bno) = (fbno); \
441 *(len) = (flen); \
442} while (0)
443
56b2de80
DC
444/* avoid unused variable warning */
445#define xfs_alloc_busy_insert(tp,ag,b,len) ({ \
446 xfs_agnumber_t __foo = ag; \
447 __foo = 0; \
448})
a2ceac1f 449
5e656dbb
BN
450#define xfs_rotorstep 1
451#define xfs_bmap_rtalloc(a) (ENOSYS)
452#define xfs_rtpick_extent(mp,tp,len,p) (ENOSYS)
453#define xfs_get_extsz_hint(ip) (0)
454#define xfs_inode_is_filestream(ip) (0)
455#define xfs_filestream_lookup_ag(ip) (0)
456#define xfs_filestream_new_ag(ip,ag) (0)
2bd0ea18 457
a2ceac1f
DC
458#define xfs_log_force(mp,flags) ((void) 0)
459#define XFS_LOG_SYNC 1
460
461/* quota bits */
462#define xfs_trans_mod_dquot_byino(t,i,f,d) ((void) 0)
463#define xfs_trans_reserve_quota_nblks(t,i,b,n,f) (0)
464#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f) ((void) 0)
465#define xfs_qm_dqattach(i,f) (0)
466
5dfa5cd2
DC
467#define uuid_copy(s,d) platform_uuid_copy((s),(d))
468#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0)
469
e9d35108 470#define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0)
4896e6c8 471#define xfs_sb_validate_fsb_count(sbp, nblks) (0)
e9d35108 472
2bd0ea18 473/*
5e656dbb
BN
474 * Prototypes for kernel static functions that are aren't in their
475 * associated header files
2bd0ea18
NS
476 */
477
5e656dbb
BN
478/* xfs_attr.c */
479int xfs_attr_rmtval_get(struct xfs_da_args *);
2bd0ea18
NS
480
481/* xfs_bmap.c */
5e656dbb
BN
482void xfs_bmap_del_free(xfs_bmap_free_t *, xfs_bmap_free_item_t *,
483 xfs_bmap_free_item_t *);
2bd0ea18 484
a2ceac1f
DC
485/*
486 * For regular files we only update the on-disk filesize when actually
487 * writing data back to disk. Until then only the copy in the VFS inode
488 * is uptodate.
489 */
490static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
491{
492 if (S_ISREG(ip->i_d.di_mode))
493 return ip->i_size;
494 return ip->i_d.di_size;
495}
5a35bf2c 496#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
5e656dbb
BN
497
498/* xfs_mount.c */
499int xfs_initialize_perag_data(xfs_mount_t *, xfs_agnumber_t);
500void xfs_mount_common(xfs_mount_t *, xfs_sb_t *);
501
502/*
503 * logitem.c and trans.c prototypes
504 */
4329aa4c
DC
505void xfs_trans_init(struct xfs_mount *);
506int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
2bd0ea18
NS
507
508/* xfs_trans_item.c */
c40bdaa2
DC
509void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *);
510void xfs_trans_del_item(struct xfs_log_item *);
511void xfs_trans_free_items(struct xfs_trans *, int);
2bd0ea18 512
2bd0ea18
NS
513/* xfs_inode_item.c */
514void xfs_inode_item_init (xfs_inode_t *, xfs_mount_t *);
515
516/* xfs_buf_item.c */
517void xfs_buf_item_init (xfs_buf_t *, xfs_mount_t *);
518void xfs_buf_item_log (xfs_buf_log_item_t *, uint, uint);
519
5e656dbb 520/* xfs_trans_buf.c */
75c8b434 521xfs_buf_t *xfs_trans_buf_item_match(xfs_trans_t *, struct xfs_buftarg *,
a2ceac1f 522 struct xfs_buf_map *, int);
5e656dbb 523
2bd0ea18 524/* local source files */
5e656dbb
BN
525int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int);
526void xfs_trans_mod_sb(xfs_trans_t *, uint, long);
79737cd9
DC
527void xfs_trans_init(struct xfs_mount *);
528int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
99c1ec96 529void xfs_verifier_error(struct xfs_buf *bp);
f616e2bf
DC
530
531#endif /* __LIBXFS_INTERNAL_XFS_H */