#include <asm/byteorder.h>
#include <linux/kernel.h>
#include <linux/uuid.h>
+#include "vstructs.h"
#define LE_BITMASK(_bits, name, type, field, offset, end) \
static const unsigned name##_OFFSET = offset; \
};
LE64_BITMASK(BCH_MEMBER_STATE, struct bch_member, flags[0], 0, 4)
-/* 4-10 unused, was TIER, HAS_(META)DATA */
-LE64_BITMASK(BCH_MEMBER_REPLACEMENT, struct bch_member, flags[0], 10, 14)
+/* 4-14 unused, was TIER, HAS_(META)DATA, REPLACEMENT */
LE64_BITMASK(BCH_MEMBER_DISCARD, struct bch_member, flags[0], 14, 15)
LE64_BITMASK(BCH_MEMBER_DATA_ALLOWED, struct bch_member, flags[0], 15, 20)
LE64_BITMASK(BCH_MEMBER_GROUP, struct bch_member, flags[0], 20, 28)
BCH_MEMBER_STATE_NR
};
-#define BCH_CACHE_REPLACEMENT_POLICIES() \
- x(lru, 0) \
- x(fifo, 1) \
- x(random, 2)
-
-enum bch_cache_replacement_policies {
-#define x(t, n) BCH_CACHE_REPLACEMENT_##t = n,
- BCH_CACHE_REPLACEMENT_POLICIES()
-#undef x
- BCH_CACHE_REPLACEMENT_NR
-};
-
struct bch_sb_field_members {
struct bch_sb_field field;
struct bch_member members[0];
LE64_BITMASK(BCH_SB_JOURNAL_FLUSH_DELAY,struct bch_sb, flags[3], 30, 62);
LE64_BITMASK(BCH_SB_JOURNAL_FLUSH_DISABLED,struct bch_sb, flags[3], 62, 63);
LE64_BITMASK(BCH_SB_JOURNAL_RECLAIM_DELAY,struct bch_sb, flags[4], 0, 32);
+LE64_BITMASK(BCH_SB_JOURNAL_TRANSACTION_NAMES,struct bch_sb, flags[4], 32, 33);
/*
* Features:
x(usage, 5) \
x(data_usage, 6) \
x(clock, 7) \
- x(dev_usage, 8)
+ x(dev_usage, 8) \
+ x(log, 9)
enum {
#define x(f, nr) BCH_JSET_ENTRY_##f = nr,
__le64 end;
};
+#define BCH_FS_USAGE_TYPES() \
+ x(reserved, 0) \
+ x(inodes, 1) \
+ x(key_version, 2)
+
enum {
- FS_USAGE_RESERVED = 0,
- FS_USAGE_INODES = 1,
- FS_USAGE_KEY_VERSION = 2,
- FS_USAGE_NR = 3
+#define x(f, nr) BCH_FS_USAGE_##f = nr,
+ BCH_FS_USAGE_TYPES()
+#undef x
+ BCH_FS_USAGE_NR
};
struct jset_entry_usage {
struct jset_entry_dev_usage_type d[];
} __attribute__((packed));
+static inline unsigned jset_entry_dev_usage_nr_types(struct jset_entry_dev_usage *u)
+{
+ return (vstruct_bytes(&u->entry) - sizeof(struct jset_entry_dev_usage)) /
+ sizeof(struct jset_entry_dev_usage_type);
+}
+
+struct jset_entry_log {
+ struct jset_entry entry;
+ u8 d[];
+} __attribute__((packed));
+
/*
* On disk format for a journal entry:
* seq is monotonically increasing; every journal entry has its own unique