]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/libxfs.h
Update copyright dates (again)
[thirdparty/xfsprogs-dev.git] / include / libxfs.h
1 /*
2 * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
25 *
26 * http://www.sgi.com
27 *
28 * For further information regarding this notice, see:
29 *
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31 */
32 #ifndef __LIBXFS_H__
33 #define __LIBXFS_H__
34
35 #include "platform_defs.h"
36
37 #include <xfs_fs.h>
38 #include <xfs_types.h>
39 #include <arch.h>
40 #include <xfs_arch.h>
41 #include <xfs_sb.h>
42 #include <xfs_bit.h>
43 #include <xfs_inum.h>
44 #include <xfs_ag.h>
45 #include <xfs_da_btree.h>
46 #include <xfs_bmap_btree.h>
47 #include <xfs_alloc_btree.h>
48 #include <xfs_ialloc_btree.h>
49 #include <xfs_alloc.h>
50 #include <xfs_ialloc.h>
51 #include <xfs_rtalloc.h>
52 #include <xfs_btree.h>
53 #include <xfs_dir.h>
54 #include <xfs_dir_sf.h>
55 #include <xfs_dir_leaf.h>
56 #include <xfs_dir2.h>
57 #include <xfs_dir2_data.h>
58 #include <xfs_dir2_leaf.h>
59 #include <xfs_dir2_block.h>
60 #include <xfs_dir2_node.h>
61 #include <xfs_dir2_sf.h>
62 #include <xfs_attr_sf.h>
63 #include <xfs_dinode.h>
64 #include <xfs_attr_leaf.h>
65 #include <xfs_quota.h>
66 #include <xfs_dqblk.h>
67 #include <xfs_mount.h>
68 #include <xfs_trans_space.h>
69 #include <xfs_inode.h>
70 #include <xfs_buf_item.h>
71 #include <xfs_inode_item.h>
72 #include <xfs_cred.h>
73 #include <xfs_bmap.h>
74 #include <xfs_imap.h>
75 #include <xfs_log.h>
76 #include <xfs_log_priv.h>
77
78 /*
79 * Argument structure for libxfs_init().
80 */
81 typedef struct {
82 /* input parameters */
83 char *volname; /* pathname of volume */
84 char *dname; /* pathname of data "subvolume" */
85 char *logname; /* pathname of log "subvolume" */
86 char *rtname; /* pathname of realtime "subvolume" */
87 int isreadonly; /* filesystem is only read in applic */
88 int disfile; /* data "subvolume" is a regular file */ int dcreat; /* try to create data subvolume */
89 int lisfile; /* log "subvolume" is a regular file */
90 int lcreat; /* try to create log subvolume */
91 int risfile; /* realtime "subvolume" is a reg file */ int rcreat; /* try to create realtime subvolume */
92 char *notvolmsg; /* format string for not XLV message */
93 int notvolok; /* set if not XLV => try data */
94 /* output results */
95 dev_t ddev; /* device for data subvolume */
96 dev_t logdev; /* device for log subvolume */
97 dev_t rtdev; /* device for realtime subvolume */
98 long long dsize; /* size of data subvolume (BBs) */
99 long long logBBsize; /* size of log subvolume (BBs) */
100 /* (blocks allocated for use as
101 * log is stored in mount structure) */
102 long long logBBstart; /* start block of log subvolume (BBs) */ long long rtsize; /* size of realtime subvolume (BBs) */
103 int dfd; /* data subvolume file descriptor */
104 int logfd; /* log subvolume file descriptor */
105 int rtfd; /* realtime subvolume file descriptor */
106 int setblksize; /* attempt to set device block size */
107 } libxfs_init_t;
108
109 #define LIBXFS_ISREADONLY 0x0069 /* disallow all mounted filesystems */
110 #define LIBXFS_ISINACTIVE 0x6900 /* allow mounted only if mounted ro */
111
112 extern char *progname;
113 extern int libxfs_init (libxfs_init_t *);
114 extern int libxfs_device_to_fd (dev_t);
115 extern dev_t libxfs_device_open (char *, int, int, int);
116 extern void libxfs_device_zero (dev_t, xfs_daddr_t, uint);
117 extern void libxfs_device_close (dev_t);
118
119 /* check or write log footer: specify device, log size in blocks & uuid */
120 extern int libxfs_log_clear (dev_t, xfs_daddr_t, uint, uuid_t *, int);
121
122 /*
123 * Define a user-level mount structure with all we need
124 * in order to make use of the numerous XFS_* macros.
125 */
126 struct xfs_inode;
127 typedef struct xfs_mount {
128 xfs_sb_t m_sb; /* copy of fs superblock */
129 int m_bsize; /* fs logical block size */
130 xfs_agnumber_t m_agfrotor; /* last ag where space found */
131 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
132 xfs_agnumber_t m_maxagi; /* highest inode alloc group */
133 uint m_rsumlevels; /* rt summary levels */
134 uint m_rsumsize; /* size of rt summary, bytes */
135 struct xfs_inode *m_rbmip; /* pointer to bitmap inode */
136 struct xfs_inode *m_rsumip; /* pointer to summary inode */
137 struct xfs_inode *m_rootip; /* pointer to root directory */
138 dev_t m_dev;
139 dev_t m_logdev;
140 dev_t m_rtdev;
141 __uint8_t m_dircook_elog; /* log d-cookie entry bits */
142 __uint8_t m_blkbit_log; /* blocklog + NBBY */
143 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
144 __uint8_t m_agno_log; /* log #ag's */
145 __uint8_t m_agino_log; /* #bits for agino in inum */
146 __uint16_t m_inode_cluster_size;/* min inode buf size */
147 uint m_blockmask; /* sb_blocksize-1 */
148 uint m_blockwsize; /* sb_blocksize in words */
149 uint m_blockwmask; /* blockwsize-1 */
150 uint m_alloc_mxr[2]; /* XFS_ALLOC_BLOCK_MAXRECS */
151 uint m_alloc_mnr[2]; /* XFS_ALLOC_BLOCK_MINRECS */
152 uint m_bmap_dmxr[2]; /* XFS_BMAP_BLOCK_DMAXRECS */
153 uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */
154 uint m_inobt_mxr[2]; /* XFS_INOBT_BLOCK_MAXRECS */
155 uint m_inobt_mnr[2]; /* XFS_INOBT_BLOCK_MINRECS */
156 uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */
157 uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */
158 uint m_in_maxlevels; /* XFS_IN_MAXLEVELS */
159 xfs_perag_t *m_perag; /* per-ag accounting info */
160 uint m_flags; /* global mount flags */
161 uint m_qflags; /* quota status flags */
162 uint m_attroffset; /* inode attribute offset */
163 int m_da_node_ents; /* how many entries in danode */
164 int m_ialloc_inos; /* inodes in inode allocation */
165 int m_ialloc_blks; /* blocks in inode allocation */
166 int m_litino; /* size of inode union area */
167 int m_inoalign_mask;/* mask sb_inoalignmt if used */
168 xfs_trans_reservations_t m_reservations;/* precomputed res values */
169 __uint64_t m_maxicount; /* maximum inode count */
170 int m_dalign; /* stripe unit */
171 int m_swidth; /* stripe width */
172 int m_sinoalign; /* stripe unit inode alignmnt */
173 int m_dir_magicpct; /* 37% of the dir blocksize */
174 __uint8_t m_dirversion; /* 1 or 2 */
175 int m_dirblksize; /* directory block sz--bytes */
176 int m_dirblkfsbs; /* directory block sz--fsbs */
177 xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */
178 xfs_dablk_t m_dirleafblk; /* blockno of dir non-data v2 */
179 xfs_dablk_t m_dirfreeblk; /* blockno of dirfreeindex v2 */
180 } xfs_mount_t;
181
182
183 extern xfs_mount_t *libxfs_mount (xfs_mount_t *, xfs_sb_t *,
184 dev_t, dev_t, dev_t, int);
185 extern void libxfs_mount_common (xfs_mount_t *, xfs_sb_t *);
186 extern void libxfs_initialize_perag (xfs_mount_t *, int);
187 extern void libxfs_umount (xfs_mount_t *);
188 extern int libxfs_rtmount_init (xfs_mount_t *);
189 extern void libxfs_alloc_compute_maxlevels (xfs_mount_t *);
190 extern void libxfs_bmap_compute_maxlevels (xfs_mount_t *, int);
191 extern void libxfs_ialloc_compute_maxlevels (xfs_mount_t *);
192 extern void libxfs_trans_init (xfs_mount_t *);
193
194
195 /*
196 * Simple I/O interface
197 */
198 typedef struct xfs_buf {
199 xfs_daddr_t b_blkno;
200 unsigned b_bcount;
201 dev_t b_dev;
202 void *b_fsprivate;
203 void *b_fsprivate2;
204 void *b_fsprivate3;
205 char *b_addr;
206 /* b_addr must be the last field */
207 } xfs_buf_t;
208 #define XFS_BUF_PTR(bp) ((bp)->b_addr)
209 #define xfs_buf_offset(bp, offset) (XFS_BUF_PTR(bp) + (offset))
210 #define XFS_BUF_ADDR(bp) ((bp)->b_blkno)
211 #define XFS_BUF_COUNT(bp) ((bp)->b_bcount)
212 #define XFS_BUF_TARGET(bp) ((bp)->b_dev)
213 #define XFS_BUF_SET_PTR(bp,p,cnt) ((bp)->b_addr = (char *)(p)); \
214 XFS_BUF_SETCOUNT(bp,cnt)
215 #define XFS_BUF_SET_ADDR(bp,blk) ((bp)->b_blkno = (blk))
216 #define XFS_BUF_SETCOUNT(bp,cnt) ((bp)->b_bcount = (cnt))
217
218 #define XFS_BUF_FSPRIVATE(bp,type) ((type)(bp)->b_fsprivate)
219 #define XFS_BUF_SET_FSPRIVATE(bp,val) (bp)->b_fsprivate = (void *)(val)
220 #define XFS_BUF_FSPRIVATE2(bp,type) ((type)(bp)->b_fsprivate2)
221 #define XFS_BUF_SET_FSPRIVATE2(bp,val) (bp)->b_fsprivate2 = (void *)(val)
222 #define XFS_BUF_FSPRIVATE3(bp,type) ((type)(bp)->b_fsprivate3)
223 #define XFS_BUF_SET_FSPRIVATE3(bp,val) (bp)->b_fsprivate3 = (void *)(val)
224
225 extern xfs_buf_t *libxfs_getbuf (dev_t, xfs_daddr_t, int);
226 extern xfs_buf_t *libxfs_readbuf (dev_t, xfs_daddr_t, int, int);
227 extern xfs_buf_t *libxfs_getsb (xfs_mount_t *, int);
228 extern int libxfs_readbufr (dev_t, xfs_daddr_t, xfs_buf_t *, int, int);
229 extern int libxfs_writebuf (xfs_buf_t *, int);
230 extern int libxfs_writebuf_int (xfs_buf_t *, int);
231 extern void libxfs_putbuf (xfs_buf_t *);
232
233
234 /*
235 * Transaction interface
236 */
237
238 typedef struct xfs_log_item {
239 struct xfs_log_item_desc *li_desc; /* ptr to current desc*/
240 struct xfs_mount *li_mountp; /* ptr to fs mount */
241 uint li_type; /* item type */
242 } xfs_log_item_t;
243
244 typedef struct xfs_inode_log_item {
245 xfs_log_item_t ili_item; /* common portion */
246 struct xfs_inode *ili_inode; /* inode pointer */
247 unsigned short ili_flags; /* misc flags */
248 unsigned int ili_last_fields; /* fields when flushed*/
249 xfs_inode_log_format_t ili_format; /* logged structure */
250 } xfs_inode_log_item_t;
251
252 typedef struct xfs_buf_log_item {
253 xfs_log_item_t bli_item; /* common item structure */
254 struct xfs_buf *bli_buf; /* real buffer pointer */
255 unsigned int bli_flags; /* misc flags */
256 unsigned int bli_recur; /* recursion count */
257 xfs_buf_log_format_t bli_format; /* in-log header */
258 } xfs_buf_log_item_t;
259
260 #include <xfs_trans.h>
261
262 typedef struct xfs_trans {
263 unsigned int t_type; /* transaction type */
264 xfs_mount_t *t_mountp; /* ptr to fs mount struct */
265 unsigned int t_flags; /* misc flags */
266 long t_icount_delta; /* superblock icount change */
267 long t_ifree_delta; /* superblock ifree change */
268 long t_fdblocks_delta; /* superblock fdblocks chg */
269 long t_frextents_delta; /* superblock freextents chg */
270 unsigned int t_items_free; /* log item descs free */
271 xfs_log_item_chunk_t t_items; /* first log item desc chunk */
272 } xfs_trans_t;
273
274 extern xfs_trans_t *libxfs_trans_alloc (xfs_mount_t *, int);
275 extern xfs_trans_t *libxfs_trans_dup (xfs_trans_t *);
276 extern int libxfs_trans_reserve (xfs_trans_t *, uint,uint,uint,uint,uint);
277 extern int libxfs_trans_commit (xfs_trans_t *, uint, xfs_lsn_t *);
278 extern void libxfs_trans_cancel (xfs_trans_t *, int);
279 extern void libxfs_mod_sb (xfs_trans_t *, __int64_t);
280
281 extern int libxfs_trans_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t,
282 uint, struct xfs_inode **);
283 extern void libxfs_trans_iput(xfs_trans_t *, struct xfs_inode *, uint);
284 extern void libxfs_trans_ijoin (xfs_trans_t *, struct xfs_inode *, uint);
285 extern void libxfs_trans_ihold (xfs_trans_t *, struct xfs_inode *);
286 extern void libxfs_trans_log_inode (xfs_trans_t *, struct xfs_inode *,
287 uint);
288
289 extern void libxfs_trans_brelse (xfs_trans_t *, struct xfs_buf *);
290 extern void libxfs_trans_binval (xfs_trans_t *, struct xfs_buf *);
291 extern void libxfs_trans_bjoin (xfs_trans_t *, struct xfs_buf *);
292 extern void libxfs_trans_bhold (xfs_trans_t *, struct xfs_buf *);
293 extern void libxfs_trans_log_buf (xfs_trans_t *, struct xfs_buf *,
294 uint, uint);
295 extern xfs_buf_t *libxfs_trans_get_buf (xfs_trans_t *, dev_t,
296 xfs_daddr_t, int, uint);
297 extern int libxfs_trans_read_buf (xfs_mount_t *, xfs_trans_t *, dev_t,
298 xfs_daddr_t, int, uint, struct xfs_buf **);
299
300
301 /*
302 * Simple memory interface
303 */
304 typedef struct xfs_zone {
305 int zone_unitsize; /* Size in bytes of zone unit */
306 char *zone_name; /* tag name */
307 int allocated; /* debug: How many currently allocated */
308 } xfs_zone_t;
309
310 extern xfs_zone_t *libxfs_zone_init (int, char *);
311 extern void *libxfs_zone_zalloc (xfs_zone_t *);
312 extern void libxfs_zone_free (xfs_zone_t *, void *);
313 extern void *libxfs_malloc (size_t);
314 extern void libxfs_free (void *);
315 extern void *libxfs_realloc (void *, size_t);
316
317
318 /*
319 * Inode interface
320 */
321 struct xfs_inode_log_item;
322 typedef struct xfs_inode {
323 xfs_mount_t *i_mount; /* fs mount struct ptr */
324 xfs_ino_t i_ino; /* inode number (agno/agino) */
325 xfs_daddr_t i_blkno; /* blkno of inode buffer */
326 dev_t i_dev; /* dev for this inode */
327 ushort i_len; /* len of inode buffer */
328 ushort i_boffset; /* off of inode in buffer */
329 xfs_ifork_t *i_afp; /* attribute fork pointer */
330 xfs_ifork_t i_df; /* data fork */
331 struct xfs_trans *i_transp; /* ptr to owning transaction */
332 struct xfs_inode_log_item *i_itemp; /* logging information */
333 unsigned int i_delayed_blks; /* count of delay alloc blks */
334 xfs_dinode_core_t i_d; /* most of ondisk inode */
335 } xfs_inode_t;
336
337 typedef struct {
338 uid_t cr_uid;
339 gid_t cr_gid;
340 } cred_t;
341
342 extern int libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t,
343 ushort, dev_t, cred_t *, xfs_inode_t **);
344 extern void libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *);
345
346 extern void libxfs_idata_realloc (xfs_inode_t *, int, int);
347 extern int libxfs_iread (xfs_mount_t *, xfs_trans_t *, xfs_ino_t,
348 xfs_inode_t **, xfs_daddr_t);
349 extern void libxfs_ichgtime (xfs_inode_t *, int);
350 extern int libxfs_iflush_int (xfs_inode_t *, xfs_buf_t *);
351 extern int libxfs_itobp (xfs_mount_t *, xfs_trans_t *, xfs_inode_t *,
352 xfs_dinode_t **, xfs_buf_t **, xfs_daddr_t);
353 extern int libxfs_iget (xfs_mount_t *, xfs_trans_t *, xfs_ino_t,
354 uint, xfs_inode_t **, xfs_daddr_t);
355 extern void libxfs_iput (xfs_inode_t *, uint);
356
357
358 /*
359 * Directory interface
360 */
361 extern void libxfs_dir_mount (xfs_mount_t *);
362 extern void libxfs_dir2_mount (xfs_mount_t *);
363 extern int libxfs_dir_init (xfs_trans_t *, xfs_inode_t *, xfs_inode_t *);
364 extern int libxfs_dir2_init (xfs_trans_t *, xfs_inode_t *, xfs_inode_t *);
365 extern int libxfs_dir_createname (xfs_trans_t *, xfs_inode_t *, char *,
366 int, xfs_ino_t, xfs_fsblock_t *,
367 xfs_bmap_free_t *, xfs_extlen_t);
368 extern int libxfs_dir2_createname (xfs_trans_t *, xfs_inode_t *, char *,
369 int, xfs_ino_t, xfs_fsblock_t *,
370 xfs_bmap_free_t *, xfs_extlen_t);
371 extern int libxfs_dir_lookup (xfs_trans_t *, xfs_inode_t *,
372 char *, int, xfs_ino_t *);
373 extern int libxfs_dir2_lookup (xfs_trans_t *, xfs_inode_t *,
374 char *, int, xfs_ino_t *);
375 extern int libxfs_dir_replace (xfs_trans_t *, xfs_inode_t *,
376 char *, int, xfs_ino_t, xfs_fsblock_t *,
377 xfs_bmap_free_t *, xfs_extlen_t);
378 extern int libxfs_dir2_replace (xfs_trans_t *, xfs_inode_t *,
379 char *, int, xfs_ino_t, xfs_fsblock_t *,
380 xfs_bmap_free_t *, xfs_extlen_t);
381 extern int libxfs_dir_removename (xfs_trans_t *, xfs_inode_t *,
382 char *, int, xfs_ino_t, xfs_fsblock_t *,
383 xfs_bmap_free_t *, xfs_extlen_t);
384 extern int libxfs_dir2_removename (xfs_trans_t *, xfs_inode_t *,
385 char *, int, xfs_ino_t, xfs_fsblock_t *,
386 xfs_bmap_free_t *, xfs_extlen_t);
387 extern int libxfs_dir_bogus_removename (xfs_trans_t *, xfs_inode_t *,
388 char *, xfs_fsblock_t *, xfs_bmap_free_t *,
389 xfs_extlen_t, xfs_dahash_t, int);
390 extern int libxfs_dir2_bogus_removename (xfs_trans_t *, xfs_inode_t *,
391 char *, xfs_fsblock_t *, xfs_bmap_free_t *,
392 xfs_extlen_t, xfs_dahash_t, int);
393
394
395 /*
396 * Block map interface
397 */
398 extern int libxfs_bmapi (xfs_trans_t *, xfs_inode_t *, xfs_fileoff_t,
399 xfs_filblks_t, int, xfs_fsblock_t *,
400 xfs_extlen_t, xfs_bmbt_irec_t *, int *,
401 xfs_bmap_free_t *);
402 extern int libxfs_bmap_finish (xfs_trans_t **, xfs_bmap_free_t *,
403 xfs_fsblock_t, int *);
404 extern int libxfs_bmap_next_offset (xfs_trans_t *, xfs_inode_t *,
405 xfs_fileoff_t *, int);
406 extern int libxfs_bunmapi (xfs_trans_t *, xfs_inode_t *, xfs_fileoff_t,
407 xfs_filblks_t, int, xfs_extnum_t,
408 xfs_fsblock_t *, xfs_bmap_free_t *, int *);
409 extern void libxfs_bmap_del_free (xfs_bmap_free_t *,
410 xfs_bmap_free_item_t *, xfs_bmap_free_item_t *);
411
412
413 /*
414 * All other routines we want to keep common...
415 */
416
417 extern int libxfs_highbit32 (__uint32_t);
418 extern int libxfs_highbit64 (__uint64_t);
419 extern uint libxfs_da_log2_roundup (uint);
420
421 extern void libxfs_xlate_sb (void *, xfs_sb_t *, int, xfs_arch_t,
422 __int64_t);
423 extern void libxfs_xlate_dinode_core (xfs_caddr_t buf,
424 xfs_dinode_core_t *, int, xfs_arch_t);
425
426 extern int libxfs_alloc_fix_freelist (xfs_alloc_arg_t *, int);
427 extern int libxfs_alloc_file_space (xfs_inode_t *, xfs_off_t,
428 xfs_off_t, int, int);
429
430 extern xfs_dahash_t libxfs_da_hashname (uchar_t *, int);
431 extern int libxfs_attr_leaf_newentsize (xfs_da_args_t *, int, int *);
432
433 extern xfs_filblks_t libxfs_bmbt_get_blockcount (xfs_bmbt_rec_t *);
434 extern xfs_fileoff_t libxfs_bmbt_get_startoff (xfs_bmbt_rec_t *);
435 extern void libxfs_bmbt_get_all (xfs_bmbt_rec_t *, xfs_bmbt_irec_t *);
436
437 extern int libxfs_free_extent (xfs_trans_t *, xfs_fsblock_t, xfs_extlen_t);
438 extern int libxfs_rtfree_extent (xfs_trans_t *, xfs_rtblock_t,
439 xfs_extlen_t);
440
441 /* Directory/Attribute routines used by xfs_repair */
442 extern void libxfs_da_bjoin (xfs_trans_t *, xfs_dabuf_t *);
443 extern int libxfs_da_shrink_inode (xfs_da_args_t *, xfs_dablk_t,
444 xfs_dabuf_t *);
445 extern int libxfs_da_grow_inode (xfs_da_args_t *, xfs_dablk_t *);
446 extern void libxfs_da_bhold (xfs_trans_t *, xfs_dabuf_t *);
447 extern void libxfs_da_brelse (xfs_trans_t *, xfs_dabuf_t *);
448 extern int libxfs_da_read_bufr (xfs_trans_t *, xfs_inode_t *, xfs_dablk_t,
449 xfs_daddr_t, xfs_dabuf_t **, int);
450 extern int libxfs_da_read_buf (xfs_trans_t *, xfs_inode_t *,
451 xfs_dablk_t, xfs_daddr_t, xfs_dabuf_t **, int);
452 extern int libxfs_da_get_buf (xfs_trans_t *, xfs_inode_t *,
453 xfs_dablk_t, xfs_daddr_t, xfs_dabuf_t **, int);
454 extern void libxfs_da_log_buf (xfs_trans_t *, xfs_dabuf_t *, uint, uint);
455 extern int libxfs_dir2_shrink_inode (xfs_da_args_t *, xfs_dir2_db_t,
456 xfs_dabuf_t *);
457 extern int libxfs_dir2_grow_inode (xfs_da_args_t *, int, xfs_dir2_db_t *);
458 extern int libxfs_dir2_isleaf (xfs_trans_t *, xfs_inode_t *, int *);
459 extern int libxfs_dir2_isblock (xfs_trans_t *, xfs_inode_t *, int *);
460 extern void libxfs_dir2_data_use_free (xfs_trans_t *, xfs_dabuf_t *,
461 xfs_dir2_data_unused_t *, xfs_dir2_data_aoff_t,
462 xfs_dir2_data_aoff_t, int *, int *);
463 extern void libxfs_dir2_data_make_free (xfs_trans_t *, xfs_dabuf_t *,
464 xfs_dir2_data_aoff_t, xfs_dir2_data_aoff_t,
465 int *, int *);
466 extern void libxfs_dir2_data_log_entry (xfs_trans_t *, xfs_dabuf_t *,
467 xfs_dir2_data_entry_t *);
468 extern void libxfs_dir2_data_log_header (xfs_trans_t *, xfs_dabuf_t *);
469 extern void libxfs_dir2_data_freescan (xfs_mount_t *, xfs_dir2_data_t *,
470 int *, char *);
471 extern void libxfs_dir2_free_log_bests (xfs_trans_t *, xfs_dabuf_t *,
472 int, int);
473
474 /* Shared utility routines */
475 extern unsigned int libxfs_log2_roundup(unsigned int i);
476
477 #endif /* __LIBXFS_H__ */