~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/xfs/scrub/rcbag_btree.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * Copyright (c) 2022-2024 Oracle.  All Rights Reserved.
  4  * Author: Darrick J. Wong <djwong@kernel.org>
  5  */
  6 #ifndef __XFS_SCRUB_RCBAG_BTREE_H__
  7 #define __XFS_SCRUB_RCBAG_BTREE_H__
  8 
  9 #ifdef CONFIG_XFS_BTREE_IN_MEM
 10 
 11 struct xfs_buf;
 12 struct xfs_btree_cur;
 13 struct xfs_mount;
 14 
 15 #define RCBAG_MAGIC     0x74826671      /* 'JRBG' */
 16 
 17 struct rcbag_key {
 18         uint32_t        rbg_startblock;
 19         uint32_t        rbg_blockcount;
 20 };
 21 
 22 struct rcbag_rec {
 23         uint32_t        rbg_startblock;
 24         uint32_t        rbg_blockcount;
 25         uint64_t        rbg_refcount;
 26 };
 27 
 28 typedef __be64 rcbag_ptr_t;
 29 
 30 /* reflinks only exist on crc enabled filesystems */
 31 #define RCBAG_BLOCK_LEN XFS_BTREE_LBLOCK_CRC_LEN
 32 
 33 /*
 34  * Record, key, and pointer address macros for btree blocks.
 35  *
 36  * (note that some of these may appear unused, but they are used in userspace)
 37  */
 38 #define RCBAG_REC_ADDR(block, index) \
 39         ((struct rcbag_rec *) \
 40                 ((char *)(block) + RCBAG_BLOCK_LEN + \
 41                  (((index) - 1) * sizeof(struct rcbag_rec))))
 42 
 43 #define RCBAG_KEY_ADDR(block, index) \
 44         ((struct rcbag_key *) \
 45                 ((char *)(block) + RCBAG_BLOCK_LEN + \
 46                  ((index) - 1) * sizeof(struct rcbag_key)))
 47 
 48 #define RCBAG_PTR_ADDR(block, index, maxrecs) \
 49         ((rcbag_ptr_t *) \
 50                 ((char *)(block) + RCBAG_BLOCK_LEN + \
 51                  (maxrecs) * sizeof(struct rcbag_key) + \
 52                  ((index) - 1) * sizeof(rcbag_ptr_t)))
 53 
 54 unsigned int rcbagbt_maxrecs(struct xfs_mount *mp, unsigned int blocklen,
 55                 bool leaf);
 56 
 57 unsigned long long rcbagbt_calc_size(unsigned long long nr_records);
 58 
 59 unsigned int rcbagbt_maxlevels_possible(void);
 60 
 61 int __init rcbagbt_init_cur_cache(void);
 62 void rcbagbt_destroy_cur_cache(void);
 63 
 64 struct xfs_btree_cur *rcbagbt_mem_cursor(struct xfs_mount *mp,
 65                 struct xfs_trans *tp, struct xfbtree *xfbtree);
 66 int rcbagbt_mem_init(struct xfs_mount *mp, struct xfbtree *xfbtree,
 67                 struct xfs_buftarg *btp);
 68 
 69 int rcbagbt_lookup_eq(struct xfs_btree_cur *cur,
 70                 const struct xfs_rmap_irec *rmap, int *success);
 71 int rcbagbt_get_rec(struct xfs_btree_cur *cur, struct rcbag_rec *rec, int *has);
 72 int rcbagbt_update(struct xfs_btree_cur *cur, const struct rcbag_rec *rec);
 73 int rcbagbt_insert(struct xfs_btree_cur *cur, const struct rcbag_rec *rec,
 74                 int *success);
 75 
 76 #else
 77 # define rcbagbt_init_cur_cache()               0
 78 # define rcbagbt_destroy_cur_cache()            ((void)0)
 79 #endif /* CONFIG_XFS_BTREE_IN_MEM */
 80 
 81 #endif /* __XFS_SCRUB_RCBAG_BTREE_H__ */
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php