0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _NILFS_PAGE_H
0011 #define _NILFS_PAGE_H
0012
0013 #include <linux/buffer_head.h>
0014 #include "nilfs.h"
0015
0016
0017
0018
0019 enum {
0020 BH_NILFS_Allocated = BH_PrivateStart,
0021 BH_NILFS_Node,
0022 BH_NILFS_Volatile,
0023 BH_NILFS_Checked,
0024 BH_NILFS_Redirected,
0025 };
0026
0027 BUFFER_FNS(NILFS_Node, nilfs_node)
0028 BUFFER_FNS(NILFS_Volatile, nilfs_volatile)
0029 BUFFER_FNS(NILFS_Checked, nilfs_checked)
0030 BUFFER_FNS(NILFS_Redirected, nilfs_redirected)
0031
0032
0033 int __nilfs_clear_page_dirty(struct page *);
0034
0035 struct buffer_head *nilfs_grab_buffer(struct inode *, struct address_space *,
0036 unsigned long, unsigned long);
0037 void nilfs_forget_buffer(struct buffer_head *);
0038 void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *);
0039 int nilfs_page_buffers_clean(struct page *);
0040 void nilfs_page_bug(struct page *);
0041
0042 int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
0043 void nilfs_copy_back_pages(struct address_space *, struct address_space *);
0044 void nilfs_clear_dirty_page(struct page *, bool);
0045 void nilfs_clear_dirty_pages(struct address_space *, bool);
0046 unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
0047 unsigned int);
0048 unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
0049 sector_t start_blk,
0050 sector_t *blkoff);
0051
0052 #define NILFS_PAGE_BUG(page, m, a...) \
0053 do { nilfs_page_bug(page); BUG(); } while (0)
0054
0055 static inline struct buffer_head *
0056 nilfs_page_get_nth_block(struct page *page, unsigned int count)
0057 {
0058 struct buffer_head *bh = page_buffers(page);
0059
0060 while (count-- > 0)
0061 bh = bh->b_this_page;
0062 get_bh(bh);
0063 return bh;
0064 }
0065
0066 #endif