aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/file.c')
-rw-r--r--fs/jffs2/file.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index e92187f34d5f..e18c9437d58f 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,
220 D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", 220 D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n",
221 inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); 221 inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags));
222 222
223 if (!start && end == PAGE_CACHE_SIZE) { 223 if (end == PAGE_CACHE_SIZE) {
224 /* We need to avoid deadlock with page_cache_read() in 224 if (!start) {
225 jffs2_garbage_collect_pass(). So we have to mark the 225 /* We need to avoid deadlock with page_cache_read() in
226 page up to date, to prevent page_cache_read() from 226 jffs2_garbage_collect_pass(). So we have to mark the
227 trying to re-lock it. */ 227 page up to date, to prevent page_cache_read() from
228 SetPageUptodate(pg); 228 trying to re-lock it. */
229 SetPageUptodate(pg);
230 } else {
231 /* When writing out the end of a page, write out the
232 _whole_ page. This helps to reduce the number of
233 nodes in files which have many short writes, like
234 syslog files. */
235 start = aligned_start = 0;
236 }
229 } 237 }
230 238
231 ri = jffs2_alloc_raw_inode(); 239 ri = jffs2_alloc_raw_inode();