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

Go to the source code of this file.

Data Structures

struct  xfs_btree_block
 
union  xfs_btree_ptr
 
union  xfs_btree_key
 
union  xfs_btree_rec
 
struct  xfs_btree_ops
 
struct  xfs_btree_cur
 

Macros

#define XFS_LOOKUP_EQ   ((xfs_lookup_t)XFS_LOOKUP_EQi)
 
#define XFS_LOOKUP_LE   ((xfs_lookup_t)XFS_LOOKUP_LEi)
 
#define XFS_LOOKUP_GE   ((xfs_lookup_t)XFS_LOOKUP_GEi)
 
#define XFS_BTNUM_BNO   ((xfs_btnum_t)XFS_BTNUM_BNOi)
 
#define XFS_BTNUM_CNT   ((xfs_btnum_t)XFS_BTNUM_CNTi)
 
#define XFS_BTNUM_BMAP   ((xfs_btnum_t)XFS_BTNUM_BMAPi)
 
#define XFS_BTNUM_INO   ((xfs_btnum_t)XFS_BTNUM_INOi)
 
#define XFS_BTREE_SBLOCK_LEN   16 /* size of a short form block */
 
#define XFS_BTREE_LBLOCK_LEN   24 /* size of a long form block */
 
#define XFS_BB_MAGIC   0x01
 
#define XFS_BB_LEVEL   0x02
 
#define XFS_BB_NUMRECS   0x04
 
#define XFS_BB_LEFTSIB   0x08
 
#define XFS_BB_RIGHTSIB   0x10
 
#define XFS_BB_NUM_BITS   5
 
#define XFS_BB_ALL_BITS   ((1 << XFS_BB_NUM_BITS) - 1)
 
#define __XFS_BTREE_STATS_INC(type, stat)   XFS_STATS_INC(xs_ ## type ## _2_ ## stat)
 
#define XFS_BTREE_STATS_INC(cur, stat)
 
#define __XFS_BTREE_STATS_ADD(type, stat, val)   XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val)
 
#define XFS_BTREE_STATS_ADD(cur, stat, val)
 
#define XFS_BTREE_MAXLEVELS   8 /* max of all btrees */
 
#define LASTREC_UPDATE   0
 
#define LASTREC_INSREC   1
 
#define LASTREC_DELREC   2
 
#define XFS_BTCUR_LEFTRA   1 /* left sibling has been read-ahead */
 
#define XFS_BTCUR_RIGHTRA   2 /* right sibling has been read-ahead */
 
#define XFS_BTCUR_BPRV_WASDEL   1 /* was delayed */
 
#define XFS_BTREE_LONG_PTRS   (1<<0) /* pointers are 64bits long */
 
#define XFS_BTREE_ROOT_IN_INODE   (1<<1) /* root may be variable size */
 
#define XFS_BTREE_LASTREC_UPDATE   (1<<2) /* track last rec externally */
 
#define XFS_BTREE_NOERROR   0
 
#define XFS_BTREE_ERROR   1
 
#define XFS_BUF_TO_BLOCK(bp)   ((struct xfs_btree_block *)((bp)->b_addr))
 
#define XFS_EXTLEN_MIN(a, b)   min_t(xfs_extlen_t, (a), (b))
 
#define XFS_EXTLEN_MAX(a, b)   max_t(xfs_extlen_t, (a), (b))
 
#define XFS_AGBLOCK_MIN(a, b)   min_t(xfs_agblock_t, (a), (b))
 
#define XFS_AGBLOCK_MAX(a, b)   max_t(xfs_agblock_t, (a), (b))
 
#define XFS_FILEOFF_MIN(a, b)   min_t(xfs_fileoff_t, (a), (b))
 
#define XFS_FILEOFF_MAX(a, b)   max_t(xfs_fileoff_t, (a), (b))
 
#define XFS_FILBLKS_MIN(a, b)   min_t(xfs_filblks_t, (a), (b))
 
#define XFS_FILBLKS_MAX(a, b)   max_t(xfs_filblks_t, (a), (b))
 
#define XFS_FSB_SANITY_CHECK(mp, fsb)
 
#define XFS_BTREE_TRACE_ARGBI(c, b, i)
 
#define XFS_BTREE_TRACE_ARGBII(c, b, i, j)
 
#define XFS_BTREE_TRACE_ARGI(c, i)
 
#define XFS_BTREE_TRACE_ARGIPK(c, i, p, s)
 
#define XFS_BTREE_TRACE_ARGIPR(c, i, p, r)
 
