Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
xfs_btree.c File Reference
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_types.h"
#include "xfs_bit.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_mount.h"
#include "xfs_bmap_btree.h"
#include "xfs_alloc_btree.h"
#include "xfs_ialloc_btree.h"
#include "xfs_dinode.h"
#include "xfs_inode.h"
#include "xfs_inode_item.h"
#include "xfs_btree.h"
#include "xfs_error.h"
#include "xfs_trace.h"

Go to the source code of this file.

Functions

STATIC int xfs_btree_check_lblock (struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp)
 
STATIC int xfs_btree_check_sblock (struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level, struct xfs_buf *bp)
 
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 bno, 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)
 
STATIC size_t xfs_btree_rec_offset (struct xfs_btree_cur *cur, int n)
 
STATIC size_t xfs_btree_key_offset (struct xfs_btree_cur *cur, int n)
 
STATIC size_t xfs_btree_ptr_offset (struct xfs_btree_cur *cur, int n, int level)
 
STATIC union xfs_btree_recxfs_btree_rec_addr (struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block)
 
STATIC union xfs_btree_keyxfs_btree_key_addr (struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block)
 
STATIC union xfs_btree_ptrxfs_btree_ptr_addr (struct xfs_btree_cur *cur, int n, struct xfs_btree_block *block)
 
STATIC struct xfs_btree_blockxfs_btree_get_iroot (struct xfs_btree_cur *cur)
 
STATIC struct xfs_btree_blockxfs_btree_get_block (struct xfs_btree_cur *cur, int level, struct xfs_buf **bpp)
 
xfs_buf_txfs_btree_get_bufl (xfs_mount_t *mp, xfs_trans_t *tp, xfs_fsblock_t fsbno, uint lock)
 
xfs_buf_txfs_btree_get_bufs (xfs_mount_t *mp, xfs_trans_t *tp, xfs_agnumber_t agno, xfs_agblock_t agbno, uint lock)
 
int xfs_btree_islastblock (xfs_btree_cur_t *cur, int level)
 
STATIC int xfs_btree_firstrec (xfs_btree_cur_t *cur, int level)
 
