]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - libxfs/xfs.h
libxfs: update to 3.16 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
BN
237#define XFS_QM_DQATTACH(mp,ip,flags) 0
238#define XFS_ERROR(e) (e)
5e656dbb
BN
239#define XFS_ERRLEVEL_LOW 1
240#define XFS_FORCED_SHUTDOWN(mp) 0
241#define XFS_ILOCK_EXCL 0
242#define XFS_STATS_INC(count) do { } while (0)
243#define XFS_STATS_DEC(count, x) do { } while (0)
244#define XFS_STATS_ADD(count, x) do { } while (0)
245#define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta) do { } while (0)
246#define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
247#define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
248#define XFS_TEST_ERROR(expr,a,b,c) ( expr )
249#define XFS_WANT_CORRUPTED_GOTO(expr,l) \
250 { if (!(expr)) { error = EFSCORRUPTED; goto l; } }
251#define XFS_WANT_CORRUPTED_RETURN(expr) \
252 { if (!(expr)) { return EFSCORRUPTED; } }
253
5e656dbb
BN
254#ifdef __GNUC__
255#define __return_address __builtin_return_address(0)
256#endif
257
364e85ec
DC
258#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
259
5e656dbb
BN
260/* miscellaneous kernel routines not in user space */
261#define down_read(a) ((void) 0)
262#define up_read(a) ((void) 0)
263#define spin_lock_init(a) ((void) 0)
264#define spin_lock(a) ((void) 0)
265#define spin_unlock(a) ((void) 0)
266#define likely(x) (x)
267#define unlikely(x) (x)
56b2de80
DC
268#define rcu_read_lock() ((void) 0)
269#define rcu_read_unlock() ((void) 0)
5e656dbb 270
2bd0ea18 271/*
49f693fa 272 * prandom_u32 is used for di_gen inode allocation, it must be zero for libxfs
5e656dbb 273 * or all sorts of badness can occur!
2bd0ea18 274 */
49f693fa 275#define prandom_u32() 0
2bd0ea18 276
5e656dbb 277#define PAGE_CACHE_SIZE getpagesize()
2bd0ea18 278
5e656dbb
BN
279static inline int __do_div(unsigned long long *n, unsigned base)
280{
281 int __res;
282 __res = (int)(((unsigned long) *n) % (unsigned) base);
283 *n = ((unsigned long) *n) / (unsigned) base;
284 return __res;
285}
286
287#define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
288#define do_mod(a, b) ((a) % (b))
289#define rol32(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
2bd0ea18 290
5e656dbb
BN
291#define min_t(type,x,y) \
292 ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
293#define max_t(type,x,y) \
294 ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
57c9fccb 295
91eba724 296
91eba724 297
5e656dbb
BN
298static inline __attribute__((const))
299int is_power_of_2(unsigned long n)
300{
301 return (n != 0 && ((n & (n - 1)) == 0));
302}
2bd0ea18
NS
303
304/*
5e656dbb 305 * xfs_iroundup: round up argument to next power of two
2bd0ea18 306 */
5e656dbb
BN
307static inline uint
308roundup_pow_of_two(uint v)
309{
310 int i;
311 uint m;
312
313 if ((v & (v - 1)) == 0)
314 return v;
315 ASSERT((v & 0x80000000) == 0);
316 if ((v & (v + 1)) == 0)
317 return v + 1;
318 for (i = 0, m = 1; i < 31; i++, m <<= 1) {
319 if (v & m)
320 continue;
321 v |= m;
322 if ((v & (v + 1)) == 0)
323 return v + 1;
324 }
325 ASSERT(0);
326 return 0;
327}
2bd0ea18 328
88cd79be
DC
329static inline __uint64_t
330roundup_64(__uint64_t x, __uint32_t y)
331{
332 x += y - 1;
333 do_div(x, y);
334 return x * y;
335}
336
2bd0ea18
NS
337/* buffer management */
338#define XFS_BUF_LOCK 0
2bd0ea18 339#define XFS_BUF_TRYLOCK 0
56b2de80
DC
340#define XBF_LOCK XFS_BUF_LOCK
341#define XBF_TRYLOCK XFS_BUF_TRYLOCK
342#define XBF_DONT_BLOCK 0
a2ceac1f 343#define XBF_UNMAPPED 0
e9d35108 344#define XBF_DONE 0
2bd0ea18 345#define XFS_BUF_GETERROR(bp) 0
f1b058f9
NS
346#define XFS_BUF_DONE(bp) ((bp)->b_flags |= LIBXFS_B_UPTODATE)
347#define XFS_BUF_ISDONE(bp) ((bp)->b_flags & LIBXFS_B_UPTODATE)
a2ceac1f 348#define xfs_buf_stale(bp) ((bp)->b_flags |= LIBXFS_B_STALE)
f1b058f9 349#define XFS_BUF_UNDELAYWRITE(bp) ((bp)->b_flags &= ~LIBXFS_B_DIRTY)
2bd0ea18
NS
350#define XFS_BUF_SET_VTYPE(a,b) ((void) 0)
351#define XFS_BUF_SET_VTYPE_REF(a,b,c) ((void) 0)
352#define XFS_BUF_SET_BDSTRAT_FUNC(a,b) ((void) 0)
5e656dbb 353
9d6fabc0
DC
354/* avoid gcc warning */
355#define xfs_incore(bt,blkno,len,lockit) ({ \
356 typeof(blkno) __foo = (blkno); \
6bddecbc 357 typeof(len) __bar = (len); \
9d6fabc0 358 (blkno) = __foo; \
6bddecbc 359 (len) = __bar; /* no set-but-unused warning */ \
9d6fabc0
DC
360 NULL; \
361})
2bd0ea18 362#define xfs_buf_relse(bp) libxfs_putbuf(bp)
75c8b434 363#define xfs_buf_get(devp,blkno,len,f) (libxfs_getbuf((devp), (blkno), (len)))
9d6fabc0 364#define xfs_bwrite(bp) libxfs_writebuf((bp), 0)
e9d35108 365#define xfs_buf_delwri_queue(bp, bl) libxfs_writebuf((bp), 0)
57c9fccb 366
56b2de80
DC
367#define XBRW_READ LIBXFS_BREAD
368#define XBRW_WRITE LIBXFS_BWRITE
369#define xfs_buf_iomove(bp,off,len,data,f) libxfs_iomove(bp,off,len,data,f)
370#define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
2bd0ea18 371
5e656dbb
BN
372/* mount stuff */
373#define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES
374#define XFS_MOUNT_ATTR2 LIBXFS_MOUNT_ATTR2
375#define XFS_MOUNT_SMALL_INUMS 0 /* ignored in userspace */
376#define XFS_MOUNT_WSYNC 0 /* ignored in userspace */
377#define XFS_MOUNT_NOALIGN 0 /* ignored in userspace */
3439d03a 378#define XFS_MOUNT_IKEEP 0 /* ignored in userspace */
ff105f75
DC
379#define XFS_MOUNT_SWALLOC 0 /* ignored in userspace */
380#define XFS_MOUNT_RDONLY 0 /* ignored in userspace */
5e656dbb 381
56b2de80
DC
382#define xfs_icsb_modify_counters(mp, field, delta, rsvd) \
383 xfs_mod_incore_sb(mp, field, delta, rsvd)
384
5e656dbb
BN
385
386#define xfs_trans_get_block_res(tp) 1
387#define xfs_trans_set_sync(tp) ((void) 0)
e9d35108 388#define xfs_trans_ordered_buf(tp, bp) ((void) 0)
5e656dbb
BN
389#define xfs_trans_agblocks_delta(tp, d)
390#define xfs_trans_agflist_delta(tp, d)
391#define xfs_trans_agbtree_delta(tp, d)
6bddecbc
DC
392#define xfs_trans_buf_set_type(tp, bp, t) ({ \
393 int __t = (t); \
394 __t = __t; /* no set-but-unused warning */ \
395})
396
8b4dc4a9 397#define xfs_trans_buf_copy_type(dbp, sbp)
5e656dbb 398
10851b18
DC
399/* no readahead, need to avoid set-but-unused var warnings. */
400#define xfs_buf_readahead(a,d,c,ops) ({ \
401 xfs_daddr_t __d = d; \
402 __d = __d; /* no set-but-unused warning */ \
403})
a2ceac1f 404#define xfs_buf_readahead_map(a,b,c,ops) ((void) 0) /* no readahead */
a2ceac1f 405#define xfs_buftrace(x,y) ((void) 0) /* debug only */
5e656dbb
BN
406
407#define xfs_cmn_err(tag,level,mp,fmt,args...) cmn_err(level,fmt, ## args)
a2ceac1f
DC
408#define xfs_warn(mp,fmt,args...) cmn_err(CE_WARN,fmt, ## args)
409#define xfs_alert(mp,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
410#define xfs_alert_tag(mp,tag,fmt,args...) cmn_err(CE_ALERT,fmt, ## args)
5e656dbb 411
2bd0ea18
NS
412#define xfs_dir2_trace_args(where, args) ((void) 0)
413#define xfs_dir2_trace_args_b(where, args, bp) ((void) 0)
414#define xfs_dir2_trace_args_bb(where, args, lbp, dbp) ((void) 0)
415#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) ((void) 0)
416#define xfs_dir2_trace_args_db(where, args, db, bp) ((void) 0)
417#define xfs_dir2_trace_args_i(where, args, i) ((void) 0)
418#define xfs_dir2_trace_args_s(where, args, s) ((void) 0)
419#define xfs_dir2_trace_args_sb(where, args, s, bp) ((void) 0)
5e656dbb 420#define xfs_sort qsort
2bd0ea18 421
5e656dbb
BN
422#define xfs_icsb_reinit_counters(mp) do { } while (0)
423#define xfs_initialize_perag_icache(pag) ((void) 0)
27c21191 424
5e656dbb 425#define xfs_ilock(ip,mode) ((void) 0)
a2ceac1f
DC
426#define xfs_ilock_nowait(ip,mode) ((void) 0)
427#define xfs_ilock_demote(ip,mode) ((void) 0)
ff105f75
DC
428#define xfs_ilock_data_map_shared(ip) (0)
429#define xfs_ilock_attr_map_shared(ip) (0)
430#define xfs_iunlock(ip,mode) ({ \
431 typeof(mode) __mode = mode; \
432 __mode = __mode; /* no set-but-unused warning */ \
433})
a2ceac1f 434#define __xfs_flock(ip) ((void) 0)
2bd0ea18 435
5e656dbb 436/* space allocation */
a2ceac1f
DC
437#define xfs_extent_busy_reuse(mp,ag,bno,len,user) ((void) 0)
438#define xfs_extent_busy_insert(tp,ag,bno,len,flags) ((void) 0)
439#define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
440do { \
441 *(bno) = (fbno); \
442 *(len) = (flen); \
443} while (0)
444
56b2de80
DC
445/* avoid unused variable warning */
446#define xfs_alloc_busy_insert(tp,ag,b,len) ({ \
447 xfs_agnumber_t __foo = ag; \
448 __foo = 0; \
449})
a2ceac1f 450
5e656dbb
BN
451#define xfs_rotorstep 1
452#define xfs_bmap_rtalloc(a) (ENOSYS)
453#define xfs_rtpick_extent(mp,tp,len,p) (ENOSYS)
454#define xfs_get_extsz_hint(ip) (0)
455#define xfs_inode_is_filestream(ip) (0)
456#define xfs_filestream_lookup_ag(ip) (0)
457#define xfs_filestream_new_ag(ip,ag) (0)
2bd0ea18 458
a2ceac1f
DC
459#define xfs_log_force(mp,flags) ((void) 0)
460#define XFS_LOG_SYNC 1
461
462/* quota bits */
463#define xfs_trans_mod_dquot_byino(t,i,f,d) ((void) 0)
464#define xfs_trans_reserve_quota_nblks(t,i,b,n,f) (0)
465#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f) ((void) 0)
466#define xfs_qm_dqattach(i,f) (0)
467
5dfa5cd2
DC
468#define uuid_copy(s,d) platform_uuid_copy((s),(d))
469#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0)
470
e9d35108 471#define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0)
4896e6c8 472#define xfs_sb_validate_fsb_count(sbp, nblks) (0)
e9d35108 473
2bd0ea18 474/*
5e656dbb
BN
475 * Prototypes for kernel static functions that are aren't in their
476 * associated header files
2bd0ea18
NS
477 */
478
5e656dbb
BN
479/* xfs_attr.c */
480int xfs_attr_rmtval_get(struct xfs_da_args *);
2bd0ea18
NS
481
482/* xfs_bmap.c */
5e656dbb
BN
483void xfs_bmap_del_free(xfs_bmap_free_t *, xfs_bmap_free_item_t *,
484 xfs_bmap_free_item_t *);
2bd0ea18 485
a2ceac1f
DC
486/*
487 * For regular files we only update the on-disk filesize when actually
488 * writing data back to disk. Until then only the copy in the VFS inode
489 * is uptodate.
490 */
491static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
492{
493 if (S_ISREG(ip->i_d.di_mode))
494 return ip->i_size;
495 return ip->i_d.di_size;
496}
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 */