Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
xfs_bmap_btree.h File Reference

Go to the source code of this file.

Data Structures

struct  xfs_bmdr_block
 
struct  xfs_bmbt_rec
 
struct  xfs_bmbt_rec_host
 
struct  xfs_bmbt_irec
 
struct  xfs_bmbt_key
 

Macros

#define XFS_BMAP_MAGIC   0x424d4150 /* 'BMAP' */
 
#define BMBT_EXNTFLAG_BITLEN   1
 
#define BMBT_STARTOFF_BITLEN   54
 
#define BMBT_STARTBLOCK_BITLEN   52
 
#define BMBT_BLOCKCOUNT_BITLEN   21
 
#define STARTBLOCKVALBITS   17
 
#define STARTBLOCKMASKBITS   (15 + XFS_BIG_BLKNOS * 20)
 
#define DSTARTBLOCKMASKBITS   (15 + 20)
 
#define STARTBLOCKMASK   (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
 
#define DSTARTBLOCKMASK   (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
 
#define XFS_EXTFMT_INODE(x)
 
#define ISUNWRITTEN(x)   ((x)->br_state == XFS_EXT_UNWRITTEN)
 
#define XFS_BMBT_BLOCK_LEN(mp)   XFS_BTREE_LBLOCK_LEN
 
#define XFS_BMBT_REC_ADDR(mp, block, index)
 
#define XFS_BMBT_KEY_ADDR(mp, block, index)
 
#define XFS_BMBT_PTR_ADDR(mp, block, index, maxrecs)
 
#define XFS_BMDR_REC_ADDR(block, index)
 
#define XFS_BMDR_KEY_ADDR(block, index)
 
#define XFS_BMDR_PTR_ADDR(block, index, maxrecs)
 
#define XFS_BMAP_BROOT_PTR_ADDR(mp, bb, i, sz)   XFS_BMBT_PTR_ADDR(mp, bb, i, xfs_bmbt_maxrecs(mp, sz, 0))
 
#define XFS_BMAP_BROOT_SPACE_CALC(nrecs)
 
#define XFS_BMAP_BROOT_SPACE(bb)   (XFS_BMAP_BROOT_SPACE_CALC(be16_to_cpu((bb)->bb_numrecs)))
 
#define XFS_BMDR_SPACE_CALC(nrecs)
 
#define XFS_BM_MAXLEVELS(mp, w)   ((mp)->m_bm_maxlevels[(w)])
 

Typedefs

typedef struct xfs_bmdr_block xfs_bmdr_block_t
 
typedef struct xfs_bmbt_rec xfs_bmbt_rec_t
 
typedef __uint64_t xfs_bmbt_rec_base_t
 
typedef xfs_bmbt_rec_t xfs_bmdr_rec_t
 
typedef struct xfs_bmbt_rec_host xfs_bmbt_rec_host_t
 
typedef struct xfs_bmbt_irec xfs_bmbt_irec_t
 
typedef struct xfs_bmbt_key xfs_bmbt_key_t
 
typedef struct xfs_bmbt_key xfs_bmdr_key_t
 
typedef __be64 xfs_bmbt_ptr_t
 
typedef __be64 xfs_bmdr_ptr_t
 

Enumerations

enum  xfs_exntfmt_t { XFS_EXTFMT_NOSTATE = 0, XFS_EXTFMT_HASSTATE }
 
enum  xfs_exntst_t { XFS_EXT_NORM, XFS_EXT_UNWRITTEN, XFS_EXT_DMAPI_OFFLINE, XFS_EXT_INVALID }
 

Functions

void xfs_bmdr_to_bmbt (struct xfs_mount *, xfs_bmdr_block_t *, int, struct xfs_btree_block *, int)
 
void xfs_bmbt_get_all (xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s)
 
xfs_filblks_t xfs_bmbt_get_blockcount (xfs_bmbt_rec_host_t *r)
 
xfs_fsblock_t xfs_bmbt_get_startblock (xfs_bmbt_rec_host_t *r)
 
xfs_fileoff_t xfs_bmbt_get_startoff (xfs_bmbt_rec_host_t *r)
 
xfs_exntst_t xfs_bmbt_get_state (xfs_bmbt_rec_host_t *r)
 
xfs_filblks_t xfs_bmbt_disk_get_blockcount (xfs_bmbt_rec_t *r)
 
xfs_fileoff_t xfs_bmbt_disk_get_startoff (xfs_bmbt_rec_t *r)
 
void xfs_bmbt_set_all (xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s)
 
void xfs_bmbt_set_allf (xfs_bmbt_rec_host_t *r, xfs_fileoff_t o, xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v)
 
void xfs_bmbt_set_blockcount (xfs_bmbt_rec_host_t *r, xfs_filblks_t v)
 
void xfs_bmbt_set_startblock (xfs_bmbt_rec_host_t *r, xfs_fsblock_t v)
 
void xfs_bmbt_set_startoff (xfs_bmbt_rec_host_t *r, xfs_fileoff_t v)
 
void xfs_bmbt_set_state (xfs_bmbt_rec_host_t *r, xfs_exntst_t v)
 