STATIC int xfs_btree_lastrec (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 (xfs_mount_t *mp, xfs_trans_t *tp, xfs_fsblock_t fsbno, uint lock, xfs_buf_t **bpp, int refval)
 
void xfs_btree_reada_bufl (xfs_mount_t *mp, xfs_fsblock_t fsbno, xfs_extlen_t count)
 
void xfs_btree_reada_bufs (xfs_mount_t *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t count)
 
STATIC int xfs_btree_readahead_lblock (struct xfs_btree_cur *cur, int lr, struct xfs_btree_block *block)
 
STATIC int xfs_btree_readahead_sblock (struct xfs_btree_cur *cur, int lr, struct xfs_btree_block *block)
 
STATIC int xfs_btree_readahead (struct xfs_btree_cur *cur, int lev, int lr)
 
STATIC void xfs_btree_setbuf (xfs_btree_cur_t *cur, int lev, xfs_buf_t *bp)
 
STATIC int xfs_btree_ptr_is_null (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr)
 
STATIC void xfs_btree_set_ptr_null (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr)
 
STATIC void xfs_btree_get_sibling (struct xfs_btree_cur *cur, struct xfs_btree_block *block, union xfs_btree_ptr *ptr, int lr)
 
STATIC void xfs_btree_set_sibling (struct xfs_btree_cur *cur, struct xfs_btree_block *block, union xfs_btree_ptr *ptr, int lr)
 
STATIC void xfs_btree_init_block (struct xfs_btree_cur *cur, int level, int numrecs, struct xfs_btree_block *new)
 
STATIC int xfs_btree_is_lastrec (struct xfs_btree_cur *cur, struct xfs_btree_block *block, int level)
 
STATIC void xfs_btree_buf_to_ptr (struct xfs_btree_cur *cur, struct xfs_buf *bp, union xfs_btree_ptr *ptr)
 
STATIC xfs_daddr_t xfs_btree_ptr_to_daddr (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr)
 
STATIC void xfs_btree_set_refs (struct xfs_btree_cur *cur, struct xfs_buf *bp)
 
STATIC int xfs_btree_get_buf_block (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int flags, struct xfs_btree_block **block, struct xfs_buf **bpp)
 
STATIC int xfs_btree_read_buf_block (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int level, int flags, struct xfs_btree_block **block, struct xfs_buf **bpp)
 
STATIC void xfs_btree_copy_keys (struct xfs_btree_cur *cur, union xfs_btree_key *dst_key, union xfs_btree_key *src_key, int numkeys)
 
STATIC void xfs_btree_copy_recs (struct xfs_btree_cur *cur, union xfs_btree_rec *dst_rec, union xfs_btree_rec *src_rec, int numrecs)
 
STATIC void xfs_btree_copy_ptrs (struct xfs_btree_cur *cur, union xfs_btree_ptr *dst_ptr, union xfs_btree_ptr *src_ptr, int numptrs)
 
STATIC void xfs_btree_shift_keys (struct xfs_btree_cur *cur, union xfs_btree_key *key, int dir, int numkeys)
 
STATIC void xfs_btree_shift_recs (struct xfs_btree_cur *cur, union xfs_btree_rec *rec, int dir, int numrecs)
 
STATIC void xfs_btree_shift_ptrs (struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int dir, int numptrs)
 
STATIC void xfs_btree_log_keys (struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last)
 
void xfs_btree_log_recs (struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last)
 
STATIC void xfs_btree_log_ptrs (struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last)
 
void xfs_btree_log_block (struct xfs_btree_cur *cur, struct xfs_buf *bp, int fields)
 
int xfs_btree_increment (struct xfs_btree_cur *cur, int level, int *stat)
 
int xfs_btree_decrement (struct xfs_btree_cur *cur, int level, int *stat)
 
STATIC int xfs_btree_lookup_get_block (struct xfs_btree_cur *cur, int level, union xfs_btree_ptr *pp, struct xfs_btree_block **blkp)
 
STATIC union xfs_btree_keyxfs_lookup_get_search_key (struct xfs_btree_cur *cur, int level, int keyno, struct xfs_btree_block *block, union xfs_btree_key *kp)
 
int xfs_btree_lookup (struct xfs_btree_cur *cur, xfs_lookup_t dir, int *stat)
 
STATIC int xfs_btree_updkey (struct xfs_btree_cur *cur, union xfs_btree_key *keyp, int level)
 
int xfs_btree_update (struct xfs_btree_cur *cur, union xfs_btree_rec *rec)
 
STATIC int xfs_btree_lshift (struct xfs_btree_cur *cur, int level, int *stat)
 
STATIC int xfs_btree_rshift (struct xfs_btree_cur *cur, int level, int *stat)
 
STATIC int xfs_btree_split (struct xfs_btree_cur *cur, int level, union xfs_btree_ptr *ptrp, union xfs_btree_key *key, struct xfs_btree_cur **curp, int *stat)
 
int xfs_btree_new_iroot (struct xfs_btree_cur *cur, int *logflags, int *stat)
 
STATIC int xfs_btree_new_root (struct xfs_btree_cur *cur, int *stat)
 
STATIC int xfs_btree_make_block_unfull (struct xfs_btree_cur *cur, int level, int numrecs, int *oindex, int *index, union xfs_btree_ptr *nptr, struct xfs_btree_cur **ncur, union xfs_btree_rec *nrec, int *stat)
 
STATIC int xfs_btree_insrec (struct xfs_btree_cur *cur, int level, union xfs_btree_ptr *ptrp, union xfs_btree_rec *recp, struct xfs_btree_cur **curp, int *stat)
 
int xfs_btree_insert (struct xfs_btree_cur *cur, int *stat)
 
STATIC int xfs_btree_kill_iroot (struct xfs_btree_cur *cur)
 
STATIC int xfs_btree_kill_root (struct xfs_btree_cur *cur, struct xfs_buf *bp, int level, union xfs_btree_ptr *newroot)
 
STATIC int xfs_btree_dec_cursor (struct xfs_btree_cur *cur, int level, int *stat)
 
STATIC int xfs_btree_delrec (struct xfs_btree_cur *cur, int level, int *stat)
 
int xfs_btree_delete (struct xfs_btree_cur *cur, int *stat)
 
int xfs_btree_get_rec (struct xfs_btree_cur *cur, union xfs_btree_rec **recp, int *stat)
 

Variables

kmem_zone_txfs_btree_cur_zone
 
const __uint32_t xfs_magics [XFS_BTNUM_MAX]
 

Function Documentation

STATIC void xfs_btree_buf_to_ptr ( struct xfs_btree_cur cur,
struct xfs_buf bp,
union xfs_btree_ptr ptr 
)

Definition at line 901 of file xfs_btree.c.

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.

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

Definition at line 51 of file xfs_btree.c.

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

Definition at line 144 of file xfs_btree.c.

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

Definition at line 87 of file xfs_btree.c.

STATIC void xfs_btree_copy_keys ( struct xfs_btree_cur cur,
union xfs_btree_key dst_key,
union xfs_btree_key src_key,
int  numkeys 
)

Definition at line 1020 of file xfs_btree.c.

STATIC void xfs_btree_copy_ptrs ( struct xfs_btree_cur cur,
union xfs_btree_ptr dst_ptr,
union xfs_btree_ptr src_ptr,
int  numptrs 
)

Definition at line 1048 of file xfs_btree.c.

STATIC void xfs_btree_copy_recs ( struct xfs_btree_cur cur,
union xfs_btree_rec dst_rec,
union xfs_btree_rec src_rec,
int  numrecs 
)

Definition at line 1034 of file xfs_btree.c.

STATIC int xfs_btree_dec_cursor ( struct xfs_btree_cur cur,
int  level,
int stat 
)

Definition at line 3042 of file xfs_btree.c.

int xfs_btree_decrement ( struct xfs_btree_cur cur,
int  level,
int stat 
)

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 cur,
int stat 
)

