disk-io.h 1.1 KB
Newer Older
1 2
#ifndef __DISKIO__
#define __DISKIO__
3
#include "list.h"
4

C
Chris Mason 已提交
5
struct btrfs_buffer {
6 7
	u64 blocknr;
	int count;
C
Chris Mason 已提交
8 9
	struct list_head dirty;
	struct list_head cache;
10
	union {
C
Chris Mason 已提交
11 12
		struct btrfs_node node;
		struct btrfs_leaf leaf;
13 14 15
	};
};

C
Chris Mason 已提交
16 17 18 19 20 21 22 23 24 25 26
struct btrfs_buffer *read_tree_block(struct btrfs_root *root, u64 blocknr);
struct btrfs_buffer *find_tree_block(struct btrfs_root *root, u64 blocknr);
int write_tree_block(struct btrfs_root *root, struct btrfs_buffer *buf);
int dirty_tree_block(struct btrfs_root *root, struct btrfs_buffer *buf);
int clean_tree_block(struct btrfs_root *root, struct btrfs_buffer *buf);
int btrfs_commit_transaction(struct btrfs_root *root,
			     struct btrfs_super_block *s);
struct btrfs_root *open_ctree(char *filename, struct btrfs_super_block *s);
int close_ctree(struct btrfs_root *root, struct btrfs_super_block *s);
void btrfs_block_release(struct btrfs_root *root, struct btrfs_buffer *buf);
int write_ctree_super(struct btrfs_root *root, struct btrfs_super_block *s);
C
Chris Mason 已提交
27
int mkfs(int fd, u64 num_blocks, u32 blocksize);
28

C
Chris Mason 已提交
29
#define BTRFS_SUPER_INFO_OFFSET (16 * 1024)
30 31

#endif