diff options
author | Andrew Morton <akpm@osdl.org> | 2006-10-20 02:28:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:35 -0400 |
commit | 3fcfab16c5b86eaa3db3a9a31adba550c5b67141 (patch) | |
tree | bd348fa081b8fbec2c79fbf8f173a306d70b2b2c /fs | |
parent | 79e2de4bc53d7ca2a8eedee49e4a92479b4b530e (diff) |
[PATCH] separate bdi congestion functions from queue congestion functions
Separate out the concept of "queue congestion" from "backing-dev congestion".
Congestion is a backing-dev concept, not a queue concept.
The blk_* congestion functions are retained, as wrappers around the core
backing-dev congestion functions.
This proper layering is needed so that NFS can cleanly use the congestion
functions, and so that CONFIG_BLOCK=n actually links.
Cc: "Thomas Maier" <balagi@justmail.de>
Cc: "Jens Axboe" <jens.axboe@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: David Howells <dhowells@redhat.com>
Cc: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/file.c | 3 | ||||
-rw-r--r-- | fs/nfs/write.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/journal.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/kmem.c | 5 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 3 |
5 files changed, 12 insertions, 6 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index f4b8f8b3fbdd..8337451e7897 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/smp_lock.h> | 13 | #include <linux/smp_lock.h> |
14 | #include <linux/buffer_head.h> | 14 | #include <linux/buffer_head.h> |
15 | #include <linux/writeback.h> | 15 | #include <linux/writeback.h> |
16 | #include <linux/backing-dev.h> | ||
16 | #include <linux/blkdev.h> | 17 | #include <linux/blkdev.h> |
17 | 18 | ||
18 | int fat_generic_ioctl(struct inode *inode, struct file *filp, | 19 | int fat_generic_ioctl(struct inode *inode, struct file *filp, |
@@ -118,7 +119,7 @@ static int fat_file_release(struct inode *inode, struct file *filp) | |||
118 | if ((filp->f_mode & FMODE_WRITE) && | 119 | if ((filp->f_mode & FMODE_WRITE) && |
119 | MSDOS_SB(inode->i_sb)->options.flush) { | 120 | MSDOS_SB(inode->i_sb)->options.flush) { |
120 | fat_flush_inodes(inode->i_sb, inode, NULL); | 121 | fat_flush_inodes(inode->i_sb, inode, NULL); |
121 | blk_congestion_wait(WRITE, HZ/10); | 122 | congestion_wait(WRITE, HZ/10); |
122 | } | 123 | } |
123 | return 0; | 124 | return 0; |
124 | } | 125 | } |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index f6675d2c386c..ca92ac36fe9d 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -57,6 +57,8 @@ | |||
57 | #include <linux/nfs_fs.h> | 57 | #include <linux/nfs_fs.h> |
58 | #include <linux/nfs_mount.h> | 58 | #include <linux/nfs_mount.h> |
59 | #include <linux/nfs_page.h> | 59 | #include <linux/nfs_page.h> |
60 | #include <linux/backing-dev.h> | ||
61 | |||
60 | #include <asm/uaccess.h> | 62 | #include <asm/uaccess.h> |
61 | #include <linux/smp_lock.h> | 63 | #include <linux/smp_lock.h> |
62 | 64 | ||
@@ -395,7 +397,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) | |||
395 | out: | 397 | out: |
396 | clear_bit(BDI_write_congested, &bdi->state); | 398 | clear_bit(BDI_write_congested, &bdi->state); |
397 | wake_up_all(&nfs_write_congestion); | 399 | wake_up_all(&nfs_write_congestion); |
398 | writeback_congestion_end(); | 400 | congestion_end(WRITE); |
399 | return err; | 401 | return err; |
400 | } | 402 | } |
401 | 403 | ||
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index ad8cbc49883a..85ce23268302 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/workqueue.h> | 53 | #include <linux/workqueue.h> |
54 | #include <linux/writeback.h> | 54 | #include <linux/writeback.h> |
55 | #include <linux/blkdev.h> | 55 | #include <linux/blkdev.h> |
56 | #include <linux/backing-dev.h> | ||
56 | 57 | ||
57 | /* gets a struct reiserfs_journal_list * from a list head */ | 58 | /* gets a struct reiserfs_journal_list * from a list head */ |
58 | #define JOURNAL_LIST_ENTRY(h) (list_entry((h), struct reiserfs_journal_list, \ | 59 | #define JOURNAL_LIST_ENTRY(h) (list_entry((h), struct reiserfs_journal_list, \ |
@@ -970,7 +971,7 @@ int reiserfs_async_progress_wait(struct super_block *s) | |||
970 | DEFINE_WAIT(wait); | 971 | DEFINE_WAIT(wait); |
971 | struct reiserfs_journal *j = SB_JOURNAL(s); | 972 | struct reiserfs_journal *j = SB_JOURNAL(s); |
972 | if (atomic_read(&j->j_async_throttle)) | 973 | if (atomic_read(&j->j_async_throttle)) |
973 | blk_congestion_wait(WRITE, HZ / 10); | 974 | congestion_wait(WRITE, HZ / 10); |
974 | return 0; | 975 | return 0; |
975 | } | 976 | } |
976 | 977 | ||
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c index d59737589815..004baf600611 100644 --- a/fs/xfs/linux-2.6/kmem.c +++ b/fs/xfs/linux-2.6/kmem.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/highmem.h> | 21 | #include <linux/highmem.h> |
22 | #include <linux/swap.h> | 22 | #include <linux/swap.h> |
23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
24 | #include <linux/backing-dev.h> | ||
24 | #include "time.h" | 25 | #include "time.h" |
25 | #include "kmem.h" | 26 | #include "kmem.h" |
26 | 27 | ||
@@ -53,7 +54,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags) | |||
53 | printk(KERN_ERR "XFS: possible memory allocation " | 54 | printk(KERN_ERR "XFS: possible memory allocation " |
54 | "deadlock in %s (mode:0x%x)\n", | 55 | "deadlock in %s (mode:0x%x)\n", |
55 | __FUNCTION__, lflags); | 56 | __FUNCTION__, lflags); |
56 | blk_congestion_wait(WRITE, HZ/50); | 57 | congestion_wait(WRITE, HZ/50); |
57 | } while (1); | 58 | } while (1); |
58 | } | 59 | } |
59 | 60 | ||
@@ -131,7 +132,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags) | |||
131 | printk(KERN_ERR "XFS: possible memory allocation " | 132 | printk(KERN_ERR "XFS: possible memory allocation " |
132 | "deadlock in %s (mode:0x%x)\n", | 133 | "deadlock in %s (mode:0x%x)\n", |
133 | __FUNCTION__, lflags); | 134 | __FUNCTION__, lflags); |
134 | blk_congestion_wait(WRITE, HZ/50); | 135 | congestion_wait(WRITE, HZ/50); |
135 | } while (1); | 136 | } while (1); |
136 | } | 137 | } |
137 | 138 | ||
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 9bbadafdcb00..db5f5a3608ca 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/hash.h> | 30 | #include <linux/hash.h> |
31 | #include <linux/kthread.h> | 31 | #include <linux/kthread.h> |
32 | #include <linux/migrate.h> | 32 | #include <linux/migrate.h> |
33 | #include <linux/backing-dev.h> | ||
33 | #include "xfs_linux.h" | 34 | #include "xfs_linux.h" |
34 | 35 | ||
35 | STATIC kmem_zone_t *xfs_buf_zone; | 36 | STATIC kmem_zone_t *xfs_buf_zone; |
@@ -395,7 +396,7 @@ _xfs_buf_lookup_pages( | |||
395 | 396 | ||
396 | XFS_STATS_INC(xb_page_retries); | 397 | XFS_STATS_INC(xb_page_retries); |
397 | xfsbufd_wakeup(0, gfp_mask); | 398 | xfsbufd_wakeup(0, gfp_mask); |
398 | blk_congestion_wait(WRITE, HZ/50); | 399 | congestion_wait(WRITE, HZ/50); |
399 | goto retry; | 400 | goto retry; |
400 | } | 401 | } |
401 | 402 | ||