Definition at line 3593 of file xfs_btree.c.

STATIC int xfs_btree_delrec ( struct xfs_btree_cur cur,
int  level,
int stat 
)

Definition at line 3068 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.

STATIC int xfs_btree_firstrec ( xfs_btree_cur_t cur,
int  level 
)

Definition at line 519 of file xfs_btree.c.

STATIC struct xfs_btree_block* xfs_btree_get_block ( struct xfs_btree_cur cur,
int  level,
struct xfs_buf **  bpp 
)
read

Definition at line 436 of file xfs_btree.c.

STATIC int xfs_btree_get_buf_block ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr,
int  flags,
struct xfs_btree_block **  block,
struct xfs_buf **  bpp 
)

Definition at line 955 of file xfs_btree.c.

xfs_buf_t* xfs_btree_get_bufl ( xfs_mount_t *  mp,
xfs_trans_t *  tp,
xfs_fsblock_t  fsbno,
uint  lock 
)

Definition at line 456 of file xfs_btree.c.

xfs_buf_t* xfs_btree_get_bufs ( xfs_mount_t *  mp,
xfs_trans_t *  tp,
xfs_agnumber_t  agno,
xfs_agblock_t  agbno,
uint  lock 
)

Definition at line 477 of file xfs_btree.c.

STATIC struct xfs_btree_block* xfs_btree_get_iroot ( struct xfs_btree_cur cur)
read

Definition at line 422 of file xfs_btree.c.

int xfs_btree_get_rec ( struct xfs_btree_cur cur,
union xfs_btree_rec **  recp,
int stat 
)

Definition at line 3638 of file xfs_btree.c.

STATIC void xfs_btree_get_sibling ( struct xfs_btree_cur cur,
struct xfs_btree_block block,
union xfs_btree_ptr ptr,
int  lr 
)

Definition at line 813 of file xfs_btree.c.

int xfs_btree_increment ( struct xfs_btree_cur cur,
int  level,
int stat 
)

Definition at line 1238 of file xfs_btree.c.

STATIC void xfs_btree_init_block ( struct xfs_btree_cur cur,
int  level,
int  numrecs,
struct xfs_btree_block new 
)

Definition at line 857 of file xfs_btree.c.

int xfs_btree_insert ( struct xfs_btree_cur cur,
int stat 
)

Definition at line 2825 of file xfs_btree.c.

