Btrfs: pretend page cache & commit code

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2007-03-01 18:59:40 -05:00
committed by David Woodhouse
parent 79f95c82dc
commit ed2ff2cba7
5 changed files with 558 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
#ifndef __DISKIO__
#define __DISKIO__
#include "list.h"
struct tree_buffer {
u64 blocknr;
@@ -8,11 +9,16 @@ struct tree_buffer {
struct node node;
struct leaf leaf;
};
struct list_head dirty;
struct list_head cache;
};
struct tree_buffer *read_tree_block(struct ctree_root *root, u64 blocknr);
struct tree_buffer *find_tree_block(struct ctree_root *root, u64 blocknr);
int write_tree_block(struct ctree_root *root, struct tree_buffer *buf);
int dirty_tree_block(struct ctree_root *root, struct tree_buffer *buf);
int clean_tree_block(struct ctree_root *root, struct tree_buffer *buf);
int commit_transaction(struct ctree_root *root);
struct ctree_root *open_ctree(char *filename, struct ctree_super_block *s);
int close_ctree(struct ctree_root *root);
void tree_block_release(struct ctree_root *root, struct tree_buffer *buf);