diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-12-01 21:44:38 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-01-09 23:38:41 -0500 |
| commit | df448ca355ce84d62993166294f75517e4128598 (patch) | |
| tree | a69615a19c0a3ab28ee2ed9b7f6dfc2755642099 /fs/bcachefs/inode.h | |
| parent | 59c50511f7a8ecded211656425c9b92e31329333 (diff) | |
bcachefs: bcachefs_metadata_version_persistent_inode_cursors
Persistent cursors for inode allocation.
A free inodes btree would add substantial overhead to inode allocation
and freeing - a "next num to allocate" cursor is always going to be
faster.
We just need it to be persistent, to avoid scanning the inodes btree
from the start on startup.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.h')
| -rw-r--r-- | fs/bcachefs/inode.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h index 5bca6950f20e..d2e134528f0e 100644 --- a/fs/bcachefs/inode.h +++ b/fs/bcachefs/inode.h @@ -68,6 +68,16 @@ void bch2_inode_generation_to_text(struct printbuf *, struct bch_fs *, struct bk .min_val_size = 8, \ }) +int bch2_inode_alloc_cursor_validate(struct bch_fs *, struct bkey_s_c, + struct bkey_validate_context); +void bch2_inode_alloc_cursor_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c); + +#define bch2_bkey_ops_inode_alloc_cursor ((struct bkey_ops) { \ + .key_validate = bch2_inode_alloc_cursor_validate, \ + .val_to_text = bch2_inode_alloc_cursor_to_text, \ + .min_val_size = 16, \ +}) + #if 0 typedef struct { u64 lo; |