STATIC int xfs_btree_insrec ( struct xfs_btree_cur cur,
int  level,
union xfs_btree_ptr ptrp,
union xfs_btree_rec recp,
struct xfs_btree_cur **  curp,
int stat 
)

Definition at line 2614 of file xfs_btree.c.

STATIC int xfs_btree_is_lastrec ( struct xfs_btree_cur cur,
struct xfs_btree_block block,
int  level 
)

Definition at line 882 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.

STATIC union xfs_btree_key* xfs_btree_key_addr ( struct xfs_btree_cur cur,
int  n,
struct xfs_btree_block block 
)
write

Definition at line 389 of file xfs_btree.c.

STATIC size_t xfs_btree_key_offset ( struct xfs_btree_cur cur,
int  n 
)

Definition at line 350 of file xfs_btree.c.

STATIC int xfs_btree_kill_iroot ( struct xfs_btree_cur cur)

Definition at line 2901 of file xfs_btree.c.

STATIC int xfs_btree_kill_root ( struct xfs_btree_cur cur,
struct xfs_buf bp,
int  level,
union xfs_btree_ptr newroot 
)

Definition at line 3008 of file xfs_btree.c.

STATIC int xfs_btree_lastrec ( xfs_btree_cur_t cur,
int  level 
)

Definition at line 548 of file xfs_btree.c.

void xfs_btree_log_block ( struct xfs_btree_cur cur,
struct xfs_buf bp,
int  fields 
)

Definition at line 1192 of file xfs_btree.c.

STATIC void xfs_btree_log_keys ( struct xfs_btree_cur cur,
struct xfs_buf bp,
int  first,
int  last 
)

Definition at line 1119 of file xfs_btree.c.

STATIC void xfs_btree_log_ptrs ( struct xfs_btree_cur cur,
struct xfs_buf bp,
int  first,
int  last 
)

Definition at line 1164 of file xfs_btree.c.

void xfs_btree_log_recs ( struct xfs_btree_cur cur,
struct xfs_buf bp,
int  first,
int  last 
)

Definition at line 1144 of file xfs_btree.c.

int xfs_btree_lookup ( struct xfs_btree_cur cur,
xfs_lookup_t  dir,
int stat 
)

Definition at line 1503 of file xfs_btree.c.

STATIC int xfs_btree_lookup_get_block ( struct xfs_btree_cur cur,
int  level,
union xfs_btree_ptr pp,
struct xfs_btree_block **  blkp 
)

Definition at line 1440 of file xfs_btree.c.

STATIC int xfs_btree_lshift ( struct xfs_btree_cur cur,
int  level,
int stat 
)

Definition at line 1772 of file xfs_btree.c.

STATIC int xfs_btree_make_block_unfull ( struct xfs_btree_cur cur,
int  level,
int  numrecs,
int oindex,
int index,
union xfs_btree_ptr nptr,
struct xfs_btree_cur **  ncur,
union xfs_btree_rec nrec,
int stat 
)

Definition at line 2542 of file xfs_btree.c.

int xfs_btree_new_iroot ( struct xfs_btree_cur cur,
int logflags,
int stat 
)

Definition at line 2316 of file xfs_btree.c.

STATIC int xfs_btree_new_root ( struct xfs_btree_cur cur,
int stat 
)

Definition at line 2416 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.

STATIC union xfs_btree_ptr* xfs_btree_ptr_addr ( struct xfs_btree_cur cur,
int  n,
struct xfs_btree_block block 
)
write

Definition at line 402 of file xfs_btree.c.

STATIC int xfs_btree_ptr_is_null ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr 
)

Definition at line 788 of file xfs_btree.c.

STATIC size_t xfs_btree_ptr_offset ( struct xfs_btree_cur cur,
int  n,
int  level 
)

Definition at line 362 of file xfs_btree.c.

STATIC xfs_daddr_t xfs_btree_ptr_to_daddr ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr 
)

Definition at line 916 of file xfs_btree.c.

STATIC int xfs_btree_read_buf_block ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr,
int  level,
int  flags,
struct xfs_btree_block **  block,
struct xfs_buf **  bpp 
)

