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 | * |
Ryusuke Konishi | 4b420ab | 2016-05-23 16:23:09 -0700 | [diff] [blame] | 16 | * Written by Seiji Kihara. |
| 17 | * Revised by Ryusuke Konishi. |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef _NILFS_BTNODE_H |
| 21 | #define _NILFS_BTNODE_H |
| 22 | |
| 23 | #include <linux/types.h> |
| 24 | #include <linux/buffer_head.h> |
| 25 | #include <linux/fs.h> |
| 26 | #include <linux/backing-dev.h> |
| 27 | |
Vyacheslav Dubeyko | f5974c8 | 2012-07-30 14:42:10 -0700 | [diff] [blame] | 28 | /** |
| 29 | * struct nilfs_btnode_chkey_ctxt - change key context |
| 30 | * @oldkey: old key of block's moving content |
| 31 | * @newkey: new key for block's content |
| 32 | * @bh: buffer head of old buffer |
| 33 | * @newbh: buffer head of new buffer |
| 34 | */ |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 35 | struct nilfs_btnode_chkey_ctxt { |
| 36 | __u64 oldkey; |
| 37 | __u64 newkey; |
| 38 | struct buffer_head *bh; |
| 39 | struct buffer_head *newbh; |
| 40 | }; |
| 41 | |
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 | 26dfdd8 | 2010-07-18 10:42:23 +0900 | [diff] [blame] | 45 | int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int, |
Mike Christie | 2a222ca | 2016-06-05 14:31:43 -0500 | [diff] [blame] | 46 | int, struct buffer_head **, sector_t *); |
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 | |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 55 | #endif /* _NILFS_BTNODE_H */ |