^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) International Business Machines Corp., 2000-2002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #ifndef _H_JFS_DTREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _H_JFS_DTREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * jfs_dtree.h: directory B+-tree manager
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "jfs_btree.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) typedef union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) tid_t tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct inode *ip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) u32 ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) } leaf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) pxd_t xd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) } ddata_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * entry segment/slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * an entry consists of type dependent head/only segment/slot and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * additional segments/slots linked vi next field;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * N.B. last/only segment of entry is terminated by next = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * directory page slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct dtslot {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) s8 next; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) s8 cnt; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) __le16 name[15]; /* 30: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }; /* (32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define DATASLOTSIZE 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define L2DATASLOTSIZE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define DTSLOTSIZE 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define L2DTSLOTSIZE 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define DTSLOTHDRSIZE 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define DTSLOTDATASIZE 30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define DTSLOTDATALEN 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * internal node entry head/only segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct idtentry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) pxd_t xd; /* 8: child extent descriptor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) s8 next; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) u8 namlen; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __le16 name[11]; /* 22: 2-byte aligned */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) }; /* (32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define DTIHDRSIZE 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define DTIHDRDATALEN 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* compute number of slots for entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define NDTINTERNAL(klen) (DIV_ROUND_UP((4 + (klen)), 15))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * leaf node entry head/only segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * For legacy filesystems, name contains 13 wchars -- no index field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) struct ldtentry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) __le32 inumber; /* 4: 4-byte aligned */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) s8 next; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) u8 namlen; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __le16 name[11]; /* 22: 2-byte aligned */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) __le32 index; /* 4: index into dir_table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) }; /* (32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define DTLHDRSIZE 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #define DTLHDRDATALEN_LEGACY 13 /* Old (OS/2) format */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) #define DTLHDRDATALEN 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) * dir_table used for directory traversal during readdir
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * Keep persistent index for directory entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #define DO_INDEX(INODE) (JFS_SBI((INODE)->i_sb)->mntflag & JFS_DIR_INDEX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * Maximum entry in inline directory table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) #define MAX_INLINE_DIRTABLE_ENTRY 13
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) struct dir_table_slot {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) u8 rsrvd; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) u8 flag; /* 1: 0 if free */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) u8 slot; /* 1: slot within leaf page of entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) u8 addr1; /* 1: upper 8 bits of leaf page address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) __le32 addr2; /* 4: lower 32 bits of leaf page address -OR-
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) index of next entry when this entry was deleted */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) }; /* (8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * flag values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #define DIR_INDEX_VALID 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define DIR_INDEX_FREE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #define DTSaddress(dir_table_slot, address64)\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) (dir_table_slot)->addr1 = ((u64)address64) >> 32;\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) (dir_table_slot)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define addressDTS(dts)\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /* compute number of slots for entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define NDTLEAF_LEGACY(klen) (DIV_ROUND_UP((2 + (klen)), 15))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define NDTLEAF NDTINTERNAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * directory root page (in-line in on-disk inode):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * cf. dtpage_t below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) typedef union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) struct dasd DASD; /* 16: DASD limit/usage info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) u8 flag; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) u8 nextindex; /* 1: next free entry in stbl */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) s8 freecnt; /* 1: free count */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) s8 freelist; /* 1: freelist header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __le32 idotdot; /* 4: parent inode number */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) s8 stbl[8]; /* 8: sorted entry index table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) } header; /* (32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) struct dtslot slot[9];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) } dtroot_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define PARENT(IP) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) (le32_to_cpu(JFS_IP(IP)->i_dtroot.header.idotdot))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #define DTROOTMAXSLOT 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #define dtEmpty(IP) (JFS_IP(IP)->i_dtroot.header.nextindex == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * directory regular page:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * entry slot array of 32 byte slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * sorted entry slot index table (stbl):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * contiguous slots at slot specified by stblindex,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * 1-byte per entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * 512 byte block: 16 entry tbl (1 slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * 1024 byte block: 32 entry tbl (1 slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * 2048 byte block: 64 entry tbl (2 slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * 4096 byte block: 128 entry tbl (4 slot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * data area:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * 512 byte block: 16 - 2 = 14 slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) * 1024 byte block: 32 - 2 = 30 slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) * 2048 byte block: 64 - 3 = 61 slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) * 4096 byte block: 128 - 5 = 123 slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * N.B. index is 0-based; index fields refer to slot index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) * except nextindex which refers to entry index in stbl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * end of entry stot list or freelist is marked with -1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) typedef union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) __le64 next; /* 8: next sibling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __le64 prev; /* 8: previous sibling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) u8 flag; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) u8 nextindex; /* 1: next entry index in stbl */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) s8 freecnt; /* 1: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) s8 freelist; /* 1: slot index of head of freelist */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) u8 maxslot; /* 1: number of slots in page slot[] */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) u8 stblindex; /* 1: slot index of start of stbl */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) u8 rsrvd[2]; /* 2: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) pxd_t self; /* 8: self pxd */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) } header; /* (32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) struct dtslot slot[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) } dtpage_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define DTPAGEMAXSLOT 128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) #define DT8THPGNODEBYTES 512
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #define DT8THPGNODETSLOTS 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #define DT8THPGNODESLOTS 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #define DTQTRPGNODEBYTES 1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) #define DTQTRPGNODETSLOTS 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define DTQTRPGNODESLOTS 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #define DTHALFPGNODEBYTES 2048
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) #define DTHALFPGNODETSLOTS 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #define DTHALFPGNODESLOTS 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) #define DTFULLPGNODEBYTES 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #define DTFULLPGNODETSLOTS 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #define DTFULLPGNODESLOTS 128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #define DTENTRYSTART 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) /* get sorted entry table of the page */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #define DT_GETSTBL(p) ( ((p)->header.flag & BT_ROOT) ?\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) ((dtroot_t *)(p))->header.stbl : \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) (s8 *)&(p)->slot[(p)->header.stblindex] )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) * Flags for dtSearch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) #define JFS_CREATE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #define JFS_LOOKUP 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #define JFS_REMOVE 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) #define JFS_RENAME 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) * Maximum file offset for directories.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #define DIREND INT_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) * external declarations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) extern void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) extern int dtSearch(struct inode *ip, struct component_name * key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) ino_t * data, struct btstack * btstack, int flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) extern int dtInsert(tid_t tid, struct inode *ip, struct component_name * key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) ino_t * ino, struct btstack * btstack);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) extern int dtDelete(tid_t tid, struct inode *ip, struct component_name * key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) ino_t * data, int flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) ino_t * orig_ino, ino_t new_ino, int flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) extern int jfs_readdir(struct file *file, struct dir_context *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) #endif /* !_H_JFS_DTREE */