diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-19 00:43:53 +0900 |
---|---|---|
committer | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-19 00:43:53 +0900 |
commit | 20a92fc74c5c91c7bc5693d51acc2b99aceb0465 (patch) | |
tree | 41bf535f38ff1a29c560bcf622e9b4ef03c2c106 /fs/jffs2/file.c | |
parent | 21b9879bf2817aca343cdda11ade6a87f5373e74 (diff) | |
parent | f6a673b3f4f93c1c50e1b18f29254b0531b722a8 (diff) | |
download | linux-3.10-20a92fc74c5c91c7bc5693d51acc2b99aceb0465.tar.gz linux-3.10-20a92fc74c5c91c7bc5693d51acc2b99aceb0465.tar.bz2 linux-3.10-20a92fc74c5c91c7bc5693d51acc2b99aceb0465.zip |
Merge git://git.infradead.org/mtd-2.6
Diffstat (limited to 'fs/jffs2/file.c')
-rw-r--r-- | fs/jffs2/file.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index e92187f34d5..e18c9437d58 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -220,12 +220,20 @@ static int jffs2_commit_write (struct file *filp, struct page *pg, D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); - if (!start && end == PAGE_CACHE_SIZE) { - /* We need to avoid deadlock with page_cache_read() in - jffs2_garbage_collect_pass(). So we have to mark the - page up to date, to prevent page_cache_read() from - trying to re-lock it. */ - SetPageUptodate(pg); + if (end == PAGE_CACHE_SIZE) { + if (!start) { + /* We need to avoid deadlock with page_cache_read() in + jffs2_garbage_collect_pass(). So we have to mark the + page up to date, to prevent page_cache_read() from + trying to re-lock it. */ + SetPageUptodate(pg); + } else { + /* When writing out the end of a page, write out the + _whole_ page. This helps to reduce the number of + nodes in files which have many short writes, like + syslog files. */ + start = aligned_start = 0; + } } ri = jffs2_alloc_raw_inode(); |