2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
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.
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.
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
19 #ifndef _XFS_REPAIR_BMAP_H
20 #define _XFS_REPAIR_BMAP_H
25 typedef struct bmap_ext
{
26 xfs_dfiloff_t startoff
;
27 xfs_dfsbno_t startblock
;
28 xfs_dfilblks_t blockcount
;
34 typedef struct blkmap
{
40 #define BLKMAP_SIZE(n) \
41 (offsetof(blkmap_t, exts) + (sizeof(bmap_ext_t) * (n)))
43 blkmap_t
*blkmap_alloc(xfs_extnum_t nex
, int whichfork
);
44 void blkmap_free(blkmap_t
*blkmap
);
46 void blkmap_set_ext(blkmap_t
**blkmapp
, xfs_dfiloff_t o
,
47 xfs_dfsbno_t b
, xfs_dfilblks_t c
);
49 xfs_dfsbno_t
blkmap_get(blkmap_t
*blkmap
, xfs_dfiloff_t o
);
50 int blkmap_getn(blkmap_t
*blkmap
, xfs_dfiloff_t o
,
51 xfs_dfilblks_t nb
, bmap_ext_t
**bmpp
,
52 bmap_ext_t
*bmpp_single
);
53 xfs_dfiloff_t
blkmap_last_off(blkmap_t
*blkmap
);
54 xfs_dfiloff_t
blkmap_next_off(blkmap_t
*blkmap
, xfs_dfiloff_t o
, int *t
);
56 #endif /* _XFS_REPAIR_BMAP_H */