diff options
Diffstat (limited to 'fs/dlm/memory.c')
-rw-r--r-- | fs/dlm/memory.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c index 94af986e83c6..ce35c3c19aeb 100644 --- a/fs/dlm/memory.c +++ b/fs/dlm/memory.c @@ -17,6 +17,7 @@ static struct kmem_cache *writequeue_cache; static struct kmem_cache *mhandle_cache; +static struct kmem_cache *msg_cache; static struct kmem_cache *lkb_cache; static struct kmem_cache *rsb_cache; @@ -36,6 +37,10 @@ int __init dlm_memory_init(void) if (!lkb_cache) goto lkb; + msg_cache = dlm_lowcomms_msg_cache_create(); + if (!msg_cache) + goto msg; + rsb_cache = kmem_cache_create("dlm_rsb", sizeof(struct dlm_rsb), __alignof__(struct dlm_rsb), 0, NULL); if (!rsb_cache) @@ -44,6 +49,8 @@ int __init dlm_memory_init(void) return 0; rsb: + kmem_cache_destroy(msg_cache); +msg: kmem_cache_destroy(lkb_cache); lkb: kmem_cache_destroy(mhandle_cache); @@ -57,6 +64,7 @@ void dlm_memory_exit(void) { kmem_cache_destroy(writequeue_cache); kmem_cache_destroy(mhandle_cache); + kmem_cache_destroy(msg_cache); kmem_cache_destroy(lkb_cache); kmem_cache_destroy(rsb_cache); } @@ -129,3 +137,13 @@ void dlm_free_writequeue(struct writequeue_entry *writequeue) { kmem_cache_free(writequeue_cache, writequeue); } + +struct dlm_msg *dlm_allocate_msg(gfp_t allocation) +{ + return kmem_cache_alloc(msg_cache, allocation); +} + +void dlm_free_msg(struct dlm_msg *msg) +{ + kmem_cache_free(msg_cache, msg); +} |