Commit 548ac1de authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] tmpfs 5/6: use cond_resched

From: Hugh Dickins <hugh@veritas.com>

cond_resched each time around the loop in shmem_file_write
and do_shmem_file_read, matching filemap.c.
parent 5d86cc8b
......@@ -1211,6 +1211,8 @@ shmem_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
buf += bytes;
if (pos > inode->i_size)
inode->i_size = pos;
cond_resched();
} while (count);
*ppos = pos;
......@@ -1302,6 +1304,8 @@ static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_
page_cache_release(page);
if (ret != nr || !desc->count)
break;
cond_resched();
}
*ppos = ((loff_t) index << PAGE_CACHE_SHIFT) + offset;
......
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