Skip to content

Commit 7aa7183

Browse files
author
Kent Overstreet
committed
bcachefs: split out lru_format.h
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 789566d commit 7aa7183

3 files changed

Lines changed: 26 additions & 24 deletions

File tree

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -468,18 +468,6 @@ struct bch_backpointer {
468468
struct bpos pos;
469469
} __packed __aligned(8);
470470

471-
/* LRU btree: */
472-
473-
struct bch_lru {
474-
struct bch_val v;
475-
__le64 idx;
476-
} __packed __aligned(8);
477-
478-
#define LRU_ID_STRIPES (1U << 16)
479-
480-
#define LRU_TIME_BITS 48
481-
#define LRU_TIME_MAX ((1ULL << LRU_TIME_BITS) - 1)
482-
483471
/* Optional/variable size superblock sections: */
484472

485473
struct bch_sb_field {
@@ -516,6 +504,7 @@ struct bch_sb_field {
516504
#include "inode_format.h"
517505
#include "journal_seq_blacklist_format.h"
518506
#include "logged_ops_format.h"
507+
#include "lru_format.h"
519508
#include "quota_format.h"
520509
#include "reflink_format.h"
521510
#include "replicas_format.h"

fs/bcachefs/lru.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@ static inline struct bpos lru_pos(u16 lru_id, u64 dev_bucket, u64 time)
2424
return pos;
2525
}
2626

27-
#define BCH_LRU_TYPES() \
28-
x(read) \
29-
x(fragmentation)
30-
31-
enum bch_lru_type {
32-
#define x(n) BCH_LRU_##n,
33-
BCH_LRU_TYPES()
34-
#undef x
35-
};
36-
37-
#define BCH_LRU_FRAGMENTATION_START ((1U << 16) - 1)
38-
3927
static inline enum bch_lru_type lru_type(struct bkey_s_c l)
4028
{
4129
u16 lru_id = l.k->p.inode >> 48;

fs/bcachefs/lru_format.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _BCACHEFS_LRU_FORMAT_H
3+
#define _BCACHEFS_LRU_FORMAT_H
4+
5+
struct bch_lru {
6+
struct bch_val v;
7+
__le64 idx;
8+
} __packed __aligned(8);
9+
10+
#define BCH_LRU_TYPES() \
11+
x(read) \
12+
x(fragmentation)
13+
14+
enum bch_lru_type {
15+
#define x(n) BCH_LRU_##n,
16+
BCH_LRU_TYPES()
17+
#undef x
18+
};
19+
20+
#define BCH_LRU_FRAGMENTATION_START ((1U << 16) - 1)
21+
22+
#define LRU_TIME_BITS 48
23+
#define LRU_TIME_MAX ((1ULL << LRU_TIME_BITS) - 1)
24+
25+
#endif /* _BCACHEFS_LRU_FORMAT_H */

0 commit comments

Comments
 (0)