diff options
Diffstat (limited to 'include/linux/backing-dev.h')
| -rw-r--r-- | include/linux/backing-dev.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index fcbc26af00e4..35b00746c712 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/timer.h> | ||
| 17 | #include <linux/writeback.h> | 18 | #include <linux/writeback.h> |
| 18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
| 19 | 20 | ||
| @@ -30,6 +31,7 @@ enum bdi_state { | |||
| 30 | BDI_async_congested, /* The async (write) queue is getting full */ | 31 | BDI_async_congested, /* The async (write) queue is getting full */ |
| 31 | BDI_sync_congested, /* The sync queue is getting full */ | 32 | BDI_sync_congested, /* The sync queue is getting full */ |
| 32 | BDI_registered, /* bdi_register() was done */ | 33 | BDI_registered, /* bdi_register() was done */ |
| 34 | BDI_writeback_running, /* Writeback is in progress */ | ||
| 33 | BDI_unused, /* Available bits start here */ | 35 | BDI_unused, /* Available bits start here */ |
| 34 | }; | 36 | }; |
| 35 | 37 | ||
| @@ -44,22 +46,21 @@ enum bdi_stat_item { | |||
| 44 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) | 46 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) |
| 45 | 47 | ||
| 46 | struct bdi_writeback { | 48 | struct bdi_writeback { |
| 47 | struct list_head list; /* hangs off the bdi */ | 49 | struct backing_dev_info *bdi; /* our parent bdi */ |
| 48 | |||
| 49 | struct backing_dev_info *bdi; /* our parent bdi */ | ||
| 50 | unsigned int nr; | 50 | unsigned int nr; |
| 51 | 51 | ||
| 52 | unsigned long last_old_flush; /* last old data flush */ | 52 | unsigned long last_old_flush; /* last old data flush */ |
| 53 | unsigned long last_active; /* last time bdi thread was active */ | ||
| 53 | 54 | ||
| 54 | struct task_struct *task; /* writeback task */ | 55 | struct task_struct *task; /* writeback thread */ |
| 55 | struct list_head b_dirty; /* dirty inodes */ | 56 | struct timer_list wakeup_timer; /* used for delayed bdi thread wakeup */ |
| 56 | struct list_head b_io; /* parked for writeback */ | 57 | struct list_head b_dirty; /* dirty inodes */ |
| 57 | struct list_head b_more_io; /* parked for more writeback */ | 58 | struct list_head b_io; /* parked for writeback */ |
| 59 | struct list_head b_more_io; /* parked for more writeback */ | ||
| 58 | }; | 60 | }; |
| 59 | 61 | ||
| 60 | struct backing_dev_info { | 62 | struct backing_dev_info { |
| 61 | struct list_head bdi_list; | 63 | struct list_head bdi_list; |
| 62 | struct rcu_head rcu_head; | ||
| 63 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ | 64 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ |
| 64 | unsigned long state; /* Always use atomic bitops on this */ | 65 | unsigned long state; /* Always use atomic bitops on this */ |
| 65 | unsigned int capabilities; /* Device capabilities */ | 66 | unsigned int capabilities; /* Device capabilities */ |
| @@ -79,15 +80,14 @@ struct backing_dev_info { | |||
| 79 | unsigned int max_ratio, max_prop_frac; | 80 | unsigned int max_ratio, max_prop_frac; |
| 80 | 81 | ||
| 81 | struct bdi_writeback wb; /* default writeback info for this bdi */ | 82 | struct bdi_writeback wb; /* default writeback info for this bdi */ |
| 82 | spinlock_t wb_lock; /* protects update side of wb_list */ | 83 | spinlock_t wb_lock; /* protects work_list */ |
| 83 | struct list_head wb_list; /* the flusher threads hanging off this bdi */ | ||
| 84 | unsigned long wb_mask; /* bitmask of registered tasks */ | ||
| 85 | unsigned int wb_cnt; /* number of registered tasks */ | ||
| 86 | 84 | ||
| 87 | struct list_head work_list; | 85 | struct list_head work_list; |
| 88 | 86 | ||
| 89 | struct device *dev; | 87 | struct device *dev; |
| 90 | 88 | ||
| 89 | struct timer_list laptop_mode_wb_timer; | ||
| 90 | |||
| 91 | #ifdef CONFIG_DEBUG_FS | 91 | #ifdef CONFIG_DEBUG_FS |
| 92 | struct dentry *debug_dir; | 92 | struct dentry *debug_dir; |
| 93 | struct dentry *debug_stats; | 93 | struct dentry *debug_stats; |
| @@ -101,10 +101,13 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
| 101 | const char *fmt, ...); | 101 | const char *fmt, ...); |
| 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 103 | void bdi_unregister(struct backing_dev_info *bdi); | 103 | void bdi_unregister(struct backing_dev_info *bdi); |
| 104 | void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, | 104 | int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); |
| 105 | long nr_pages); | 105 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages); |
| 106 | int bdi_writeback_task(struct bdi_writeback *wb); | 106 | void bdi_start_background_writeback(struct backing_dev_info *bdi); |
| 107 | int bdi_writeback_thread(void *data); | ||
| 107 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | 108 | int bdi_has_dirty_io(struct backing_dev_info *bdi); |
| 109 | void bdi_arm_supers_timer(void); | ||
| 110 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); | ||
| 108 | 111 | ||
| 109 | extern spinlock_t bdi_lock; | 112 | extern spinlock_t bdi_lock; |
| 110 | extern struct list_head bdi_list; | 113 | extern struct list_head bdi_list; |
| @@ -246,6 +249,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
| 246 | #endif | 249 | #endif |
| 247 | 250 | ||
| 248 | extern struct backing_dev_info default_backing_dev_info; | 251 | extern struct backing_dev_info default_backing_dev_info; |
| 252 | extern struct backing_dev_info noop_backing_dev_info; | ||
| 249 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); | 253 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); |
| 250 | 254 | ||
| 251 | int writeback_in_progress(struct backing_dev_info *bdi); | 255 | int writeback_in_progress(struct backing_dev_info *bdi); |
