Ryusuke Konishi | ae98043 | 2018-09-04 15:46:30 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 2 | /* |
| 3 | * btnode.h - NILFS B-tree node cache |
| 4 | * |
| 5 | * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. |
| 6 | * |
Ryusuke Konishi | 4b420ab | 2016-05-23 16:23:09 -0700 | [diff] [blame] | 7 | * Written by Seiji Kihara. |
| 8 | * Revised by Ryusuke Konishi. |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _NILFS_BTNODE_H |
| 12 | #define _NILFS_BTNODE_H |
| 13 | |
| 14 | #include <linux/types.h> |
| 15 | #include <linux/buffer_head.h> |
| 16 | #include <linux/fs.h> |
| 17 | #include <linux/backing-dev.h> |
| 18 | |
Vyacheslav Dubeyko | f5974c8 | 2012-07-30 14:42:10 -0700 | [diff] [blame] | 19 | /** |
| 20 | * struct nilfs_btnode_chkey_ctxt - change key context |
| 21 | * @oldkey: old key of block's moving content |
| 22 | * @newkey: new key for block's content |
| 23 | * @bh: buffer head of old buffer |
| 24 | * @newbh: buffer head of new buffer |
| 25 | */ |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 26 | struct nilfs_btnode_chkey_ctxt { |
| 27 | __u64 oldkey; |
| 28 | __u64 newkey; |
| 29 | struct buffer_head *bh; |
| 30 | struct buffer_head *newbh; |
| 31 | }; |
| 32 | |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 33 | void nilfs_btnode_cache_clear(struct address_space *); |
Ryusuke Konishi | d501d73 | 2009-11-13 16:04:11 +0900 | [diff] [blame] | 34 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, |
| 35 | __u64 blocknr); |
Ryusuke Konishi | 26dfdd8 | 2010-07-18 10:42:23 +0900 | [diff] [blame] | 36 | int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int, |
Mike Christie | 2a222ca | 2016-06-05 14:31:43 -0500 | [diff] [blame] | 37 | int, struct buffer_head **, sector_t *); |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 38 | void nilfs_btnode_delete(struct buffer_head *); |
| 39 | int nilfs_btnode_prepare_change_key(struct address_space *, |
| 40 | struct nilfs_btnode_chkey_ctxt *); |
| 41 | void nilfs_btnode_commit_change_key(struct address_space *, |
| 42 | struct nilfs_btnode_chkey_ctxt *); |
| 43 | void nilfs_btnode_abort_change_key(struct address_space *, |
| 44 | struct nilfs_btnode_chkey_ctxt *); |
| 45 | |
Ryusuke Konishi | a60be98 | 2009-04-06 19:01:25 -0700 | [diff] [blame] | 46 | #endif /* _NILFS_BTNODE_H */ |