Commit f69c2d56 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reiserfs v3 should throttle writers

From: Chris Mason <mason@suse.com>

The v3 reiserfs_file_write func doesn't do any write throttling, which
leads to a variety of problems.  Here's a patch that makes
reiserfs_file_write call balance_dirty_pages_ratelimited, and exports that
func for module usage.
parent e94aaae6
......@@ -8,6 +8,7 @@
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <linux/pagemap.h>
#include <linux/writeback.h>
/*
** We pack the tails of files on file close, not at the time they are written.
......@@ -1176,6 +1177,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
buf += write_bytes;
*ppos = pos += write_bytes;
count -= write_bytes;
balance_dirty_pages_ratelimited(inode->i_mapping);
}
if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
......
......@@ -233,6 +233,7 @@ void balance_dirty_pages_ratelimited(struct address_space *mapping)
}
put_cpu_var(ratelimits);
}
EXPORT_SYMBOL(balance_dirty_pages_ratelimited);
/*
* writeback at least _min_pages, and keep writing until the amount of dirty
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment