aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h40
1 files changed, 14 insertions, 26 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 3224820c8514..705f01fe413a 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -14,17 +14,6 @@ extern struct list_head inode_in_use;
14extern struct list_head inode_unused; 14extern struct list_head inode_unused;
15 15
16/* 16/*
17 * Yes, writeback.h requires sched.h
18 * No, sched.h is not included from here.
19 */
20static inline int task_is_pdflush(struct task_struct *task)
21{
22 return task->flags & PF_FLUSHER;
23}
24
25#define current_is_pdflush() task_is_pdflush(current)
26
27/*
28 * fs/fs-writeback.c 17 * fs/fs-writeback.c
29 */ 18 */
30enum writeback_sync_modes { 19enum writeback_sync_modes {
@@ -40,6 +29,8 @@ enum writeback_sync_modes {
40struct writeback_control { 29struct writeback_control {
41 struct backing_dev_info *bdi; /* If !NULL, only write back this 30 struct backing_dev_info *bdi; /* If !NULL, only write back this
42 queue */ 31 queue */
32 struct super_block *sb; /* if !NULL, only write inodes from
33 this super_block */
43 enum writeback_sync_modes sync_mode; 34 enum writeback_sync_modes sync_mode;
44 unsigned long *older_than_this; /* If !NULL, only write back inodes 35 unsigned long *older_than_this; /* If !NULL, only write back inodes
45 older than this */ 36 older than this */
@@ -58,8 +49,8 @@ struct writeback_control {
58 unsigned nonblocking:1; /* Don't get stuck on request queues */ 49 unsigned nonblocking:1; /* Don't get stuck on request queues */
59 unsigned encountered_congestion:1; /* An output: a queue is full */ 50 unsigned encountered_congestion:1; /* An output: a queue is full */
60 unsigned for_kupdate:1; /* A kupdate writeback */ 51 unsigned for_kupdate:1; /* A kupdate writeback */
52 unsigned for_background:1; /* A background writeback */
61 unsigned for_reclaim:1; /* Invoked from the page allocator */ 53 unsigned for_reclaim:1; /* Invoked from the page allocator */
62 unsigned for_writepages:1; /* This is a writepages() call */
63 unsigned range_cyclic:1; /* range_start is cyclic */ 54 unsigned range_cyclic:1; /* range_start is cyclic */
64 unsigned more_io:1; /* more io to be dispatched */ 55 unsigned more_io:1; /* more io to be dispatched */
65 /* 56 /*
@@ -76,9 +67,13 @@ struct writeback_control {
76/* 67/*
77 * fs/fs-writeback.c 68 * fs/fs-writeback.c
78 */ 69 */
79void writeback_inodes(struct writeback_control *wbc); 70struct bdi_writeback;
80int inode_wait(void *); 71int inode_wait(void *);
81void sync_inodes_sb(struct super_block *, int wait); 72void writeback_inodes_sb(struct super_block *);
73void sync_inodes_sb(struct super_block *);
74void writeback_inodes_wbc(struct writeback_control *wbc);
75long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
76void wakeup_flusher_threads(long nr_pages);
82 77
83/* writeback.h requires fs.h; it, too, is not included from here. */ 78/* writeback.h requires fs.h; it, too, is not included from here. */
84static inline void wait_on_inode(struct inode *inode) 79static inline void wait_on_inode(struct inode *inode)
@@ -98,7 +93,6 @@ static inline void inode_sync_wait(struct inode *inode)
98/* 93/*
99 * mm/page-writeback.c 94 * mm/page-writeback.c
100 */ 95 */
101int wakeup_pdflush(long nr_pages);
102void laptop_io_completion(void); 96void laptop_io_completion(void);
103void laptop_sync_completion(void); 97void laptop_sync_completion(void);
104void throttle_vm_writeout(gfp_t gfp_mask); 98void throttle_vm_writeout(gfp_t gfp_mask);
@@ -117,21 +111,20 @@ extern int laptop_mode;
117extern unsigned long determine_dirtyable_memory(void); 111extern unsigned long determine_dirtyable_memory(void);
118 112
119extern int dirty_background_ratio_handler(struct ctl_table *table, int write, 113extern int dirty_background_ratio_handler(struct ctl_table *table, int write,
120 struct file *filp, void __user *buffer, size_t *lenp, 114 void __user *buffer, size_t *lenp,
121 loff_t *ppos); 115 loff_t *ppos);
122extern int dirty_background_bytes_handler(struct ctl_table *table, int write, 116extern int dirty_background_bytes_handler(struct ctl_table *table, int write,
123 struct file *filp, void __user *buffer, size_t *lenp, 117 void __user *buffer, size_t *lenp,
124 loff_t *ppos); 118 loff_t *ppos);
125extern int dirty_ratio_handler(struct ctl_table *table, int write, 119extern int dirty_ratio_handler(struct ctl_table *table, int write,
126 struct file *filp, void __user *buffer, size_t *lenp, 120 void __user *buffer, size_t *lenp,
127 loff_t *ppos); 121 loff_t *ppos);
128extern int dirty_bytes_handler(struct ctl_table *table, int write, 122extern int dirty_bytes_handler(struct ctl_table *table, int write,
129 struct file *filp, void __user *buffer, size_t *lenp, 123 void __user *buffer, size_t *lenp,
130 loff_t *ppos); 124 loff_t *ppos);
131 125
132struct ctl_table; 126struct ctl_table;
133struct file; 127int dirty_writeback_centisecs_handler(struct ctl_table *, int,
134int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
135 void __user *, size_t *, loff_t *); 128 void __user *, size_t *, loff_t *);
136 129
137void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, 130void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty,
@@ -150,17 +143,12 @@ balance_dirty_pages_ratelimited(struct address_space *mapping)
150typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, 143typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
151 void *data); 144 void *data);
152 145
153int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
154int generic_writepages(struct address_space *mapping, 146int generic_writepages(struct address_space *mapping,
155 struct writeback_control *wbc); 147 struct writeback_control *wbc);
156int write_cache_pages(struct address_space *mapping, 148int write_cache_pages(struct address_space *mapping,
157 struct writeback_control *wbc, writepage_t writepage, 149 struct writeback_control *wbc, writepage_t writepage,
158 void *data); 150 void *data);
159int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 151int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
160int sync_page_range(struct inode *inode, struct address_space *mapping,
161 loff_t pos, loff_t count);
162int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
163 loff_t pos, loff_t count);
164void set_page_dirty_balance(struct page *page, int page_mkwrite); 152void set_page_dirty_balance(struct page *page, int page_mkwrite);
165void writeback_set_ratelimit(void); 153void writeback_set_ratelimit(void);
166 154