#define XFS_BTREE_TRACE_ARGIK(c, i, k)
 
#define XFS_BTREE_TRACE_ARGR(c, r)
 
#define XFS_BTREE_TRACE_CURSOR(c, t)
 

Typedefs

typedef struct xfs_btree_cur xfs_btree_cur_t
 

Functions

int xfs_btree_check_block (struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp)
 
int xfs_btree_check_lptr (struct xfs_btree_cur *cur, xfs_dfsbno_t ptr, int level)
 
void xfs_btree_del_cursor (xfs_btree_cur_t *cur, int error)
 
int xfs_btree_dup_cursor (xfs_btree_cur_t *cur, xfs_btree_cur_t **ncur)
 
struct xfs_bufxfs_btree_get_bufl (struct xfs_mount *mp, struct xfs_trans *tp, xfs_fsblock_t fsbno, uint lock)
 
struct xfs_bufxfs_btree_get_bufs (struct xfs_mount *mp, struct xfs_trans *tp, xfs_agnumber_t agno, xfs_agblock_t agbno, uint lock)
 
int xfs_btree_islastblock (xfs_btree_cur_t *cur, int level)
 
void xfs_btree_offsets (__int64_t fields, const short *offsets, int nbits, int *first, int *last)
 
int xfs_btree_read_bufl (struct xfs_mount *mp, struct xfs_trans *tp, xfs_fsblock_t fsbno, uint lock, struct xfs_buf **bpp, int refval)
 
void xfs_btree_reada_bufl (struct xfs_mount *mp, xfs_fsblock_t fsbno, xfs_extlen_t count)
 
void xfs_btree_reada_bufs (struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t count)
 
int xfs_btree_increment (struct xfs_btree_cur *, int, int *)
 
int xfs_btree_decrement (struct xfs_btree_cur *, int, int *)
 
int xfs_btree_lookup (struct xfs_btree_cur *, xfs_lookup_t, int *)
 
int xfs_btree_update (struct xfs_btree_cur *, union xfs_btree_rec *)
 
int xfs_btree_new_iroot (struct xfs_btree_cur *, int *, int *)
 
int xfs_btree_insert (struct xfs_btree_cur *, int *)
 
int xfs_btree_delete (struct xfs_btree_cur *, int *)
 
int xfs_btree_get_rec (struct xfs_btree_cur *, union xfs_btree_rec **, int *)
 
void xfs_btree_log_block (struct xfs_btree_cur *, struct xfs_buf *, int)
 
void xfs_btree_log_recs (struct xfs_btree_cur *, struct xfs_buf *, int, int)
 

Variables

kmem_zone_txfs_btree_cur_zone
 
const __uint32_t xfs_magics []
 

Macro Definition Documentation

#define __XFS_BTREE_STATS_ADD (   type,
  stat,
  val 
)    XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val)

Definition at line 128 of file xfs_btree.h.

#define __XFS_BTREE_STATS_INC (   type,
  stat 
)    XFS_STATS_INC(xs_ ## type ## _2_ ## stat)

Definition at line 115 of file xfs_btree.h.

#define LASTREC_DELREC   2

Definition at line 209 of file xfs_btree.h.

#define LASTREC_INSREC   1

Definition at line 208 of file xfs_btree.h.

#define LASTREC_UPDATE   0

Definition at line 207 of file xfs_btree.h.

#define XFS_AGBLOCK_MAX (   a,
  b 
)    max_t(xfs_agblock_t, (a), (b))

Definition at line 426 of file xfs_btree.h.

#define XFS_AGBLOCK_MIN (   a,
  b 
)    min_t(xfs_agblock_t, (a), (b))

Definition at line 425 of file xfs_btree.h.

#define XFS_BB_ALL_BITS   ((1 << XFS_BB_NUM_BITS) - 1)

Definition at line 105 of file xfs_btree.h.

#define XFS_BB_LEFTSIB   0x08

Definition at line 102 of file xfs_btree.h.

#define XFS_BB_LEVEL   0x02

Definition at line 100 of file xfs_btree.h.

#define XFS_BB_MAGIC   0x01

Definition at line 99 of file xfs_btree.h.

#define XFS_BB_NUM_BITS   5

Definition at line 104 of file xfs_btree.h.

#define XFS_BB_NUMRECS   0x04

Definition at line 101 of file xfs_btree.h.

#define XFS_BB_RIGHTSIB   0x10

Definition at line 103 of file xfs_btree.h.

