mirror of
https://github.com/versity/scoutfs.git
synced 2026-05-02 10:55:44 +00:00
Convert metadata block and file data extent allocations to use the radix allocator. Most of this is simple transitions between types and calls. The server no longer has to initialize blocks because mkfs can write a single radix parent block with fully set parent refs to initialize a full radix. We remove the code and fields that were responsible for adding uninitialized data and metadata. The rest of the unused block allocator code is only ifdefed out. It'll be removed in a separate patch to reduce noise here. Signed-off-by: Zach Brown <zab@versity.com>
70 lines
2.3 KiB
C
70 lines
2.3 KiB
C
#ifndef _SCOUTFS_BTREE_H_
|
|
#define _SCOUTFS_BTREE_H_
|
|
|
|
#include <linux/uio.h>
|
|
|
|
struct scoutfs_radix_allocator;
|
|
struct scoutfs_block_writer;
|
|
struct scoutfs_block;
|
|
|
|
struct scoutfs_btree_item_ref {
|
|
struct super_block *sb;
|
|
struct scoutfs_block *bl;
|
|
void *key;
|
|
unsigned key_len;
|
|
void *val;
|
|
unsigned val_len;
|
|
};
|
|
|
|
#define SCOUTFS_BTREE_ITEM_REF(name) \
|
|
struct scoutfs_btree_item_ref name = {NULL,}
|
|
|
|
|
|
int scoutfs_btree_lookup(struct super_block *sb, struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
struct scoutfs_btree_item_ref *iref);
|
|
int scoutfs_btree_insert(struct super_block *sb,
|
|
struct scoutfs_radix_allocator *alloc,
|
|
struct scoutfs_block_writer *wri,
|
|
struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
void *val, unsigned val_len);
|
|
int scoutfs_btree_update(struct super_block *sb,
|
|
struct scoutfs_radix_allocator *alloc,
|
|
struct scoutfs_block_writer *wri,
|
|
struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
void *val, unsigned val_len);
|
|
int scoutfs_btree_force(struct super_block *sb,
|
|
struct scoutfs_radix_allocator *alloc,
|
|
struct scoutfs_block_writer *wri,
|
|
struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
void *val, unsigned val_len);
|
|
int scoutfs_btree_delete(struct super_block *sb,
|
|
struct scoutfs_radix_allocator *alloc,
|
|
struct scoutfs_block_writer *wri,
|
|
struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len);
|
|
int scoutfs_btree_next(struct super_block *sb, struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
struct scoutfs_btree_item_ref *iref);
|
|
int scoutfs_btree_after(struct super_block *sb, struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
struct scoutfs_btree_item_ref *iref);
|
|
int scoutfs_btree_prev(struct super_block *sb, struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
struct scoutfs_btree_item_ref *iref);
|
|
int scoutfs_btree_before(struct super_block *sb, struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len,
|
|
struct scoutfs_btree_item_ref *iref);
|
|
int scoutfs_btree_dirty(struct super_block *sb,
|
|
struct scoutfs_radix_allocator *alloc,
|
|
struct scoutfs_block_writer *wri,
|
|
struct scoutfs_btree_root *root,
|
|
void *key, unsigned key_len);
|
|
|
|
void scoutfs_btree_put_iref(struct scoutfs_btree_item_ref *iref);
|
|
|
|
#endif
|