linux/fs/jfs/jfs_xtree.h

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

/*
 *	jfs_xtree.h: extent allocation descriptor B+-tree manager
 */

#include "jfs_btree.h"


/*
 *	extent allocation descriptor (xad)
 */
xad_t;			/* (16) */

#define MAXXLEN

#define XTSLOTSIZE
#define L2XTSLOTSIZE

/* xad_t field construction */
#define XADoffset(xad, offset64)
#define XADaddress(xad, address64)
#define XADlength(xad, length32)

/* xad_t field extraction */
#define offsetXAD(xad)
#define addressXAD(xad)
#define lengthXAD(xad)

/* xad list */
struct xadlist {};

/* xad_t flags */
#define XAD_NEW
#define XAD_EXTENDED
#define XAD_COMPRESSED
#define XAD_NOTRECORDED
#define XAD_COW


/* possible values for maxentry */
#define XTROOTINITSLOT_DIR
#define XTROOTINITSLOT
#define XTROOTMAXSLOT
#define XTPAGEMAXSLOT
#define XTENTRYSTART

struct xtheader {};

/*
 *	xtree root (in inode):
 */
xtroot_t;

/*
 *	xtree page:
 */
xtpage_t;

/*
 *	external declaration
 */
extern int xtLookup(struct inode *ip, s64 lstart, s64 llen,
		    int *pflag, s64 * paddr, int *plen, int flag);
extern void xtInitRoot(tid_t tid, struct inode *ip);
extern int xtInsert(tid_t tid, struct inode *ip,
		    int xflag, s64 xoff, int xlen, s64 * xaddrp, int flag);
extern int xtExtend(tid_t tid, struct inode *ip, s64 xoff, int xlen,
		    int flag);
extern int xtUpdate(tid_t tid, struct inode *ip, struct xad *nxad);
extern s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int type);
extern s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size);
extern int xtAppend(tid_t tid,
		    struct inode *ip, int xflag, s64 xoff, int maxblocks,
		    int *xlenp, s64 * xaddrp, int flag);
#endif				/* !_H_JFS_XTREE */