Definition at line 984 of file xfs_btree.c.

int xfs_btree_read_bufl ( xfs_mount_t *  mp,
xfs_trans_t *  tp,
xfs_fsblock_t  fsbno,
uint  lock,
xfs_buf_t **  bpp,
int  refval 
)

Definition at line 613 of file xfs_btree.c.

void xfs_btree_reada_bufl ( xfs_mount_t *  mp,
xfs_fsblock_t  fsbno,
xfs_extlen_t  count 
)

Definition at line 644 of file xfs_btree.c.

void xfs_btree_reada_bufs ( xfs_mount_t *  mp,
xfs_agnumber_t  agno,
xfs_agblock_t  agbno,
xfs_extlen_t  count 
)

Definition at line 662 of file xfs_btree.c.

STATIC int xfs_btree_readahead ( struct xfs_btree_cur cur,
int  lev,
int  lr 
)

Definition at line 730 of file xfs_btree.c.

STATIC int xfs_btree_readahead_lblock ( struct xfs_btree_cur cur,
int  lr,
struct xfs_btree_block block 
)

Definition at line 677 of file xfs_btree.c.

STATIC int xfs_btree_readahead_sblock ( struct xfs_btree_cur cur,
int  lr,
struct xfs_btree_block block 
)

Definition at line 700 of file xfs_btree.c.

STATIC union xfs_btree_rec* xfs_btree_rec_addr ( struct xfs_btree_cur cur,
int  n,
struct xfs_btree_block block 
)
write

Definition at line 376 of file xfs_btree.c.

STATIC size_t xfs_btree_rec_offset ( struct xfs_btree_cur cur,
int  n 
)

Definition at line 338 of file xfs_btree.c.

STATIC int xfs_btree_rshift ( struct xfs_btree_cur cur,
int  level,
int stat 
)

Definition at line 1955 of file xfs_btree.c.

STATIC void xfs_btree_set_ptr_null ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr 
)

Definition at line 799 of file xfs_btree.c.

STATIC void xfs_btree_set_refs ( struct xfs_btree_cur cur,
struct xfs_buf bp 
)

Definition at line 934 of file xfs_btree.c.

STATIC void xfs_btree_set_sibling ( struct xfs_btree_cur cur,
struct xfs_btree_block block,
union xfs_btree_ptr ptr,
int  lr 
)

Definition at line 835 of file xfs_btree.c.

STATIC void xfs_btree_setbuf ( xfs_btree_cur_t cur,
int  lev,
xfs_buf_t bp 
)

Definition at line 761 of file xfs_btree.c.

STATIC void xfs_btree_shift_keys ( struct xfs_btree_cur cur,
union xfs_btree_key key,
int  dir,
int  numkeys 
)

Definition at line 1062 of file xfs_btree.c.

STATIC void xfs_btree_shift_ptrs ( struct xfs_btree_cur cur,
union xfs_btree_ptr ptr,
int  dir,
int  numptrs 
)

Definition at line 1100 of file xfs_btree.c.

STATIC void xfs_btree_shift_recs ( struct xfs_btree_cur cur,
union xfs_btree_rec rec,
int  dir,
int  numrecs 
)

Definition at line 1081 of file xfs_btree.c.

STATIC int xfs_btree_split ( struct xfs_btree_cur cur,
int  level,
union xfs_btree_ptr ptrp,
union xfs_btree_key key,
struct xfs_btree_cur **  curp,
int stat 
)

Definition at line 2131 of file xfs_btree.c.

int xfs_btree_update ( struct xfs_btree_cur cur,
union xfs_btree_rec rec 
)

Definition at line 1711 of file xfs_btree.c.

STATIC int xfs_btree_updkey ( struct xfs_btree_cur cur,
union xfs_btree_key keyp,
int  level 
)

Definition at line 1662 of file xfs_btree.c.

STATIC union xfs_btree_key* xfs_lookup_get_search_key ( struct xfs_btree_cur cur,
int  level,
int  keyno,
struct xfs_btree_block block,
union xfs_btree_key kp 
)
write

Definition at line 1482 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[XFS_BTNUM_MAX]
Initial value:

Definition at line 45 of file xfs_btree.c.