xfs_btree.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_BTREE_H__
  7. #define __XFS_BTREE_H__
  8. struct xfs_buf;
  9. struct xfs_inode;
  10. struct xfs_mount;
  11. struct xfs_trans;
  12. extern kmem_zone_t *xfs_btree_cur_zone;
  13. /*
  14. * Generic key, ptr and record wrapper structures.
  15. *
  16. * These are disk format structures, and are converted where necessary
  17. * by the btree specific code that needs to interpret them.
  18. */
  19. union xfs_btree_ptr {
  20. __be32 s; /* short form ptr */
  21. __be64 l; /* long form ptr */
  22. };
  23. /*
  24. * The in-core btree key. Overlapping btrees actually store two keys
  25. * per pointer, so we reserve enough memory to hold both. The __*bigkey
  26. * items should never be accessed directly.
  27. */
  28. union xfs_btree_key {
  29. struct xfs_bmbt_key bmbt;
  30. xfs_bmdr_key_t bmbr; /* bmbt root block */
  31. xfs_alloc_key_t alloc;
  32. struct xfs_inobt_key inobt;
  33. struct xfs_rmap_key rmap;
  34. struct xfs_rmap_key __rmap_bigkey[2];
  35. struct xfs_refcount_key refc;
  36. };
  37. union xfs_btree_rec {
  38. struct xfs_bmbt_rec bmbt;
  39. xfs_bmdr_rec_t bmbr; /* bmbt root block */
  40. struct xfs_alloc_rec alloc;
  41. struct xfs_inobt_rec inobt;
  42. struct xfs_rmap_rec rmap;
  43. struct xfs_refcount_rec refc;
  44. };
  45. /*
  46. * This nonsense is to make -wlint happy.
  47. */
  48. #define XFS_LOOKUP_EQ ((xfs_lookup_t)XFS_LOOKUP_EQi)
  49. #define XFS_LOOKUP_LE ((xfs_lookup_t)XFS_LOOKUP_LEi)
  50. #define XFS_LOOKUP_GE ((xfs_lookup_t)XFS_LOOKUP_GEi)
  51. #define XFS_BTNUM_BNO ((xfs_btnum_t)XFS_BTNUM_BNOi)
  52. #define XFS_BTNUM_CNT ((xfs_btnum_t)XFS_BTNUM_CNTi)
  53. #define XFS_BTNUM_BMAP ((xfs_btnum_t)XFS_BTNUM_BMAPi)
  54. #define XFS_BTNUM_INO ((xfs_btnum_t)XFS_BTNUM_INOi)
  55. #define XFS_BTNUM_FINO ((xfs_btnum_t)XFS_BTNUM_FINOi)
  56. #define XFS_BTNUM_RMAP ((xfs_btnum_t)XFS_BTNUM_RMAPi)
  57. #define XFS_BTNUM_REFC ((xfs_btnum_t)XFS_BTNUM_REFCi)
  58. uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
  59. /*
  60. * For logging record fields.
  61. */
  62. #define XFS_BB_MAGIC (1 << 0)
  63. #define XFS_BB_LEVEL (1 << 1)
  64. #define XFS_BB_NUMRECS (1 << 2)
  65. #define XFS_BB_LEFTSIB (1 << 3)
  66. #define XFS_BB_RIGHTSIB (1 << 4)
  67. #define XFS_BB_BLKNO (1 << 5)
  68. #define XFS_BB_LSN (1 << 6)
  69. #define XFS_BB_UUID (1 << 7)
  70. #define XFS_BB_OWNER (1 << 8)
  71. #define XFS_BB_NUM_BITS 5
  72. #define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1)
  73. #define XFS_BB_NUM_BITS_CRC 9
  74. #define XFS_BB_ALL_BITS_CRC ((1 << XFS_BB_NUM_BITS_CRC) - 1)
  75. /*
  76. * Generic stats interface
  77. */
  78. #define XFS_BTREE_STATS_INC(cur, stat) \
  79. XFS_STATS_INC_OFF((cur)->bc_mp, (cur)->bc_statoff + __XBTS_ ## stat)
  80. #define XFS_BTREE_STATS_ADD(cur, stat, val) \
  81. XFS_STATS_ADD_OFF((cur)->bc_mp, (cur)->bc_statoff + __XBTS_ ## stat, val)
  82. #define XFS_BTREE_MAXLEVELS 9 /* max of all btrees */
  83. struct xfs_btree_ops {
  84. /* size of the key and record structures */
  85. size_t key_len;
  86. size_t rec_len;
  87. /* cursor operations */
  88. struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *);
  89. void (*update_cursor)(struct xfs_btree_cur *src,
  90. struct xfs_btree_cur *dst);
  91. /* update btree root pointer */
  92. void (*set_root)(struct xfs_btree_cur *cur,
  93. union xfs_btree_ptr *nptr, int level_change);
  94. /* block allocation / freeing */
  95. int (*alloc_block)(struct xfs_btree_cur *cur,
  96. union xfs_btree_ptr *start_bno,
  97. union xfs_btree_ptr *new_bno,
  98. int *stat);
  99. int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp);
  100. /* update last record information */
  101. void (*update_lastrec)(struct xfs_btree_cur *cur,
  102. struct xfs_btree_block *block,
  103. union xfs_btree_rec *rec,
  104. int ptr, int reason);
  105. /* records in block/level */
  106. int (*get_minrecs)(struct xfs_btree_cur *cur, int level);
  107. int (*get_maxrecs)(struct xfs_btree_cur *cur, int level);
  108. /* records on disk. Matter for the root in inode case. */
  109. int (*get_dmaxrecs)(struct xfs_btree_cur *cur, int level);
  110. /* init values of btree structures */
  111. void (*init_key_from_rec)(union xfs_btree_key *key,
  112. union xfs_btree_rec *rec);
  113. void (*init_rec_from_cur)(struct xfs_btree_cur *cur,
  114. union xfs_btree_rec *rec);
  115. void (*init_ptr_from_cur)(struct xfs_btree_cur *cur,
  116. union xfs_btree_ptr *ptr);
  117. void (*init_high_key_from_rec)(union xfs_btree_key *key,
  118. union xfs_btree_rec *rec);
  119. /* difference between key value and cursor value */
  120. int64_t (*key_diff)(struct xfs_btree_cur *cur,
  121. union xfs_btree_key *key);
  122. /*
  123. * Difference between key2 and key1 -- positive if key1 > key2,
  124. * negative if key1 < key2, and zero if equal.
  125. */
  126. int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
  127. union xfs_btree_key *key1,
  128. union xfs_btree_key *key2);
  129. const struct xfs_buf_ops *buf_ops;
  130. /* check that k1 is lower than k2 */
  131. int (*keys_inorder)(struct xfs_btree_cur *cur,
  132. union xfs_btree_key *k1,
  133. union xfs_btree_key *k2);
  134. /* check that r1 is lower than r2 */
  135. int (*recs_inorder)(struct xfs_btree_cur *cur,
  136. union xfs_btree_rec *r1,
  137. union xfs_btree_rec *r2);
  138. };
  139. /*
  140. * Reasons for the update_lastrec method to be called.
  141. */
  142. #define LASTREC_UPDATE 0
  143. #define LASTREC_INSREC 1
  144. #define LASTREC_DELREC 2
  145. union xfs_btree_irec {
  146. struct xfs_alloc_rec_incore a;
  147. struct xfs_bmbt_irec b;
  148. struct xfs_inobt_rec_incore i;
  149. struct xfs_rmap_irec r;
  150. struct xfs_refcount_irec rc;
  151. };
  152. /* Per-AG btree private information. */
  153. union xfs_btree_cur_private {
  154. struct {
  155. unsigned long nr_ops; /* # record updates */
  156. int shape_changes; /* # of extent splits */
  157. } refc;
  158. };
  159. /*
  160. * Btree cursor structure.
  161. * This collects all information needed by the btree code in one place.
  162. */
  163. typedef struct xfs_btree_cur
  164. {
  165. struct xfs_trans *bc_tp; /* transaction we're in, if any */
  166. struct xfs_mount *bc_mp; /* file system mount struct */
  167. const struct xfs_btree_ops *bc_ops;
  168. uint bc_flags; /* btree features - below */
  169. union xfs_btree_irec bc_rec; /* current insert/search record value */
  170. struct xfs_buf *bc_bufs[XFS_BTREE_MAXLEVELS]; /* buf ptr per level */
  171. int bc_ptrs[XFS_BTREE_MAXLEVELS]; /* key/record # */
  172. uint8_t bc_ra[XFS_BTREE_MAXLEVELS]; /* readahead bits */
  173. #define XFS_BTCUR_LEFTRA 1 /* left sibling has been read-ahead */
  174. #define XFS_BTCUR_RIGHTRA 2 /* right sibling has been read-ahead */
  175. uint8_t bc_nlevels; /* number of levels in the tree */
  176. uint8_t bc_blocklog; /* log2(blocksize) of btree blocks */
  177. xfs_btnum_t bc_btnum; /* identifies which btree type */
  178. int bc_statoff; /* offset of btre stats array */
  179. union {
  180. struct { /* needed for BNO, CNT, INO */
  181. struct xfs_buf *agbp; /* agf/agi buffer pointer */
  182. xfs_agnumber_t agno; /* ag number */
  183. union xfs_btree_cur_private priv;
  184. } a;
  185. struct { /* needed for BMAP */
  186. struct xfs_inode *ip; /* pointer to our inode */
  187. int allocated; /* count of alloced */
  188. short forksize; /* fork's inode space */
  189. char whichfork; /* data or attr fork */
  190. char flags; /* flags */
  191. #define XFS_BTCUR_BPRV_WASDEL (1<<0) /* was delayed */
  192. #define XFS_BTCUR_BPRV_INVALID_OWNER (1<<1) /* for ext swap */
  193. } b;
  194. } bc_private; /* per-btree type data */
  195. } xfs_btree_cur_t;
  196. /* cursor flags */
  197. #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */
  198. #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */
  199. #define XFS_BTREE_LASTREC_UPDATE (1<<2) /* track last rec externally */
  200. #define XFS_BTREE_CRC_BLOCKS (1<<3) /* uses extended btree blocks */
  201. #define XFS_BTREE_OVERLAPPING (1<<4) /* overlapping intervals */
  202. #define XFS_BTREE_NOERROR 0
  203. #define XFS_BTREE_ERROR 1
  204. /*
  205. * Convert from buffer to btree block header.
  206. */
  207. #define XFS_BUF_TO_BLOCK(bp) ((struct xfs_btree_block *)((bp)->b_addr))
  208. /*
  209. * Internal long and short btree block checks. They return NULL if the
  210. * block is ok or the address of the failed check otherwise.
  211. */
  212. xfs_failaddr_t __xfs_btree_check_lblock(struct xfs_btree_cur *cur,
  213. struct xfs_btree_block *block, int level, struct xfs_buf *bp);
  214. xfs_failaddr_t __xfs_btree_check_sblock(struct xfs_btree_cur *cur,
  215. struct xfs_btree_block *block, int level, struct xfs_buf *bp);
  216. /*
  217. * Check that block header is ok.
  218. */
  219. int
  220. xfs_btree_check_block(
  221. struct xfs_btree_cur *cur, /* btree cursor */
  222. struct xfs_btree_block *block, /* generic btree block pointer */
  223. int level, /* level of the btree block */
  224. struct xfs_buf *bp); /* buffer containing block, if any */
  225. /*
  226. * Check that (long) pointer is ok.
  227. */
  228. bool /* error (0 or EFSCORRUPTED) */
  229. xfs_btree_check_lptr(
  230. struct xfs_btree_cur *cur, /* btree cursor */
  231. xfs_fsblock_t fsbno, /* btree block disk address */
  232. int level); /* btree block level */
  233. /*
  234. * Check that (short) pointer is ok.
  235. */
  236. bool /* error (0 or EFSCORRUPTED) */
  237. xfs_btree_check_sptr(
  238. struct xfs_btree_cur *cur, /* btree cursor */
  239. xfs_agblock_t agbno, /* btree block disk address */
  240. int level); /* btree block level */
  241. /*
  242. * Delete the btree cursor.
  243. */
  244. void
  245. xfs_btree_del_cursor(
  246. xfs_btree_cur_t *cur, /* btree cursor */
  247. int error); /* del because of error */
  248. /*
  249. * Duplicate the btree cursor.
  250. * Allocate a new one, copy the record, re-get the buffers.
  251. */
  252. int /* error */
  253. xfs_btree_dup_cursor(
  254. xfs_btree_cur_t *cur, /* input cursor */
  255. xfs_btree_cur_t **ncur);/* output cursor */
  256. /*
  257. * Get a buffer for the block, return it with no data read.
  258. * Long-form addressing.
  259. */
  260. struct xfs_buf * /* buffer for fsbno */
  261. xfs_btree_get_bufl(
  262. struct xfs_mount *mp, /* file system mount point */
  263. struct xfs_trans *tp, /* transaction pointer */
  264. xfs_fsblock_t fsbno, /* file system block number */
  265. uint lock); /* lock flags for get_buf */
  266. /*
  267. * Get a buffer for the block, return it with no data read.
  268. * Short-form addressing.
  269. */
  270. struct xfs_buf * /* buffer for agno/agbno */
  271. xfs_btree_get_bufs(
  272. struct xfs_mount *mp, /* file system mount point */
  273. struct xfs_trans *tp, /* transaction pointer */
  274. xfs_agnumber_t agno, /* allocation group number */
  275. xfs_agblock_t agbno, /* allocation group block number */
  276. uint lock); /* lock flags for get_buf */
  277. /*
  278. * Check for the cursor referring to the last block at the given level.
  279. */
  280. int /* 1=is last block, 0=not last block */
  281. xfs_btree_islastblock(
  282. xfs_btree_cur_t *cur, /* btree cursor */
  283. int level); /* level to check */
  284. /*
  285. * Compute first and last byte offsets for the fields given.
  286. * Interprets the offsets table, which contains struct field offsets.
  287. */
  288. void
  289. xfs_btree_offsets(
  290. int64_t fields, /* bitmask of fields */
  291. const short *offsets,/* table of field offsets */
  292. int nbits, /* number of bits to inspect */
  293. int *first, /* output: first byte offset */
  294. int *last); /* output: last byte offset */
  295. /*
  296. * Get a buffer for the block, return it read in.
  297. * Long-form addressing.
  298. */
  299. int /* error */
  300. xfs_btree_read_bufl(
  301. struct xfs_mount *mp, /* file system mount point */
  302. struct xfs_trans *tp, /* transaction pointer */
  303. xfs_fsblock_t fsbno, /* file system block number */
  304. uint lock, /* lock flags for read_buf */
  305. struct xfs_buf **bpp, /* buffer for fsbno */
  306. int refval, /* ref count value for buffer */
  307. const struct xfs_buf_ops *ops);
  308. /*
  309. * Read-ahead the block, don't wait for it, don't return a buffer.
  310. * Long-form addressing.
  311. */
  312. void /* error */
  313. xfs_btree_reada_bufl(
  314. struct xfs_mount *mp, /* file system mount point */
  315. xfs_fsblock_t fsbno, /* file system block number */
  316. xfs_extlen_t count, /* count of filesystem blocks */
  317. const struct xfs_buf_ops *ops);
  318. /*
  319. * Read-ahead the block, don't wait for it, don't return a buffer.
  320. * Short-form addressing.
  321. */
  322. void /* error */
  323. xfs_btree_reada_bufs(
  324. struct xfs_mount *mp, /* file system mount point */
  325. xfs_agnumber_t agno, /* allocation group number */
  326. xfs_agblock_t agbno, /* allocation group block number */
  327. xfs_extlen_t count, /* count of filesystem blocks */
  328. const struct xfs_buf_ops *ops);
  329. /*
  330. * Initialise a new btree block header
  331. */
  332. void
  333. xfs_btree_init_block(
  334. struct xfs_mount *mp,
  335. struct xfs_buf *bp,
  336. xfs_btnum_t btnum,
  337. __u16 level,
  338. __u16 numrecs,
  339. __u64 owner,
  340. unsigned int flags);
  341. void
  342. xfs_btree_init_block_int(
  343. struct xfs_mount *mp,
  344. struct xfs_btree_block *buf,
  345. xfs_daddr_t blkno,
  346. xfs_btnum_t btnum,
  347. __u16 level,
  348. __u16 numrecs,
  349. __u64 owner,
  350. unsigned int flags);
  351. /*
  352. * Common btree core entry points.
  353. */
  354. int xfs_btree_increment(struct xfs_btree_cur *, int, int *);
  355. int xfs_btree_decrement(struct xfs_btree_cur *, int, int *);
  356. int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *);
  357. int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *);
  358. int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *);
  359. int xfs_btree_insert(struct xfs_btree_cur *, int *);
  360. int xfs_btree_delete(struct xfs_btree_cur *, int *);
  361. int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
  362. int xfs_btree_change_owner(struct xfs_btree_cur *cur, uint64_t new_owner,
  363. struct list_head *buffer_list);
  364. /*
  365. * btree block CRC helpers
  366. */
  367. void xfs_btree_lblock_calc_crc(struct xfs_buf *);
  368. bool xfs_btree_lblock_verify_crc(struct xfs_buf *);
  369. void xfs_btree_sblock_calc_crc(struct xfs_buf *);
  370. bool xfs_btree_sblock_verify_crc(struct xfs_buf *);
  371. /*
  372. * Internal btree helpers also used by xfs_bmap.c.
  373. */
  374. void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int);
  375. void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
  376. /*
  377. * Helpers.
  378. */
  379. static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)
  380. {
  381. return be16_to_cpu(block->bb_numrecs);
  382. }
  383. static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
  384. uint16_t numrecs)
  385. {
  386. block->bb_numrecs = cpu_to_be16(numrecs);
  387. }
  388. static inline int xfs_btree_get_level(struct xfs_btree_block *block)
  389. {
  390. return be16_to_cpu(block->bb_level);
  391. }
  392. /*
  393. * Min and max functions for extlen, agblock, fileoff, and filblks types.
  394. */
  395. #define XFS_EXTLEN_MIN(a,b) min_t(xfs_extlen_t, (a), (b))
  396. #define XFS_EXTLEN_MAX(a,b) max_t(xfs_extlen_t, (a), (b))
  397. #define XFS_AGBLOCK_MIN(a,b) min_t(xfs_agblock_t, (a), (b))
  398. #define XFS_AGBLOCK_MAX(a,b) max_t(xfs_agblock_t, (a), (b))
  399. #define XFS_FILEOFF_MIN(a,b) min_t(xfs_fileoff_t, (a), (b))
  400. #define XFS_FILEOFF_MAX(a,b) max_t(xfs_fileoff_t, (a), (b))
  401. #define XFS_FILBLKS_MIN(a,b) min_t(xfs_filblks_t, (a), (b))
  402. #define XFS_FILBLKS_MAX(a,b) max_t(xfs_filblks_t, (a), (b))
  403. xfs_failaddr_t xfs_btree_sblock_v5hdr_verify(struct xfs_buf *bp);
  404. xfs_failaddr_t xfs_btree_sblock_verify(struct xfs_buf *bp,
  405. unsigned int max_recs);
  406. xfs_failaddr_t xfs_btree_lblock_v5hdr_verify(struct xfs_buf *bp,
  407. uint64_t owner);
  408. xfs_failaddr_t xfs_btree_lblock_verify(struct xfs_buf *bp,
  409. unsigned int max_recs);
  410. uint xfs_btree_compute_maxlevels(uint *limits, unsigned long len);
  411. unsigned long long xfs_btree_calc_size(uint *limits, unsigned long long len);
  412. /* return codes */
  413. #define XFS_BTREE_QUERY_RANGE_CONTINUE 0 /* keep iterating */
  414. #define XFS_BTREE_QUERY_RANGE_ABORT 1 /* stop iterating */
  415. typedef int (*xfs_btree_query_range_fn)(struct xfs_btree_cur *cur,
  416. union xfs_btree_rec *rec, void *priv);
  417. int xfs_btree_query_range(struct xfs_btree_cur *cur,
  418. union xfs_btree_irec *low_rec, union xfs_btree_irec *high_rec,
  419. xfs_btree_query_range_fn fn, void *priv);
  420. int xfs_btree_query_all(struct xfs_btree_cur *cur, xfs_btree_query_range_fn fn,
  421. void *priv);
  422. typedef int (*xfs_btree_visit_blocks_fn)(struct xfs_btree_cur *cur, int level,
  423. void *data);
  424. int xfs_btree_visit_blocks(struct xfs_btree_cur *cur,
  425. xfs_btree_visit_blocks_fn fn, void *data);
  426. int xfs_btree_count_blocks(struct xfs_btree_cur *cur, xfs_extlen_t *blocks);
  427. union xfs_btree_rec *xfs_btree_rec_addr(struct xfs_btree_cur *cur, int n,
  428. struct xfs_btree_block *block);
  429. union xfs_btree_key *xfs_btree_key_addr(struct xfs_btree_cur *cur, int n,
  430. struct xfs_btree_block *block);
  431. union xfs_btree_key *xfs_btree_high_key_addr(struct xfs_btree_cur *cur, int n,
  432. struct xfs_btree_block *block);
  433. union xfs_btree_ptr *xfs_btree_ptr_addr(struct xfs_btree_cur *cur, int n,
  434. struct xfs_btree_block *block);
  435. int xfs_btree_lookup_get_block(struct xfs_btree_cur *cur, int level,
  436. union xfs_btree_ptr *pp, struct xfs_btree_block **blkp);
  437. struct xfs_btree_block *xfs_btree_get_block(struct xfs_btree_cur *cur,
  438. int level, struct xfs_buf **bpp);
  439. bool xfs_btree_ptr_is_null(struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr);
  440. int64_t xfs_btree_diff_two_ptrs(struct xfs_btree_cur *cur,
  441. const union xfs_btree_ptr *a,
  442. const union xfs_btree_ptr *b);
  443. void xfs_btree_get_sibling(struct xfs_btree_cur *cur,
  444. struct xfs_btree_block *block,
  445. union xfs_btree_ptr *ptr, int lr);
  446. void xfs_btree_get_keys(struct xfs_btree_cur *cur,
  447. struct xfs_btree_block *block, union xfs_btree_key *key);
  448. union xfs_btree_key *xfs_btree_high_key_from_key(struct xfs_btree_cur *cur,
  449. union xfs_btree_key *key);
  450. int xfs_btree_has_record(struct xfs_btree_cur *cur, union xfs_btree_irec *low,
  451. union xfs_btree_irec *high, bool *exists);
  452. bool xfs_btree_has_more_records(struct xfs_btree_cur *cur);
  453. #endif /* __XFS_BTREE_H__ */