#define XFS_BTCUR_BPRV_WASDEL   1 /* was delayed */

Definition at line 248 of file xfs_btree.h.

#define XFS_BTCUR_LEFTRA   1 /* left sibling has been read-ahead */

Definition at line 230 of file xfs_btree.h.

#define XFS_BTCUR_RIGHTRA   2 /* right sibling has been read-ahead */

Definition at line 231 of file xfs_btree.h.

#define XFS_BTNUM_BMAP   ((xfs_btnum_t)XFS_BTNUM_BMAPi)

Definition at line 38 of file xfs_btree.h.

#define XFS_BTNUM_BNO   ((xfs_btnum_t)XFS_BTNUM_BNOi)

Definition at line 36 of file xfs_btree.h.

#define XFS_BTNUM_CNT   ((xfs_btnum_t)XFS_BTNUM_CNTi)

Definition at line 37 of file xfs_btree.h.

#define XFS_BTNUM_INO   ((xfs_btnum_t)XFS_BTNUM_INOi)

Definition at line 39 of file xfs_btree.h.

#define XFS_BTREE_ERROR   1

Definition at line 260 of file xfs_btree.h.

#define XFS_BTREE_LASTREC_UPDATE   (1<<2) /* track last rec externally */

Definition at line 256 of file xfs_btree.h.

#define XFS_BTREE_LBLOCK_LEN   24 /* size of a long form block */

Definition at line 68 of file xfs_btree.h.

#define XFS_BTREE_LONG_PTRS   (1<<0) /* pointers are 64bits long */

Definition at line 254 of file xfs_btree.h.

#define XFS_BTREE_MAXLEVELS   8 /* max of all btrees */

Definition at line 141 of file xfs_btree.h.

#define XFS_BTREE_NOERROR   0

Definition at line 259 of file xfs_btree.h.

#define XFS_BTREE_ROOT_IN_INODE   (1<<1) /* root may be variable size */

Definition at line 255 of file xfs_btree.h.

#define XFS_BTREE_SBLOCK_LEN   16 /* size of a short form block */

Definition at line 67 of file xfs_btree.h.

#define XFS_BTREE_STATS_ADD (   cur,
  stat,
  val 
)
Value:
do { \
switch (cur->bc_btnum) { \
case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \
case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \
case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \
case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \
} \
} while (0)

Definition at line 130 of file xfs_btree.h.

#define XFS_BTREE_STATS_INC (   cur,
  stat 
)
Value:
do { \
switch (cur->bc_btnum) { \
case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \
case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \
case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \
case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \
} \
} while (0)

Definition at line 117 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGBI (   c,
  b,
  i 
)

Definition at line 446 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGBII (   c,
  b,
  i,
  j 
)

Definition at line 447 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGI (   c,
  i 
)

Definition at line 448 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGIK (   c,
  i,
  k 
)

Definition at line 451 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGIPK (   c,
  i,
  p,
  s 
)

Definition at line 449 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGIPR (   c,
  i,
  p,
  r 
)

Definition at line 450 of file xfs_btree.h.

#define XFS_BTREE_TRACE_ARGR (   c,
  r 
)

Definition at line 452 of file xfs_btree.h.

#define XFS_BTREE_TRACE_CURSOR (   c,
  t 
)

Definition at line 453 of file xfs_btree.h.

#define XFS_BUF_TO_BLOCK (   bp)    ((struct xfs_btree_block *)((bp)->b_addr))

Definition at line 265 of file xfs_btree.h.

#define XFS_EXTLEN_MAX (   a,
  b 
)    max_t(xfs_extlen_t, (a), (b))

Definition at line 424 of file xfs_btree.h.

#define XFS_EXTLEN_MIN (   a,
  b 
)    min_t(xfs_extlen_t, (a), (b))

Definition at line 423 of file xfs_btree.h.

#define XFS_FILBLKS_MAX (   a,
  b 
)    max_t(xfs_filblks_t, (a), (b))

Definition at line 430 of file xfs_btree.h.

#define XFS_FILBLKS_MIN (   a,
  b 
)    min_t(xfs_filblks_t, (a), (b))

Definition at line 429 of file xfs_btree.h.

#define XFS_FILEOFF_MAX (   a,
  b 
)    max_t(xfs_fileoff_t, (a), (b))

Definition at line 428 of file xfs_btree.h.

#define XFS_FILEOFF_MIN (   a,
  b 
)    min_t(xfs_fileoff_t, (a), (b))

