2 * Copyright (C) 2007 Oracle. All rights reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 021110-1307, USA.
21 #include "extent-cache.h"
25 struct cache_extent cache_node
;
31 struct list_head dirty
;
32 struct list_head cache
;
34 struct btrfs_node node
;
35 struct btrfs_leaf leaf
;
39 struct btrfs_buffer
*read_tree_block(struct btrfs_root
*root
, u64 bytenr
,
41 struct btrfs_buffer
*find_tree_block(struct btrfs_root
*root
, u64 bytenr
,
43 int write_tree_block(struct btrfs_trans_handle
*trans
, struct btrfs_root
*root
,
44 struct btrfs_buffer
*buf
);
45 int dirty_tree_block(struct btrfs_trans_handle
*trans
, struct btrfs_root
*root
,
46 struct btrfs_buffer
*buf
);
47 int clean_tree_block(struct btrfs_trans_handle
*trans
,
48 struct btrfs_root
*root
, struct btrfs_buffer
*buf
);
49 int btrfs_commit_transaction(struct btrfs_trans_handle
*trans
, struct btrfs_root
50 *root
, struct btrfs_super_block
*s
);
51 struct btrfs_root
*open_ctree(char *filename
, struct btrfs_super_block
*s
);
52 struct btrfs_root
*open_ctree_fd(int fp
, struct btrfs_super_block
*super
);
53 int close_ctree(struct btrfs_root
*root
, struct btrfs_super_block
*s
);
54 void btrfs_block_release(struct btrfs_root
*root
, struct btrfs_buffer
*buf
);
55 int write_ctree_super(struct btrfs_trans_handle
*trans
, struct btrfs_root
*root
,
56 struct btrfs_super_block
*s
);
57 int btrfs_map_bh_to_logical(struct btrfs_root
*root
, struct btrfs_buffer
*bh
,
59 int btrfs_csum_super(struct btrfs_root
*root
, struct btrfs_super_block
*super
);
60 int btrfs_csum_node(struct btrfs_root
*root
, struct btrfs_node
*node
);
61 #define BTRFS_SUPER_INFO_OFFSET (16 * 1024)