linux-stable/drivers/staging/zram
Robert Jennings 939b3f0b14 zram/xvmalloc: combine duplicate block delete code
This patch eliminates duplicate code.  The remove_block_head function
is a special case of remove_block which can be contained in remove_block
without confusion.

The portion of code in remove_block_head which was noted as "DEBUG ONLY"
is now mandatory.  Doing this provides consistent management of the double
linked list of blocks under a freelist and makes this consolidation
of delete block code safe.  The first and last blocks will have NULL
pointers in their previous and next page pointers respectively.

Additionally, any time a block is removed from a free list the next and
previous pointers will be set to NULL to avoid misuse outside xvmalloc.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:29:12 -08:00
..
Kconfig zram/xvmalloc: create CONFIG_ZRAM_DEBUG for debug code 2011-02-04 13:29:11 -08:00
Makefile Staging: zram: Makefile: replace the use of <module>-objs with <module>-y 2010-10-08 07:23:41 -07:00
xvmalloc.c zram/xvmalloc: combine duplicate block delete code 2011-02-04 13:29:12 -08:00
xvmalloc.h
xvmalloc_int.h zram/xvmalloc: Close 32byte hole on 64bit CPUs 2011-02-04 13:29:11 -08:00
zram.txt Staging: zram: Update zram documentation 2010-08-31 15:36:36 -07:00
zram_drv.c zram: Return zero'd pages on new reads 2011-02-04 13:29:12 -08:00
zram_drv.h zram: Prevent overflow in logical block size 2011-02-04 13:29:11 -08:00
zram_sysfs.c Staging: zram: round up the disk size provided by user 2011-01-20 16:06:18 -08:00