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

Go to the source code of this file.

Data Structures

struct  btframe
 
struct  btstack
 

Macros

#define BT_TYPE   0x07 /* B+-tree index */
 
#define BT_ROOT   0x01 /* root page */
 
#define BT_LEAF   0x02 /* leaf page */
 
#define BT_INTERNAL   0x04 /* internal page */
 
#define BT_RIGHTMOST   0x10 /* rightmost page */
 
#define BT_LEFTMOST   0x20 /* leftmost page */
 
#define BT_SWAPPED   0x80 /* used by fsck for endian swapping */
 
#define BT_RANDOM   0x0000
 
#define BT_SEQUENTIAL   0x0001
 
#define BT_LOOKUP   0x0010
 
#define BT_INSERT   0x0020
 
#define BT_DELETE   0x0040
 
#define BT_IS_ROOT(MP)   (((MP)->xflag & COMMIT_PAGE) == 0)
 
#define BT_PAGE(IP, MP, TYPE, ROOT)   (BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data)
 
#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)
 
#define BT_MARK_DIRTY(MP, IP)
 
#define BT_PUTPAGE(MP)
 
#define BT_CLR(btstack)   (btstack)->top = (btstack)->stack
 
#define BT_STACK_FULL(btstack)   ( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))
 
#define BT_PUSH(BTSTACK, BN, INDEX)
 
#define BT_POP(btstack)   ( (btstack)->top == (btstack)->stack ? NULL : --(btstack)->top )
 
#define BT_STACK(btstack)   ( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )
 
#define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)
 
#define BT_PUTSEARCH(BTSTACK)
 

Macro Definition Documentation

#define BT_CLR (   btstack)    (btstack)->top = (btstack)->stack

Definition at line 124 of file jfs_btree.h.

#define BT_DELETE   0x0040

Definition at line 55 of file jfs_btree.h.

#define BT_GETPAGE (   IP,
  BN,
  MP,
  TYPE,
  SIZE,
  P,
  RC,
  ROOT 
)
Value:
{\
if ((BN) == 0)\
{\
MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
P = (TYPE *)&JFS_IP(IP)->ROOT;\
RC = 0;\
}\
else\
{\
MP = read_metapage((IP), BN, SIZE, 1);\
if (MP) {\
RC = 0;\
P = (MP)->data;\
} else {\
P = NULL;\
jfs_err("bread failed!");\
RC = -EIO;\
}\
}\
}

Definition at line 67 of file jfs_btree.h.

#define BT_GETSEARCH (   IP,
  LEAF,
  BN,
  MP,
  TYPE,
  P,
  INDEX,
  ROOT 
)
Value:
{\
BN = (LEAF)->bn;\
MP = (LEAF)->mp;\
if (BN)\
P = (TYPE *)MP->data;\
else\
P = (TYPE *)&JFS_IP(IP)->ROOT;\
INDEX = (LEAF)->index;\
}

Definition at line 155 of file jfs_btree.h.

#define BT_INSERT   0x0020

Definition at line 54 of file jfs_btree.h.

#define BT_INTERNAL   0x04 /* internal page */

Definition at line 45 of file jfs_btree.h.

#define BT_IS_ROOT (   MP)    (((MP)->xflag & COMMIT_PAGE) == 0)

Definition at line 60 of file jfs_btree.h.

#define BT_LEAF   0x02 /* leaf page */

Definition at line 44 of file jfs_btree.h.

#define BT_LEFTMOST   0x20 /* leftmost page */

Definition at line 47 of file jfs_btree.h.

#define BT_LOOKUP   0x0010

Definition at line 53 of file jfs_btree.h.

#define BT_MARK_DIRTY (   MP,
  IP 
)
Value:
{\
if (BT_IS_ROOT(MP))\
mark_inode_dirty(IP);\
}

Definition at line 89 of file jfs_btree.h.

#define BT_PAGE (   IP,
  MP,
  TYPE,
  ROOT 
)    (BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data)

Definition at line 63 of file jfs_btree.h.

#define BT_POP (   btstack)    ( (btstack)->top == (btstack)->stack ? NULL : --(btstack)->top )

Definition at line 138 of file jfs_btree.h.

#define BT_PUSH (   BTSTACK,
  BN,
  INDEX 
)
Value:
{\
assert(!BT_STACK_FULL(BTSTACK));\
(BTSTACK)->top->bn = BN;\
(BTSTACK)->top->index = INDEX;\
++(BTSTACK)->top;\
}

Definition at line 130 of file jfs_btree.h.

#define BT_PUTPAGE (   MP)
Value:
{\
if (! BT_IS_ROOT(MP)) \
release_metapage(MP); \
}

Definition at line 98 of file jfs_btree.h.

#define BT_PUTSEARCH (   BTSTACK)
Value:
{\
if (! BT_IS_ROOT((BTSTACK)->top->mp))\
release_metapage((BTSTACK)->top->mp);\
}

Definition at line 167 of file jfs_btree.h.

#define BT_RANDOM   0x0000

Definition at line 51 of file jfs_btree.h.

#define BT_RIGHTMOST   0x10 /* rightmost page */

Definition at line 46 of file jfs_btree.h.

#define BT_ROOT   0x01 /* root page */

Definition at line 43 of file jfs_btree.h.

#define BT_SEQUENTIAL   0x0001

Definition at line 52 of file jfs_btree.h.

#define BT_STACK (   btstack)    ( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )

Definition at line 141 of file jfs_btree.h.

#define BT_STACK_FULL (   btstack)    ( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))

Definition at line 127 of file jfs_btree.h.

#define BT_SWAPPED   0x80 /* used by fsck for endian swapping */

Definition at line 48 of file jfs_btree.h.

#define BT_TYPE   0x07 /* B+-tree index */

Definition at line 42 of file jfs_btree.h.