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

TOMOYO Linux Cross Reference
Linux/fs/bcachefs/alloc_background_format.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 */
  2 #ifndef _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H
  3 #define _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H
  4 
  5 struct bch_alloc {
  6         struct bch_val          v;
  7         __u8                    fields;
  8         __u8                    gen;
  9         __u8                    data[];
 10 } __packed __aligned(8);
 11 
 12 #define BCH_ALLOC_FIELDS_V1()                   \
 13         x(read_time,            16)             \
 14         x(write_time,           16)             \
 15         x(data_type,            8)              \
 16         x(dirty_sectors,        16)             \
 17         x(cached_sectors,       16)             \
 18         x(oldest_gen,           8)              \
 19         x(stripe,               32)             \
 20         x(stripe_redundancy,    8)
 21 
 22 enum {
 23 #define x(name, _bits) BCH_ALLOC_FIELD_V1_##name,
 24         BCH_ALLOC_FIELDS_V1()
 25 #undef x
 26 };
 27 
 28 struct bch_alloc_v2 {
 29         struct bch_val          v;
 30         __u8                    nr_fields;
 31         __u8                    gen;
 32         __u8                    oldest_gen;
 33         __u8                    data_type;
 34         __u8                    data[];
 35 } __packed __aligned(8);
 36 
 37 #define BCH_ALLOC_FIELDS_V2()                   \
 38         x(read_time,            64)             \
 39         x(write_time,           64)             \
 40         x(dirty_sectors,        32)             \
 41         x(cached_sectors,       32)             \
 42         x(stripe,               32)             \
 43         x(stripe_redundancy,    8)
 44 
 45 struct bch_alloc_v3 {
 46         struct bch_val          v;
 47         __le64                  journal_seq;
 48         __le32                  flags;
 49         __u8                    nr_fields;
 50         __u8                    gen;
 51         __u8                    oldest_gen;
 52         __u8                    data_type;
 53         __u8                    data[];
 54 } __packed __aligned(8);
 55 
 56 LE32_BITMASK(BCH_ALLOC_V3_NEED_DISCARD,struct bch_alloc_v3, flags,  0,  1)
 57 LE32_BITMASK(BCH_ALLOC_V3_NEED_INC_GEN,struct bch_alloc_v3, flags,  1,  2)
 58 
 59 struct bch_alloc_v4 {
 60         struct bch_val          v;
 61         __u64                   journal_seq;
 62         __u32                   flags;
 63         __u8                    gen;
 64         __u8                    oldest_gen;
 65         __u8                    data_type;
 66         __u8                    stripe_redundancy;
 67         __u32                   dirty_sectors;
 68         __u32                   cached_sectors;
 69         __u64                   io_time[2];
 70         __u32                   stripe;
 71         __u32                   nr_external_backpointers;
 72         __u64                   fragmentation_lru;
 73         __u32                   stripe_sectors;
 74         __u32                   pad;
 75 } __packed __aligned(8);
 76 
 77 #define BCH_ALLOC_V4_U64s_V0    6
 78 #define BCH_ALLOC_V4_U64s       (sizeof(struct bch_alloc_v4) / sizeof(__u64))
 79 
 80 BITMASK(BCH_ALLOC_V4_NEED_DISCARD,      struct bch_alloc_v4, flags,  0,  1)
 81 BITMASK(BCH_ALLOC_V4_NEED_INC_GEN,      struct bch_alloc_v4, flags,  1,  2)
 82 BITMASK(BCH_ALLOC_V4_BACKPOINTERS_START,struct bch_alloc_v4, flags,  2,  8)
 83 BITMASK(BCH_ALLOC_V4_NR_BACKPOINTERS,   struct bch_alloc_v4, flags,  8,  14)
 84 
 85 #define KEY_TYPE_BUCKET_GENS_BITS       8
 86 #define KEY_TYPE_BUCKET_GENS_NR         (1U << KEY_TYPE_BUCKET_GENS_BITS)
 87 #define KEY_TYPE_BUCKET_GENS_MASK       (KEY_TYPE_BUCKET_GENS_NR - 1)
 88 
 89 struct bch_bucket_gens {
 90         struct bch_val          v;
 91         u8                      gens[KEY_TYPE_BUCKET_GENS_NR];
 92 } __packed __aligned(8);
 93 
 94 #endif /* _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H */
 95 

~ [ 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