]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
dlm: fix up memory allocation flags
authorSteven Whitehouse <swhiteho@redhat.com>
Wed, 12 Nov 2008 22:49:48 +0000 (16:49 -0600)
committerDavid Teigland <teigland@redhat.com>
Tue, 23 Dec 2008 16:15:40 +0000 (10:15 -0600)
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 <ccaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c
fs/dlm/memory.c
fs/dlm/midcomms.c

index 3962262f991a32a415db104fd191679834c537a9..1e720316300bd817a2f19102dce126426e4b226a 100644 (file)
@@ -295,6 +295,7 @@ static int add_sock(struct socket *sock, struct connection *con)
        con->sock->sk->sk_write_space = lowcomms_write_space;
        con->sock->sk->sk_state_change = lowcomms_state_change;
        con->sock->sk->sk_user_data = con;
+       con->sock->sk->sk_allocation = GFP_NOFS;
        return 0;
 }
 
index 54c14c6d06cb992e7e4cee5c3b4f73348fd257d3..c1775b84ebab2e552e4a4a04e5c8491f1fe99e3a 100644 (file)
@@ -39,7 +39,7 @@ char *dlm_allocate_lvb(struct dlm_ls *ls)
 {
        char *p;
 
-       p = kzalloc(ls->ls_lvblen, GFP_KERNEL);
+       p = kzalloc(ls->ls_lvblen, ls->ls_allocation);
        return p;
 }
 
@@ -57,7 +57,7 @@ struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls, int namelen)
 
        DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,);
 
-       r = kzalloc(sizeof(*r) + namelen, GFP_KERNEL);
+       r = kzalloc(sizeof(*r) + namelen, ls->ls_allocation);
        return r;
 }
 
@@ -72,7 +72,7 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls)
 {
        struct dlm_lkb *lkb;
 
-       lkb = kmem_cache_zalloc(lkb_cache, GFP_KERNEL);
+       lkb = kmem_cache_zalloc(lkb_cache, ls->ls_allocation);
        return lkb;
 }
 
index 07ac709f3ed7145853b67fd5b36618e759092ba5..f3396c622aecc04ef371ccf9cb3baed23b110c55 100644 (file)
@@ -112,7 +112,7 @@ int dlm_process_incoming_buffer(int nodeid, const void *base,
                   ordinary messages). */
 
                if (msglen > sizeof(__tmp) && p == &__tmp.p) {
-                       p = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL);
+                       p = kmalloc(dlm_config.ci_buffer_size, GFP_NOFS);
                        if (p == NULL)
                                return ret;
                }