^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0+ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * btnode.h - NILFS B-tree node cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Written by Seiji Kihara.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Revised by Ryusuke Konishi.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef _NILFS_BTNODE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define _NILFS_BTNODE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/buffer_head.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/backing-dev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * struct nilfs_btnode_chkey_ctxt - change key context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * @oldkey: old key of block's moving content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * @newkey: new key for block's content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * @bh: buffer head of old buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * @newbh: buffer head of new buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct nilfs_btnode_chkey_ctxt {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __u64 oldkey;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __u64 newkey;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct buffer_head *bh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct buffer_head *newbh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) void nilfs_btnode_cache_clear(struct address_space *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __u64 blocknr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int, struct buffer_head **, sector_t *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void nilfs_btnode_delete(struct buffer_head *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) int nilfs_btnode_prepare_change_key(struct address_space *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct nilfs_btnode_chkey_ctxt *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void nilfs_btnode_commit_change_key(struct address_space *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct nilfs_btnode_chkey_ctxt *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) void nilfs_btnode_abort_change_key(struct address_space *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct nilfs_btnode_chkey_ctxt *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #endif /* _NILFS_BTNODE_H */