btnode.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * btnode.h - NILFS B-tree node cache
  3. *
  4. * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * Written by Seiji Kihara.
  17. * Revised by Ryusuke Konishi.
  18. */
  19. #ifndef _NILFS_BTNODE_H
  20. #define _NILFS_BTNODE_H
  21. #include <linux/types.h>
  22. #include <linux/buffer_head.h>
  23. #include <linux/fs.h>
  24. #include <linux/backing-dev.h>
  25. /**
  26. * struct nilfs_btnode_chkey_ctxt - change key context
  27. * @oldkey: old key of block's moving content
  28. * @newkey: new key for block's content
  29. * @bh: buffer head of old buffer
  30. * @newbh: buffer head of new buffer
  31. */
  32. struct nilfs_btnode_chkey_ctxt {
  33. __u64 oldkey;
  34. __u64 newkey;
  35. struct buffer_head *bh;
  36. struct buffer_head *newbh;
  37. };
  38. void nilfs_btnode_cache_clear(struct address_space *);
  39. struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
  40. __u64 blocknr);
  41. int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t, int,
  42. int, struct buffer_head **, sector_t *);
  43. void nilfs_btnode_delete(struct buffer_head *);
  44. int nilfs_btnode_prepare_change_key(struct address_space *,
  45. struct nilfs_btnode_chkey_ctxt *);
  46. void nilfs_btnode_commit_change_key(struct address_space *,
  47. struct nilfs_btnode_chkey_ctxt *);
  48. void nilfs_btnode_abort_change_key(struct address_space *,
  49. struct nilfs_btnode_chkey_ctxt *);
  50. #endif /* _NILFS_BTNODE_H */