Go to the documentation of this file.
45 #define BT_INTERNAL 0x04
46 #define BT_RIGHTMOST 0x10
47 #define BT_LEFTMOST 0x20
48 #define BT_SWAPPED 0x80
51 #define BT_RANDOM 0x0000
52 #define BT_SEQUENTIAL 0x0001
53 #define BT_LOOKUP 0x0010
54 #define BT_INSERT 0x0020
55 #define BT_DELETE 0x0040
60 #define BT_IS_ROOT(MP) (((MP)->xflag & COMMIT_PAGE) == 0)
63 #define BT_PAGE(IP, MP, TYPE, ROOT)\
64 (BT_IS_ROOT(MP) ? (TYPE *)&JFS_IP(IP)->ROOT : (TYPE *)(MP)->data)
67 #define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)\
71 MP = (struct metapage *)&JFS_IP(IP)->bxflag;\
72 P = (TYPE *)&JFS_IP(IP)->ROOT;\
77 MP = read_metapage((IP), BN, SIZE, 1);\
83 jfs_err("bread failed!");\
89 #define BT_MARK_DIRTY(MP, IP)\
92 mark_inode_dirty(IP);\
94 mark_metapage_dirty(MP);\
98 #define BT_PUTPAGE(MP)\
100 if (! BT_IS_ROOT(MP)) \
101 release_metapage(MP); \
124 #define BT_CLR(btstack)\
125 (btstack)->top = (btstack)->stack
127 #define BT_STACK_FULL(btstack)\
128 ( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))
130 #define BT_PUSH(BTSTACK, BN, INDEX)\
132 assert(!BT_STACK_FULL(BTSTACK));\
133 (BTSTACK)->top->bn = BN;\
134 (BTSTACK)->top->index = INDEX;\
138 #define BT_POP(btstack)\
139 ( (btstack)->top == (btstack)->stack ? NULL : --(btstack)->top )
141 #define BT_STACK(btstack)\
142 ( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )
147 printk(
"btstack dump:\n");
150 (
long long)btstack->
stack[i].bn,
151 btstack->
stack[i].index);
155 #define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\
160 P = (TYPE *)MP->data;\
162 P = (TYPE *)&JFS_IP(IP)->ROOT;\
163 INDEX = (LEAF)->index;\
167 #define BT_PUTSEARCH(BTSTACK)\
169 if (! BT_IS_ROOT((BTSTACK)->top->mp))\
170 release_metapage((BTSTACK)->top->mp);\