Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
dlm: always use GFP_NOFS

+46 -53
+12 -12
fs/dlm/config.c
··· 410 410 struct dlm_comms *cms = NULL; 411 411 void *gps = NULL; 412 412 413 - cl = kzalloc(sizeof(struct dlm_cluster), GFP_KERNEL); 414 - gps = kcalloc(3, sizeof(struct config_group *), GFP_KERNEL); 415 - sps = kzalloc(sizeof(struct dlm_spaces), GFP_KERNEL); 416 - cms = kzalloc(sizeof(struct dlm_comms), GFP_KERNEL); 413 + cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS); 414 + gps = kcalloc(3, sizeof(struct config_group *), GFP_NOFS); 415 + sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS); 416 + cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS); 417 417 418 418 if (!cl || !gps || !sps || !cms) 419 419 goto fail; ··· 482 482 struct dlm_nodes *nds = NULL; 483 483 void *gps = NULL; 484 484 485 - sp = kzalloc(sizeof(struct dlm_space), GFP_KERNEL); 486 - gps = kcalloc(2, sizeof(struct config_group *), GFP_KERNEL); 487 - nds = kzalloc(sizeof(struct dlm_nodes), GFP_KERNEL); 485 + sp = kzalloc(sizeof(struct dlm_space), GFP_NOFS); 486 + gps = kcalloc(2, sizeof(struct config_group *), GFP_NOFS); 487 + nds = kzalloc(sizeof(struct dlm_nodes), GFP_NOFS); 488 488 489 489 if (!sp || !gps || !nds) 490 490 goto fail; ··· 536 536 { 537 537 struct dlm_comm *cm; 538 538 539 - cm = kzalloc(sizeof(struct dlm_comm), GFP_KERNEL); 539 + cm = kzalloc(sizeof(struct dlm_comm), GFP_NOFS); 540 540 if (!cm) 541 541 return ERR_PTR(-ENOMEM); 542 542 ··· 569 569 struct dlm_space *sp = config_item_to_space(g->cg_item.ci_parent); 570 570 struct dlm_node *nd; 571 571 572 - nd = kzalloc(sizeof(struct dlm_node), GFP_KERNEL); 572 + nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS); 573 573 if (!nd) 574 574 return ERR_PTR(-ENOMEM); 575 575 ··· 705 705 if (cm->addr_count >= DLM_MAX_ADDR_COUNT) 706 706 return -ENOSPC; 707 707 708 - addr = kzalloc(sizeof(*addr), GFP_KERNEL); 708 + addr = kzalloc(sizeof(*addr), GFP_NOFS); 709 709 if (!addr) 710 710 return -ENOMEM; 711 711 ··· 868 868 869 869 ids_count = sp->members_count; 870 870 871 - ids = kcalloc(ids_count, sizeof(int), GFP_KERNEL); 871 + ids = kcalloc(ids_count, sizeof(int), GFP_NOFS); 872 872 if (!ids) { 873 873 rv = -ENOMEM; 874 874 goto out; ··· 886 886 if (!new_count) 887 887 goto out_ids; 888 888 889 - new = kcalloc(new_count, sizeof(int), GFP_KERNEL); 889 + new = kcalloc(new_count, sizeof(int), GFP_NOFS); 890 890 if (!new) { 891 891 kfree(ids); 892 892 rv = -ENOMEM;
+1 -1
fs/dlm/debug_fs.c
··· 404 404 if (bucket >= ls->ls_rsbtbl_size) 405 405 return NULL; 406 406 407 - ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_KERNEL); 407 + ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_NOFS); 408 408 if (!ri) 409 409 return NULL; 410 410 if (n == 0)
+3 -4
fs/dlm/dir.c
··· 49 49 spin_unlock(&ls->ls_recover_list_lock); 50 50 51 51 if (!found) 52 - de = kzalloc(sizeof(struct dlm_direntry) + len, 53 - ls->ls_allocation); 52 + de = kzalloc(sizeof(struct dlm_direntry) + len, GFP_NOFS); 54 53 return de; 55 54 } 56 55 ··· 211 212 212 213 dlm_dir_clear(ls); 213 214 214 - last_name = kmalloc(DLM_RESNAME_MAXLEN, ls->ls_allocation); 215 + last_name = kmalloc(DLM_RESNAME_MAXLEN, GFP_NOFS); 215 216 if (!last_name) 216 217 goto out; 217 218 ··· 322 323 if (namelen > DLM_RESNAME_MAXLEN) 323 324 return -EINVAL; 324 325 325 - de = kzalloc(sizeof(struct dlm_direntry) + namelen, ls->ls_allocation); 326 + de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_NOFS); 326 327 if (!de) 327 328 return -ENOMEM; 328 329
-1
fs/dlm/dlm_internal.h
··· 473 473 int ls_low_nodeid; 474 474 int ls_total_weight; 475 475 int *ls_node_array; 476 - gfp_t ls_allocation; 477 476 478 477 struct dlm_rsb ls_stub_rsb; /* for returning errors */ 479 478 struct dlm_lkb ls_stub_lkb; /* for returning errors */
+3 -3
fs/dlm/lock.c
··· 2689 2689 pass into lowcomms_commit and a message buffer (mb) that we 2690 2690 write our data into */ 2691 2691 2692 - mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb); 2692 + mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb); 2693 2693 if (!mh) 2694 2694 return -ENOBUFS; 2695 2695 ··· 4512 4512 } 4513 4513 4514 4514 if (flags & DLM_LKF_VALBLK) { 4515 - ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL); 4515 + ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS); 4516 4516 if (!ua->lksb.sb_lvbptr) { 4517 4517 kfree(ua); 4518 4518 __put_lkb(ls, lkb); ··· 4582 4582 ua = lkb->lkb_ua; 4583 4583 4584 4584 if (flags & DLM_LKF_VALBLK && !ua->lksb.sb_lvbptr) { 4585 - ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL); 4585 + ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_NOFS); 4586 4586 if (!ua->lksb.sb_lvbptr) { 4587 4587 error = -ENOMEM; 4588 4588 goto out_put;
+5 -10
fs/dlm/lockspace.c
··· 430 430 431 431 error = -ENOMEM; 432 432 433 - ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL); 433 + ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_NOFS); 434 434 if (!ls) 435 435 goto out; 436 436 memcpy(ls->ls_name, name, namelen); ··· 443 443 if (flags & DLM_LSFL_TIMEWARN) 444 444 set_bit(LSFL_TIMEWARN, &ls->ls_flags); 445 445 446 - if (flags & DLM_LSFL_FS) 447 - ls->ls_allocation = GFP_NOFS; 448 - else 449 - ls->ls_allocation = GFP_KERNEL; 450 - 451 446 /* ls_exflags are forced to match among nodes, and we don't 452 447 need to require all nodes to have some flags set */ 453 448 ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS | ··· 451 456 size = dlm_config.ci_rsbtbl_size; 452 457 ls->ls_rsbtbl_size = size; 453 458 454 - ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_KERNEL); 459 + ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_NOFS); 455 460 if (!ls->ls_rsbtbl) 456 461 goto out_lsfree; 457 462 for (i = 0; i < size; i++) { ··· 463 468 size = dlm_config.ci_lkbtbl_size; 464 469 ls->ls_lkbtbl_size = size; 465 470 466 - ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_KERNEL); 471 + ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_NOFS); 467 472 if (!ls->ls_lkbtbl) 468 473 goto out_rsbfree; 469 474 for (i = 0; i < size; i++) { ··· 475 480 size = dlm_config.ci_dirtbl_size; 476 481 ls->ls_dirtbl_size = size; 477 482 478 - ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_KERNEL); 483 + ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_NOFS); 479 484 if (!ls->ls_dirtbl) 480 485 goto out_lkbfree; 481 486 for (i = 0; i < size; i++) { ··· 522 527 mutex_init(&ls->ls_requestqueue_mutex); 523 528 mutex_init(&ls->ls_clear_proc_locks); 524 529 525 - ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL); 530 + ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_NOFS); 526 531 if (!ls->ls_recover_buf) 527 532 goto out_dirfree; 528 533
+3 -3
fs/dlm/lowcomms.c
··· 1060 1060 if (dlm_our_addr(&sas, i)) 1061 1061 break; 1062 1062 1063 - addr = kmalloc(sizeof(*addr), GFP_KERNEL); 1063 + addr = kmalloc(sizeof(*addr), GFP_NOFS); 1064 1064 if (!addr) 1065 1065 break; 1066 1066 memcpy(addr, &sas, sizeof(*addr)); ··· 1099 1099 struct sockaddr_storage localaddr; 1100 1100 struct sctp_event_subscribe subscribe; 1101 1101 int result = -EINVAL, num = 1, i, addr_len; 1102 - struct connection *con = nodeid2con(0, GFP_KERNEL); 1102 + struct connection *con = nodeid2con(0, GFP_NOFS); 1103 1103 int bufsize = NEEDED_RMEM; 1104 1104 1105 1105 if (!con) ··· 1171 1171 static int tcp_listen_for_all(void) 1172 1172 { 1173 1173 struct socket *sock = NULL; 1174 - struct connection *con = nodeid2con(0, GFP_KERNEL); 1174 + struct connection *con = nodeid2con(0, GFP_NOFS); 1175 1175 int result = -EINVAL; 1176 1176 1177 1177 if (!con)
+4 -4
fs/dlm/member.c
··· 48 48 struct dlm_member *memb; 49 49 int w, error; 50 50 51 - memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); 51 + memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS); 52 52 if (!memb) 53 53 return -ENOMEM; 54 54 ··· 143 143 144 144 ls->ls_total_weight = total; 145 145 146 - array = kmalloc(sizeof(int) * total, ls->ls_allocation); 146 + array = kmalloc(sizeof(int) * total, GFP_NOFS); 147 147 if (!array) 148 148 return; 149 149 ··· 226 226 continue; 227 227 log_debug(ls, "new nodeid %d is a re-added member", rv->new[i]); 228 228 229 - memb = kzalloc(sizeof(struct dlm_member), ls->ls_allocation); 229 + memb = kzalloc(sizeof(struct dlm_member), GFP_NOFS); 230 230 if (!memb) 231 231 return -ENOMEM; 232 232 memb->nodeid = rv->new[i]; ··· 341 341 int *ids = NULL, *new = NULL; 342 342 int error, ids_count = 0, new_count = 0; 343 343 344 - rv = kzalloc(sizeof(struct dlm_recover), ls->ls_allocation); 344 + rv = kzalloc(sizeof(struct dlm_recover), GFP_NOFS); 345 345 if (!rv) 346 346 return -ENOMEM; 347 347
+3 -3
fs/dlm/memory.c
··· 39 39 { 40 40 char *p; 41 41 42 - p = kzalloc(ls->ls_lvblen, ls->ls_allocation); 42 + p = kzalloc(ls->ls_lvblen, GFP_NOFS); 43 43 return p; 44 44 } 45 45 ··· 57 57 58 58 DLM_ASSERT(namelen <= DLM_RESNAME_MAXLEN,); 59 59 60 - r = kzalloc(sizeof(*r) + namelen, ls->ls_allocation); 60 + r = kzalloc(sizeof(*r) + namelen, GFP_NOFS); 61 61 return r; 62 62 } 63 63 ··· 72 72 { 73 73 struct dlm_lkb *lkb; 74 74 75 - lkb = kmem_cache_zalloc(lkb_cache, ls->ls_allocation); 75 + lkb = kmem_cache_zalloc(lkb_cache, GFP_NOFS); 76 76 return lkb; 77 77 } 78 78
+1 -1
fs/dlm/netlink.c
··· 26 26 struct sk_buff *skb; 27 27 void *data; 28 28 29 - skb = genlmsg_new(size, GFP_KERNEL); 29 + skb = genlmsg_new(size, GFP_NOFS); 30 30 if (!skb) 31 31 return -ENOMEM; 32 32
+3 -3
fs/dlm/plock.c
··· 82 82 if (!ls) 83 83 return -EINVAL; 84 84 85 - xop = kzalloc(sizeof(*xop), GFP_KERNEL); 85 + xop = kzalloc(sizeof(*xop), GFP_NOFS); 86 86 if (!xop) { 87 87 rv = -ENOMEM; 88 88 goto out; ··· 211 211 if (!ls) 212 212 return -EINVAL; 213 213 214 - op = kzalloc(sizeof(*op), GFP_KERNEL); 214 + op = kzalloc(sizeof(*op), GFP_NOFS); 215 215 if (!op) { 216 216 rv = -ENOMEM; 217 217 goto out; ··· 266 266 if (!ls) 267 267 return -EINVAL; 268 268 269 - op = kzalloc(sizeof(*op), GFP_KERNEL); 269 + op = kzalloc(sizeof(*op), GFP_NOFS); 270 270 if (!op) { 271 271 rv = -ENOMEM; 272 272 goto out;
+1 -1
fs/dlm/rcom.c
··· 38 38 char *mb; 39 39 int mb_len = sizeof(struct dlm_rcom) + len; 40 40 41 - mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb); 41 + mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb); 42 42 if (!mh) { 43 43 log_print("create_rcom to %d type %d len %d ENOBUFS", 44 44 to_nodeid, type, len);
+1 -1
fs/dlm/requestqueue.c
··· 35 35 struct rq_entry *e; 36 36 int length = ms->m_header.h_length - sizeof(struct dlm_message); 37 37 38 - e = kmalloc(sizeof(struct rq_entry) + length, ls->ls_allocation); 38 + e = kmalloc(sizeof(struct rq_entry) + length, GFP_NOFS); 39 39 if (!e) { 40 40 log_print("dlm_add_requestqueue: out of memory len %d", length); 41 41 return;
+6 -6
fs/dlm/user.c
··· 267 267 goto out; 268 268 } 269 269 270 - ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 270 + ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); 271 271 if (!ua) 272 272 goto out; 273 273 ua->proc = proc; ··· 307 307 if (!ls) 308 308 return -ENOENT; 309 309 310 - ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 310 + ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); 311 311 if (!ua) 312 312 goto out; 313 313 ua->proc = proc; ··· 352 352 353 353 error = -ENOMEM; 354 354 len = strlen(name) + strlen(name_prefix) + 2; 355 - ls->ls_device.name = kzalloc(len, GFP_KERNEL); 355 + ls->ls_device.name = kzalloc(len, GFP_NOFS); 356 356 if (!ls->ls_device.name) 357 357 goto fail; 358 358 ··· 520 520 #endif 521 521 return -EINVAL; 522 522 523 - kbuf = kzalloc(count + 1, GFP_KERNEL); 523 + kbuf = kzalloc(count + 1, GFP_NOFS); 524 524 if (!kbuf) 525 525 return -ENOMEM; 526 526 ··· 546 546 547 547 /* add 1 after namelen so that the name string is terminated */ 548 548 kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1, 549 - GFP_KERNEL); 549 + GFP_NOFS); 550 550 if (!kbuf) { 551 551 kfree(k32buf); 552 552 return -ENOMEM; ··· 648 648 if (!ls) 649 649 return -ENOENT; 650 650 651 - proc = kzalloc(sizeof(struct dlm_user_proc), GFP_KERNEL); 651 + proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS); 652 652 if (!proc) { 653 653 dlm_put_lockspace(ls); 654 654 return -ENOMEM;