btnode.h 1.4 KB

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