]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
tmpfs: convert shmem_truncate_range to radix-swap
authorHugh Dickins <hughd@google.com>
Wed, 3 Aug 2011 23:21:22 +0000 (16:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 4 Aug 2011 00:25:23 +0000 (14:25 -1000)
commit7a5d0fbb29936fad7f17b1cb001b0c33a5f13328
tree903c66ee195451f45c782155a8eb6dd6e7217522
parentbda97eab0cc9c6385b9f26abdda6459f630f4513
tmpfs: convert shmem_truncate_range to radix-swap

Disable the toy swapping implementation in shmem_writepage() - it's hard
to support two schemes at once - and convert shmem_truncate_range() to a
lockless gang lookup of swap entries along with pages, freeing both.

Since the second loop tightens its noose until all entries of either
kind have been squeezed out (and we shall make sure that there's not an
instant when neither is visible), there is no longer a need for yet
another pass below.

shmem_radix_tree_replace() compensates for the lockless lookup by
checking that the expected entry is in place, under lock, before
replacing it.  Here it just deletes, but will be used in later patches
to substitute swap entry for page or page for swap entry.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c