diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-12-14 03:17:03 -0800 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2002-12-14 03:17:03 -0800 |
| commit | 3e9afe4cdf0329a82b288d03d420537d7942c9d8 (patch) | |
| tree | 90a9ea10fd67703effee5d5883cd13770259c70b /include/linux/kernelcapi.h | |
| parent | 660282aafde37ffb4472856abcdd805c9fd64d73 (diff) | |
[PATCH] Remove fail_writepage, redux
fail_writepage() does not work. Its activate_page() call cannot
activate the page because it is not on the LRU.
So perform that function (more efficiently) in the VM. Remove
fail_writepage() and, if the filesystem does not implement
->writepage() then activate the page from shrink_list().
A special case is tmpfs, which does have a writepage, but which
sometimes wants to activate the pages anyway. The most important case
is when there is no swap online and we don't want to keep all those
pages on the inactive list. So just as a tmpfs special-case, allow
writepage() to return WRITEPAGE_ACTIVATE, and handle that in the VM.
Also, the whole idea of allowing ->writepage() to return -EAGAIN, and
handling that in the caller has been reverted. If a writepage()
implementation wants to back out and not write the page, it must
redirty the page, unlock it and return zero. (This is Hugh's preferred
way).
And remove the now-unneeded shmem_writepages() - shmem inodes are
marked as `memory backed' so it will not be called.
And remove the test for non-null ->writepage() in generic_file_mmap().
Memory-backed files _are_ mmappable, and they do not have a
writepage(). It just isn't called.
So the locking rules for writepage() are unchanged. They are:
- Called with the page locked
- Returns with the page unlocked
- Must redirty the page itself if it wasn't all written.
But there is a new, special, hidden, undocumented, secret hack for
tmpfs: writepage may return WRITEPAGE_ACTIVATE to tell the VM to move
the page to the active list. The page must be kept locked in this one
case.
Diffstat (limited to 'include/linux/kernelcapi.h')
0 files changed, 0 insertions, 0 deletions