Definition at line 427 of file xfs_btree.h.

#define XFS_FSB_SANITY_CHECK (   mp,
  fsb 
)
Value:
(XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)

Definition at line 432 of file xfs_btree.h.

#define XFS_LOOKUP_EQ   ((xfs_lookup_t)XFS_LOOKUP_EQi)

Definition at line 32 of file xfs_btree.h.

#define XFS_LOOKUP_GE   ((xfs_lookup_t)XFS_LOOKUP_GEi)

Definition at line 34 of file xfs_btree.h.

#define XFS_LOOKUP_LE   ((xfs_lookup_t)XFS_LOOKUP_LEi)

Definition at line 33 of file xfs_btree.h.

Typedef Documentation

Function Documentation

int xfs_btree_check_block ( struct xfs_btree_cur cur,
struct xfs_btree_block block,
int  level,
struct xfs_buf bp 
)

Definition at line 128 of file xfs_btree.c.

int xfs_btree_check_lptr ( struct xfs_btree_cur cur,
xfs_dfsbno_t  ptr,
int  level 
)

Definition at line 144 of file xfs_btree.c.

int xfs_btree_decrement ( struct xfs_btree_cur ,
int  ,
int  
)

Definition at line 1346 of file xfs_btree.c.

void xfs_btree_del_cursor ( xfs_btree_cur_t cur,
int  error 
)

Definition at line 200 of file xfs_btree.c.

int xfs_btree_delete ( struct xfs_btree_cur ,
int  
)

Definition at line 3593 of file xfs_btree.c.

int xfs_btree_dup_cursor ( xfs_btree_cur_t cur,
xfs_btree_cur_t **  ncur 
)

Definition at line 239 of file xfs_btree.c.

struct xfs_buf* xfs_btree_get_bufl ( struct xfs_mount *  mp,
struct xfs_trans *  tp,
xfs_fsblock_t  fsbno,
uint  lock 
)
read
struct xfs_buf* xfs_btree_get_bufs ( struct xfs_mount *  mp,
struct xfs_trans *  tp,
xfs_agnumber_t  agno,
xfs_agblock_t  agbno,
uint  lock 
)
read
int xfs_btree_get_rec ( struct xfs_btree_cur ,
union xfs_btree_rec **  ,
int  
)

Definition at line 3638 of file xfs_btree.c.

int xfs_btree_increment ( struct xfs_btree_cur ,
int  ,
int  
)

Definition at line 1238 of file xfs_btree.c.

int xfs_btree_insert ( struct xfs_btree_cur ,
int  
)

Definition at line 2825 of file xfs_btree.c.

int xfs_btree_islastblock ( xfs_btree_cur_t cur,
int  level 
)

Definition at line 499 of file xfs_btree.c.

void xfs_btree_log_block ( struct xfs_btree_cur ,
struct xfs_buf ,
int   
)

Definition at line 1192 of file xfs_btree.c.

void xfs_btree_log_recs ( struct xfs_btree_cur ,
struct xfs_buf ,
int  ,
int   
)

Definition at line 1144 of file xfs_btree.c.

int xfs_btree_lookup ( struct xfs_btree_cur ,
xfs_lookup_t  ,
int  
)

Definition at line 1503 of file xfs_btree.c.

int xfs_btree_new_iroot ( struct xfs_btree_cur ,
int ,
int  
)

Definition at line 2316 of file xfs_btree.c.

void xfs_btree_offsets ( __int64_t  fields,
const short offsets,
int  nbits,
int first,
int last 
)

Definition at line 577 of file xfs_btree.c.

int xfs_btree_read_bufl ( struct xfs_mount *  mp,
struct xfs_trans *  tp,
xfs_fsblock_t  fsbno,
uint  lock,
struct xfs_buf **  bpp,
int  refval 
)
void xfs_btree_reada_bufl ( struct xfs_mount *  mp,
xfs_fsblock_t  fsbno,
xfs_extlen_t  count 
)
void xfs_btree_reada_bufs ( struct xfs_mount *  mp,
xfs_agnumber_t  agno,
xfs_agblock_t  agbno,
xfs_extlen_t  count 
)
int xfs_btree_update ( struct xfs_btree_cur ,
union xfs_btree_rec  
)

Definition at line 1711 of file xfs_btree.c.

Variable Documentation

kmem_zone_t* xfs_btree_cur_zone

Definition at line 40 of file xfs_btree.c.

const __uint32_t xfs_magics[]

Definition at line 45 of file xfs_btree.c.