void xfs_bmbt_disk_set_allf (xfs_bmbt_rec_t *r, xfs_fileoff_t o, xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v)
 
void xfs_bmbt_to_bmdr (struct xfs_mount *, struct xfs_btree_block *, int, xfs_bmdr_block_t *, int)
 
int xfs_bmbt_get_maxrecs (struct xfs_btree_cur *, int level)
 
int xfs_bmdr_maxrecs (struct xfs_mount *, int blocklen, int leaf)
 
int xfs_bmbt_maxrecs (struct xfs_mount *, int blocklen, int leaf)
 
struct xfs_btree_curxfs_bmbt_init_cursor (struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, int)
 

Macro Definition Documentation

#define BMBT_BLOCKCOUNT_BITLEN   21

Definition at line 47 of file xfs_bmap_btree.h.

#define BMBT_EXNTFLAG_BITLEN   1

Definition at line 44 of file xfs_bmap_btree.h.

#define BMBT_STARTBLOCK_BITLEN   52

Definition at line 46 of file xfs_bmap_btree.h.

#define BMBT_STARTOFF_BITLEN   54

Definition at line 45 of file xfs_bmap_btree.h.

#define DSTARTBLOCKMASK   (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)

Definition at line 68 of file xfs_bmap_btree.h.

#define DSTARTBLOCKMASKBITS   (15 + 20)

Definition at line 65 of file xfs_bmap_btree.h.

#define ISUNWRITTEN (   x)    ((x)->br_state == XFS_EXT_UNWRITTEN)

Definition at line 114 of file xfs_bmap_btree.h.

#define STARTBLOCKMASK   (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)

Definition at line 66 of file xfs_bmap_btree.h.

#define STARTBLOCKMASKBITS   (15 + XFS_BIG_BLKNOS * 20)

Definition at line 64 of file xfs_bmap_btree.h.

#define STARTBLOCKVALBITS   17

Definition at line 63 of file xfs_bmap_btree.h.

#define XFS_BM_MAXLEVELS (   mp,
  w 
)    ((mp)->m_bm_maxlevels[(w)])

Definition at line 202 of file xfs_bmap_btree.h.

#define XFS_BMAP_BROOT_PTR_ADDR (   mp,
  bb,
  i,
  sz 
)    XFS_BMBT_PTR_ADDR(mp, bb, i, xfs_bmbt_maxrecs(mp, sz, 0))

Definition at line 186 of file xfs_bmap_btree.h.

#define XFS_BMAP_BROOT_SPACE (   bb)    (XFS_BMAP_BROOT_SPACE_CALC(be16_to_cpu((bb)->bb_numrecs)))

Definition at line 193 of file xfs_bmap_btree.h.

#define XFS_BMAP_BROOT_SPACE_CALC (   nrecs)
Value:
((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t))))

Definition at line 189 of file xfs_bmap_btree.h.

#define XFS_BMAP_MAGIC   0x424d4150 /* 'BMAP' */

Definition at line 21 of file xfs_bmap_btree.h.

#define XFS_BMBT_BLOCK_LEN (   mp)    XFS_BTREE_LBLOCK_LEN

Definition at line 142 of file xfs_bmap_btree.h.

#define XFS_BMBT_KEY_ADDR (   mp,
  block,
  index 
)
Value:
((char *)(block) + \
((index) - 1) * sizeof(xfs_bmbt_key_t)))

Definition at line 150 of file xfs_bmap_btree.h.

#define XFS_BMBT_PTR_ADDR (   mp,
  block,
  index,
  maxrecs 
)
Value:
((char *)(block) + \
(maxrecs) * sizeof(xfs_bmbt_key_t) + \
((index) - 1) * sizeof(xfs_bmbt_ptr_t)))

Definition at line 156 of file xfs_bmap_btree.h.

#define XFS_BMBT_REC_ADDR (   mp,
  block,
  index 
)
Value:
((char *)(block) + \
((index) - 1) * sizeof(xfs_bmbt_rec_t)))

Definition at line 144 of file xfs_bmap_btree.h.

#define XFS_BMDR_KEY_ADDR (   block,
  index 
)
Value:
((char *)(block) + \
sizeof(struct xfs_bmdr_block) + \
((index) - 1) * sizeof(xfs_bmdr_key_t)))

Definition at line 169 of file xfs_bmap_btree.h.

#define XFS_BMDR_PTR_ADDR (   block,
  index,
  maxrecs 
)
Value:
((char *)(block) + \
sizeof(struct xfs_bmdr_block) + \
(maxrecs) * sizeof(xfs_bmdr_key_t) + \
((index) - 1) * sizeof(xfs_bmdr_ptr_t)))

Definition at line 175 of file xfs_bmap_btree.h.

#define XFS_BMDR_REC_ADDR (   block,
  index 
)
Value:
((char *)(block) + \
sizeof(struct xfs_bmdr_block) + \
((index) - 1) * sizeof(xfs_bmdr_rec_t)))

Definition at line 163 of file xfs_bmap_btree.h.

#define XFS_BMDR_SPACE_CALC (   nrecs)
Value:
(int)(sizeof(xfs_bmdr_block_t) + \
((nrecs) * (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t))))

