linux-next/fs/bcachefs/logged_ops_format.h
Kent Overstreet 7dbe48b963 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>
2024-12-16 14:01:32 -05:00

36 lines
676 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_LOGGED_OPS_FORMAT_H
#define _BCACHEFS_LOGGED_OPS_FORMAT_H
enum logged_ops_inums {
LOGGED_OPS_INUM_logged_ops,
LOGGED_OPS_INUM_inode_cursors,
};
struct bch_logged_op_truncate {
struct bch_val v;
__le32 subvol;
__le32 pad;
__le64 inum;
__le64 new_i_size;
};
enum logged_op_finsert_state {
LOGGED_OP_FINSERT_start,
LOGGED_OP_FINSERT_shift_extents,
LOGGED_OP_FINSERT_finish,
};
struct bch_logged_op_finsert {
struct bch_val v;
__u8 state;
__u8 pad[3];
__le32 subvol;
__le64 inum;
__le64 dst_offset;
__le64 src_offset;
__le64 pos;
};
#endif /* _BCACHEFS_LOGGED_OPS_FORMAT_H */