blob: 0f88dbc9bcb3ef4536ff13a28321d432070a8413 [file] [log] [blame]
Ryusuke Konishiae980432018-09-04 15:46:30 -07001/* SPDX-License-Identifier: GPL-2.0+ */
Ryusuke Konishia60be982009-04-06 19:01:25 -07002/*
3 * btnode.h - NILFS B-tree node cache
4 *
5 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
6 *
Ryusuke Konishi4b420ab2016-05-23 16:23:09 -07007 * Written by Seiji Kihara.
8 * Revised by Ryusuke Konishi.
Ryusuke Konishia60be982009-04-06 19:01:25 -07009 */
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 Dubeykof5974c82012-07-30 14:42:10 -070019/**
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 Konishia60be982009-04-06 19:01:25 -070026struct nilfs_btnode_chkey_ctxt {
27 __u64 oldkey;
28 __u64 newkey;
29 struct buffer_head *bh;
30 struct buffer_head *newbh;
31};
32
Ryusuke Konishia60be982009-04-06 19:01:25 -070033void nilfs_btnode_cache_clear(struct address_space *);
Ryusuke Konishid501d732009-11-13 16:04:11 +090034struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
35 __u64 blocknr);
Ryusuke Konishi26dfdd82010-07-18 10:42:23 +090036int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int,
Mike Christie2a222ca2016-06-05 14:31:43 -050037 int, struct buffer_head **, sector_t *);
Ryusuke Konishia60be982009-04-06 19:01:25 -070038void nilfs_btnode_delete(struct buffer_head *);
39int nilfs_btnode_prepare_change_key(struct address_space *,
40 struct nilfs_btnode_chkey_ctxt *);
41void nilfs_btnode_commit_change_key(struct address_space *,
42 struct nilfs_btnode_chkey_ctxt *);
43void nilfs_btnode_abort_change_key(struct address_space *,
44 struct nilfs_btnode_chkey_ctxt *);
45
Ryusuke Konishia60be982009-04-06 19:01:25 -070046#endif /* _NILFS_BTNODE_H */