Definition at line 195 of file xfs_bmap_btree.h.

#define XFS_EXTFMT_INODE (   x)
Value:
(xfs_sb_version_hasextflgbit(&((x)->i_mount->m_sb)) ? \
XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE)

Definition at line 111 of file xfs_bmap_btree.h.

Typedef Documentation

Definition at line 135 of file xfs_bmap_btree.h.

typedef __uint64_t xfs_bmbt_rec_base_t

Definition at line 53 of file xfs_bmap_btree.h.

Definition at line 135 of file xfs_bmap_btree.h.

Definition at line 54 of file xfs_bmap_btree.h.

Enumeration Type Documentation

Enumerator:
XFS_EXTFMT_NOSTATE 
XFS_EXTFMT_HASSTATE 

Definition at line 95 of file xfs_bmap_btree.h.

Enumerator:
XFS_EXT_NORM 
XFS_EXT_UNWRITTEN 
XFS_EXT_DMAPI_OFFLINE 
XFS_EXT_INVALID 

Definition at line 103 of file xfs_bmap_btree.h.

Function Documentation

xfs_filblks_t xfs_bmbt_disk_get_blockcount ( xfs_bmbt_rec_t r)

Definition at line 201 of file xfs_bmap_btree.c.

xfs_fileoff_t xfs_bmbt_disk_get_startoff ( xfs_bmbt_rec_t r)

Definition at line 211 of file xfs_bmap_btree.c.

void xfs_bmbt_disk_set_allf ( xfs_bmbt_rec_t r,
xfs_fileoff_t  o,
xfs_fsblock_t  b,
xfs_filblks_t  c,
xfs_exntst_t  v 
)

Definition at line 281 of file xfs_bmap_btree.c.

void xfs_bmbt_get_all ( xfs_bmbt_rec_host_t r,
xfs_bmbt_irec_t s 
)

Definition at line 134 of file xfs_bmap_btree.c.

xfs_filblks_t xfs_bmbt_get_blockcount ( xfs_bmbt_rec_host_t r)

Definition at line 145 of file xfs_bmap_btree.c.

int xfs_bmbt_get_maxrecs ( struct xfs_btree_cur ,
int  level 
)

Definition at line 627 of file xfs_bmap_btree.c.

xfs_fsblock_t xfs_bmbt_get_startblock ( xfs_bmbt_rec_host_t r)

Definition at line 155 of file xfs_bmap_btree.c.

xfs_fileoff_t xfs_bmbt_get_startoff ( xfs_bmbt_rec_host_t r)

Definition at line 179 of file xfs_bmap_btree.c.

xfs_exntst_t xfs_bmbt_get_state ( xfs_bmbt_rec_host_t r)

Definition at line 187 of file xfs_bmap_btree.c.

struct xfs_btree_cur* xfs_bmbt_init_cursor ( struct xfs_mount *  ,
struct xfs_trans *  ,
struct xfs_inode *  ,
int   
)
read

Definition at line 759 of file xfs_bmap_btree.c.

int xfs_bmbt_maxrecs ( struct xfs_mount *  ,
int  blocklen,
int  leaf 
)

Definition at line 794 of file xfs_bmap_btree.c.

void xfs_bmbt_set_all ( xfs_bmbt_rec_host_t r,
xfs_bmbt_irec_t s 
)

Definition at line 268 of file xfs_bmap_btree.c.

void xfs_bmbt_set_allf ( xfs_bmbt_rec_host_t r,
xfs_fileoff_t  o,
xfs_fsblock_t  b,
xfs_filblks_t  c,
xfs_exntst_t  v 
)

Definition at line 223 of file xfs_bmap_btree.c.

void xfs_bmbt_set_blockcount ( xfs_bmbt_rec_host_t r,
xfs_filblks_t  v 
)

Definition at line 343 of file xfs_bmap_btree.c.

void xfs_bmbt_set_startblock ( xfs_bmbt_rec_host_t r,
xfs_fsblock_t  v 
)

Definition at line 356 of file xfs_bmap_btree.c.

void xfs_bmbt_set_startoff ( xfs_bmbt_rec_host_t r,
xfs_fileoff_t  v 
)

Definition at line 384 of file xfs_bmap_btree.c.

void xfs_bmbt_set_state ( xfs_bmbt_rec_host_t r,
xfs_exntst_t  v 
)

Definition at line 398 of file xfs_bmap_btree.c.

void xfs_bmbt_to_bmdr ( struct xfs_mount *  ,
struct xfs_btree_block ,
int  ,
xfs_bmdr_block_t ,
int   
)

Definition at line 413 of file xfs_bmap_btree.c.

int xfs_bmdr_maxrecs ( struct xfs_mount *  ,
int  blocklen,
int  leaf 
)

Definition at line 810 of file xfs_bmap_btree.c.

void xfs_bmdr_to_bmbt ( struct xfs_mount *  ,
xfs_bmdr_block_t ,
int  ,
struct xfs_btree_block ,
int   
)

Definition at line 60 of file xfs_bmap_btree.c.