aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm/memory.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-15dlm: NULL dereference on failure in kmem_cache_create()Dan Carpenter1-5/+3
We aren't allowed to pass NULL pointers to kmem_cache_destroy() so if both allocations fail, it leads to a NULL dereference. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David Teigland <[email protected]>
2011-07-12dlm: improve rsb searchesDavid Teigland1-8/+14
By pre-allocating rsb structs before searching the hash table, they can be inserted immediately. This avoids always having to repeat the search when adding the struct to hash list. This also adds space to the rsb struct for a max resource name, so an rsb allocation can be used by any request. The constant size also allows us to finally use a slab for the rsb structs. Signed-off-by: David Teigland <[email protected]>
2009-11-30dlm: always use GFP_NOFSDavid Teigland1-3/+3
Replace all GFP_KERNEL and ls_allocation with GFP_NOFS. ls_allocation would be GFP_KERNEL for userland lockspaces and GFP_NOFS for file system lockspaces. It was discovered that any lockspaces on the system can affect all others by triggering memory reclaim in the file system which could in turn call back into the dlm to acquire locks, deadlocking dlm threads that were shared by all lockspaces, like dlm_recv. Signed-off-by: David Teigland <[email protected]>
2008-12-23dlm: fix up memory allocation flagsSteven Whitehouse1-3/+3
Use ls_allocation for memory allocations, which a cluster fs sets to GFP_NOFS. Use GFP_NOFS for allocations when no lockspace struct is available. Taking dlm locks needs to avoid calling back into the cluster fs because write-out can require taking dlm locks. Cc: Christine Caulfield <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]> Signed-off-by: David Teigland <[email protected]>
2008-02-06dlm: add __init and __exit marks to init and exit functionsDenis Cheng1-1/+1
it moves 365 bytes from .text to .init.text, and 30 bytes from .text to .exit.text, saves memory. Signed-off-by: Denis Cheng <[email protected]> Signed-off-by: David Teigland <[email protected]>
2008-02-06dlm: eliminate astparam type castingDavid Teigland1-1/+1
Put lkb_astparam in a union with a dlm_user_args pointer to eliminate a lot of type casting. Signed-off-by: David Teigland <[email protected]>
2008-01-29dlm: use dlm prefix on alloc and free functionsDavid Teigland1-24/+8
The dlm functions in memory.c should use the dlm_ prefix. Also, use kzalloc/kfree directly for dlm_direntry's, removing the wrapper functions. Signed-off-by: David Teigland <[email protected]>
2007-07-20mm: Remove slab destructors from kmem_cache_create().Paul Mundt1-1/+1
Slab destructors were no longer supported after Christoph's c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been BUGs for both slab and slub, and slob never supported them either. This rips out support for the dtor pointer from kmem_cache_create() completely and fixes up every single callsite in the kernel (there were about 224, not including the slab allocator definitions themselves, or the documentation references). Signed-off-by: Paul Mundt <[email protected]>
2007-07-19some kmalloc/memset ->kzalloc (tree wide)Yoann Padioleau1-9/+3
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [[email protected]: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Acked-by: Russell King <[email protected]> Cc: Bryan Wu <[email protected]> Acked-by: Jiri Slaby <[email protected]> Cc: Dave Airlie <[email protected]> Acked-by: Roland Dreier <[email protected]> Cc: Jiri Kosina <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Pierre Ossman <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: "David S. Miller" <[email protected]> Acked-by: Greg KH <[email protected]> Cc: James Bottomley <[email protected]> Cc: "Antonino A. Daplas" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-02-11[PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc().Robert P. J. Day1-3/+1
Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the corresponding "kmem_cache_zalloc()" call. Signed-off-by: Robert P. J. Day <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Roland McGrath <[email protected]> Cc: James Bottomley <[email protected]> Cc: Greg KH <[email protected]> Acked-by: Joel Becker <[email protected]> Cc: Steven Whitehouse <[email protected]> Cc: Jan Kara <[email protected]> Cc: Michael Halcrow <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Stephen Smalley <[email protected]> Cc: James Morris <[email protected]> Cc: Chris Wright <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] slab: remove kmem_cache_tChristoph Lameter1-1/+1
Replace all uses of kmem_cache_t with struct kmem_cache. The patch was generated using the following script: #!/bin/sh # # Replace one string by another in all the kernel sources. # set -e for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do quilt add $file sed -e "1,\$s/$1/$2/g" $file >/tmp/$$ mv /tmp/$$ $file quilt refresh done The script was run like this sh replace kmem_cache_t "struct kmem_cache" Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-08-09[DLM] print bad length in assertionDavid Teigland1-1/+2
Print the violating name length in the assertion. Signed-off-by: David Teigland <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2006-07-13[DLM] dlm: user locksDavid Teigland1-0/+9
This changes the way the dlm handles user locks. The core dlm is now aware of user locks so they can be dealt with more efficiently. There is no more dlm_device module which previously managed its own duplicate copy of every user lock. Signed-off-by: Patrick Caulfield <[email protected]> Signed-off-by: David Teigland <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2006-02-23[DLM] Remove range locks from the DLMDavid Teigland1-16/+0
This patch removes support for range locking from the DLM Signed-off-by: David Teigland <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2006-01-18[DLM] The core of the DLM for GFS2/CLVMDavid Teigland1-0/+122
This is the core of the distributed lock manager which is required to use GFS2 as a cluster filesystem. It is also used by CLVM and can be used as a standalone lock manager independantly of either of these two projects. It implements VAX-style locking modes. Signed-off-by: David Teigland <[email protected]> Signed-off-by: Steve Whitehouse <[email protected]>