summaryrefslogtreecommitdiffstats
path: root/drivers/staging/zram/xvmalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: zram: remove xvmallocNitin Gupta2012-02-081-510/+0
| | | | | | | | Removes the xvmalloc allocator code from the zram driver Signed-off-by: Nitin Gupta <ngupta@vflare.org> Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: Allow sharing xvmalloc for zram and zcacheNitin Gupta2011-02-231-0/+8
| | | | | | | | | | | | | | | Both zram and zcache use xvmalloc allocator. If xvmalloc is compiled separately for both of them, we will get linker error if they are both selected as "built-in". We can also get linker error regarding missing xvmalloc symbols if zram is not built. So, we now compile xvmalloc separately and export its symbols which are then used by both of zram and zcache. Signed-off-by: Nitin Gupta <ngupta@vflare.org> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* zram/xvmalloc: combine duplicate block delete codeRobert Jennings2011-02-041-42/+31
| | | | | | | | | | | | | | | | | | | | 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>
* zram/xvmalloc: create CONFIG_ZRAM_DEBUG for debug codeRobert Jennings2011-02-041-0/+4
| | | | | | | | | Add a debug config flag to enable debug printk output and future debug code. Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* zram/xvmalloc: free bit block insertion optimizationRobert Jennings2011-02-041-0/+2
| | | | | | | | | | | | | | | | | | | This change is in a conditional block which is entered only when there is an existing data block on the freelist where the insert has taken place. The new block is pushed onto the freelist stack and this conditional block is updating links in the prior stack head to point to the new stack head. After this conditional block the first-/second-level indices are updated to indicate that there is a free block at this location. This patch adds an immediate return from the conditional block to avoid setting bits again to indicate a free block on this freelist. The bits would already be set because there was an existing free block on this freelist. Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging:zram:xvmalloc.c Fix a typo.Justin P. Mattock2011-01-201-1/+1
| | | | | | | | | | Not exactly sure if this is a typo or not, due to my search results comming up with not that many hits. Either its dereferenceable or dereferencable from the two I choose the later. if it's wrong let me know and I'll resend. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/zram: Fix sparse warning 'Using plain integer as NULL pointer'Peter Huewe2010-12-081-3/+3
| | | | | | | | This patch fixes the warning generated by sparse: "Using plain integer as NULL pointer" by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: Rename ramzswap files to zramNitin Gupta2010-06-181-0/+507
Related changes: - Modify revelant Kconfig and Makefile accordingly. - Change include filenames in code. - Remove dependency on CONFIG_SWAP in Kconfig as zram usage is no longer limited to swap disks. Signed-off-by: Nitin Gupta <ngupta@vflare.org> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud