Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * NILFS B-tree node cache
0004  *
0005  * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
0006  *
0007  * Written by Seiji Kihara.
0008  * Revised by Ryusuke Konishi.
0009  */
0010 
0011 #ifndef _NILFS_BTNODE_H
0012 #define _NILFS_BTNODE_H
0013 
0014 #include <linux/types.h>
0015 #include <linux/buffer_head.h>
0016 #include <linux/fs.h>
0017 #include <linux/backing-dev.h>
0018 
0019 /**
0020  * struct nilfs_btnode_chkey_ctxt - change key context
0021  * @oldkey: old key of block's moving content
0022  * @newkey: new key for block's content
0023  * @bh: buffer head of old buffer
0024  * @newbh: buffer head of new buffer
0025  */
0026 struct nilfs_btnode_chkey_ctxt {
0027     __u64 oldkey;
0028     __u64 newkey;
0029     struct buffer_head *bh;
0030     struct buffer_head *newbh;
0031 };
0032 
0033 void nilfs_init_btnc_inode(struct inode *btnc_inode);
0034 void nilfs_btnode_cache_clear(struct address_space *);
0035 struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
0036                           __u64 blocknr);
0037 int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t,
0038                   blk_opf_t, struct buffer_head **, sector_t *);
0039 void nilfs_btnode_delete(struct buffer_head *);
0040 int nilfs_btnode_prepare_change_key(struct address_space *,
0041                     struct nilfs_btnode_chkey_ctxt *);
0042 void nilfs_btnode_commit_change_key(struct address_space *,
0043                     struct nilfs_btnode_chkey_ctxt *);
0044 void nilfs_btnode_abort_change_key(struct address_space *,
0045                    struct nilfs_btnode_chkey_ctxt *);
0046 
0047 #endif  /* _NILFS_BTNODE_H */