1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef _NILFS_PAGE_H
20#define _NILFS_PAGE_H
21
22#include <linux/buffer_head.h>
23#include "nilfs.h"
24
25
26
27
28enum {
29 BH_NILFS_Allocated = BH_PrivateStart,
30 BH_NILFS_Node,
31 BH_NILFS_Volatile,
32 BH_NILFS_Checked,
33 BH_NILFS_Redirected,
34};
35
36BUFFER_FNS(NILFS_Node, nilfs_node)
37BUFFER_FNS(NILFS_Volatile, nilfs_volatile)
38BUFFER_FNS(NILFS_Checked, nilfs_checked)
39BUFFER_FNS(NILFS_Redirected, nilfs_redirected)
40
41
42int __nilfs_clear_page_dirty(struct page *);
43
44struct buffer_head *nilfs_grab_buffer(struct inode *, struct address_space *,
45 unsigned long, unsigned long);
46void nilfs_forget_buffer(struct buffer_head *);
47void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *);
48int nilfs_page_buffers_clean(struct page *);
49void nilfs_page_bug(struct page *);
50
51int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
52void nilfs_copy_back_pages(struct address_space *, struct address_space *);
53void nilfs_clear_dirty_page(struct page *, bool);
54void nilfs_clear_dirty_pages(struct address_space *, bool);
55void nilfs_mapping_init(struct address_space *mapping, struct inode *inode);
56unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
57 unsigned int);
58unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
59 sector_t start_blk,
60 sector_t *blkoff);
61
62#define NILFS_PAGE_BUG(page, m, a...) \
63 do { nilfs_page_bug(page); BUG(); } while (0)
64
65static inline struct buffer_head *
66nilfs_page_get_nth_block(struct page *page, unsigned int count)
67{
68 struct buffer_head *bh = page_buffers(page);
69
70 while (count-- > 0)
71 bh = bh->b_this_page;
72 get_bh(bh);
73 return bh;
74}
75
76#endif
77