[PATCH] tmpfs 5/6 use cond_resched

Hugh Dickins (hugh@veritas.com)
Tue, 1 Apr 2003 23:35:14 +0100 (BST)


cond_resched each time around the loop in shmem_file_write
and do_shmem_file_read, matching filemap.c.

--- tmpfs4/mm/shmem.c Tue Apr 1 21:35:21 2003
+++ tmpfs5/mm/shmem.c Tue Apr 1 21:35:32 2003
@@ -1211,6 +1211,8 @@
buf += bytes;
if (pos > inode->i_size)
inode->i_size = pos;
+
+ cond_resched();
} while (count);

*ppos = pos;
@@ -1302,6 +1304,8 @@
page_cache_release(page);
if (ret != nr || !desc->count)
break;
+
+ cond_resched();
}

*ppos = ((loff_t) index << PAGE_CACHE_SHIFT) + offset;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/