| Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * btnode.h - NILFS B-tree node cache | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. | 
|  | 5 | * | 
|  | 6 | * This program is free software; you can redistribute it and/or modify | 
|  | 7 | * it under the terms of the GNU General Public License as published by | 
|  | 8 | * the Free Software Foundation; either version 2 of the License, or | 
|  | 9 | * (at your option) any later version. | 
|  | 10 | * | 
|  | 11 | * This program is distributed in the hope that it will be useful, | 
|  | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|  | 14 | * GNU General Public License for more details. | 
|  | 15 | * | 
|  | 16 | * You should have received a copy of the GNU General Public License | 
|  | 17 | * along with this program; if not, write to the Free Software | 
|  | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | 
|  | 19 | * | 
|  | 20 | * Written by Seiji Kihara <kihara@osrg.net> | 
|  | 21 | * Revised by Ryusuke Konishi <ryusuke@osrg.net> | 
|  | 22 | */ | 
|  | 23 |  | 
|  | 24 | #ifndef _NILFS_BTNODE_H | 
|  | 25 | #define _NILFS_BTNODE_H | 
|  | 26 |  | 
|  | 27 | #include <linux/types.h> | 
|  | 28 | #include <linux/buffer_head.h> | 
|  | 29 | #include <linux/fs.h> | 
|  | 30 | #include <linux/backing-dev.h> | 
|  | 31 |  | 
|  | 32 |  | 
|  | 33 | struct nilfs_btnode_chkey_ctxt { | 
|  | 34 | __u64 oldkey; | 
|  | 35 | __u64 newkey; | 
|  | 36 | struct buffer_head *bh; | 
|  | 37 | struct buffer_head *newbh; | 
|  | 38 | }; | 
|  | 39 |  | 
|  | 40 | void nilfs_btnode_cache_init_once(struct address_space *); | 
| Ryusuke Konishi | a53b475 | 2009-05-27 22:11:46 +0900 | [diff] [blame] | 41 | void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); | 
| Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 42 | void nilfs_btnode_cache_clear(struct address_space *); | 
| Ryusuke Konishi | d501d73 | 2009-11-13 16:04:11 +0900 | [diff] [blame] | 43 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, | 
|  | 44 | __u64 blocknr); | 
| Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 45 | int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, | 
| Ryusuke Konishi | 75f65ed | 2009-11-13 16:30:41 +0900 | [diff] [blame] | 46 | struct buffer_head **); | 
| Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 47 | void nilfs_btnode_delete(struct buffer_head *); | 
|  | 48 | int nilfs_btnode_prepare_change_key(struct address_space *, | 
|  | 49 | struct nilfs_btnode_chkey_ctxt *); | 
|  | 50 | void nilfs_btnode_commit_change_key(struct address_space *, | 
|  | 51 | struct nilfs_btnode_chkey_ctxt *); | 
|  | 52 | void nilfs_btnode_abort_change_key(struct address_space *, | 
|  | 53 | struct nilfs_btnode_chkey_ctxt *); | 
|  | 54 |  | 
|  | 55 | #define nilfs_btnode_mark_dirty(bh)	nilfs_mark_buffer_dirty(bh) | 
|  | 56 |  | 
|  | 57 |  | 
|  | 58 | #endif	/* _NILFS_BTNODE_H */ |