aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-09-02 03:19:46 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-09-11 03:20:25 -0400
commit66f3b8e2e103a0b93b945764d98e9ba46cb926dd (patch)
tree442bf5664214f0a1448e4010b09868cc58fdd3d1 /include/linux
parentd8a8559cd7a9ccac98d5f6f13297a2ff68a43627 (diff)
writeback: move dirty inodes from super_block to backing_dev_info
This is a first step at introducing per-bdi flusher threads. We should have no change in behaviour, although sb_has_dirty_inodes() is now ridiculously expensive, as there's no easy way to answer that question. Not a huge problem, since it'll be deleted in subsequent patches. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/backing-dev.h9
-rw-r--r--include/linux/fs.h5
2 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 1d52425a6118..928cd5484f4d 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -40,6 +40,8 @@ enum bdi_stat_item {
40#define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) 40#define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))
41 41
42struct backing_dev_info { 42struct backing_dev_info {
43 struct list_head bdi_list;
44
43 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ 45 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
44 unsigned long state; /* Always use atomic bitops on this */ 46 unsigned long state; /* Always use atomic bitops on this */
45 unsigned int capabilities; /* Device capabilities */ 47 unsigned int capabilities; /* Device capabilities */
@@ -58,6 +60,10 @@ struct backing_dev_info {
58 60
59 struct device *dev; 61 struct device *dev;
60 62
63 struct list_head b_dirty; /* dirty inodes */
64 struct list_head b_io; /* parked for writeback */
65 struct list_head b_more_io; /* parked for more writeback */
66
61#ifdef CONFIG_DEBUG_FS 67#ifdef CONFIG_DEBUG_FS
62 struct dentry *debug_dir; 68 struct dentry *debug_dir;
63 struct dentry *debug_stats; 69 struct dentry *debug_stats;
@@ -72,6 +78,9 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
72int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 78int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
73void bdi_unregister(struct backing_dev_info *bdi); 79void bdi_unregister(struct backing_dev_info *bdi);
74 80
81extern struct mutex bdi_lock;
82extern struct list_head bdi_list;
83
75static inline void __add_bdi_stat(struct backing_dev_info *bdi, 84static inline void __add_bdi_stat(struct backing_dev_info *bdi,
76 enum bdi_stat_item item, s64 amount) 85 enum bdi_stat_item item, s64 amount)
77{ 86{
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 46ff7dd6e164..56371be1be65 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -715,7 +715,7 @@ struct posix_acl;
715 715
716struct inode { 716struct inode {
717 struct hlist_node i_hash; 717 struct hlist_node i_hash;
718 struct list_head i_list; 718 struct list_head i_list; /* backing dev IO list */
719 struct list_head i_sb_list; 719 struct list_head i_sb_list;
720 struct list_head i_dentry; 720 struct list_head i_dentry;
721 unsigned long i_ino; 721 unsigned long i_ino;
@@ -1336,9 +1336,6 @@ struct super_block {
1336 struct xattr_handler **s_xattr; 1336 struct xattr_handler **s_xattr;
1337 1337
1338 struct list_head s_inodes; /* all inodes */ 1338 struct list_head s_inodes; /* all inodes */
1339 struct list_head s_dirty; /* dirty inodes */
1340 struct list_head s_io; /* parked for writeback */
1341 struct list_head s_more_io; /* parked for more writeback */
1342 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ 1339 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
1343 struct list_head s_files; 1340 struct list_head s_files;
1344 /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ 1341 /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */