linux/fs/jfs/jfs_btree.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *   Copyright (C) International Business Machines Corp., 2000-2004
 */
#ifndef	_H_JFS_BTREE
#define _H_JFS_BTREE

/*
 *	jfs_btree.h: B+-tree
 *
 * JFS B+-tree (dtree and xtree) common definitions
 */

/*
 *	basic btree page - btpage
 *
struct btpage {
	s64 next;		right sibling bn
	s64 prev;		left sibling bn

	u8 flag;
	u8 rsrvd[7];		type specific
	s64 self;		self address

	u8 entry[4064];
};						*/

/* btpaget_t flag */
#define BT_TYPE
#define BT_ROOT
#define BT_LEAF
#define BT_INTERNAL
#define BT_RIGHTMOST
#define BT_LEFTMOST
#define BT_SWAPPED

/* btorder (in inode) */
#define BT_RANDOM
#define BT_SEQUENTIAL
#define BT_LOOKUP
#define BT_INSERT
#define BT_DELETE

/*
 *	btree page buffer cache access
 */
#define BT_IS_ROOT(MP)

/* get page from buffer page */
#define BT_PAGE(IP, MP, TYPE, ROOT)

/* get the page buffer and the page for specified block address */
#define BT_GETPAGE(IP, BN, MP, TYPE, SIZE, P, RC, ROOT)

#define BT_MARK_DIRTY(MP, IP)

/* put the page buffer */
#define BT_PUTPAGE(MP)


/*
 *	btree traversal stack
 *
 * record the path traversed during the search;
 * top frame record the leaf page/entry selected.
 */
struct btframe {};				/* (16/24) */

struct btstack {};

#define BT_CLR(btstack)

#define BT_STACK_FULL(btstack)

#define BT_PUSH(BTSTACK, BN, INDEX)

#define BT_POP(btstack)

#define BT_STACK(btstack)

static inline void BT_STACK_DUMP(struct btstack *btstack)
{}

/* retrieve search results */
#define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)

/* put the page buffer of search */
#define BT_PUTSEARCH(BTSTACK)
#endif				/* _H_JFS_BTREE */