aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r--fs/dlm/user.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index ebce994ab0b7..8b6e73c47435 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved. 2 * Copyright (C) 2006-2010 Red Hat, Inc. All rights reserved.
3 * 3 *
4 * This copyrighted material is made available to anyone wishing to use, 4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions 5 * modify, copy, or redistribute it subject to the terms and conditions
@@ -17,6 +17,7 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/dlm.h> 18#include <linux/dlm.h>
19#include <linux/dlm_device.h> 19#include <linux/dlm_device.h>
20#include <linux/slab.h>
20 21
21#include "dlm_internal.h" 22#include "dlm_internal.h"
22#include "lockspace.h" 23#include "lockspace.h"
@@ -173,7 +174,7 @@ static int lkb_is_endoflife(struct dlm_lkb *lkb, int sb_status, int type)
173/* we could possibly check if the cancel of an orphan has resulted in the lkb 174/* we could possibly check if the cancel of an orphan has resulted in the lkb
174 being removed and then remove that lkb from the orphans list and free it */ 175 being removed and then remove that lkb from the orphans list and free it */
175 176
176void dlm_user_add_ast(struct dlm_lkb *lkb, int type, int bastmode) 177void dlm_user_add_ast(struct dlm_lkb *lkb, int type, int mode)
177{ 178{
178 struct dlm_ls *ls; 179 struct dlm_ls *ls;
179 struct dlm_user_args *ua; 180 struct dlm_user_args *ua;
@@ -206,8 +207,10 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type, int bastmode)
206 207
207 ast_type = lkb->lkb_ast_type; 208 ast_type = lkb->lkb_ast_type;
208 lkb->lkb_ast_type |= type; 209 lkb->lkb_ast_type |= type;
209 if (bastmode) 210 if (type == AST_BAST)
210 lkb->lkb_bastmode = bastmode; 211 lkb->lkb_bastmode = mode;
212 else
213 lkb->lkb_castmode = mode;
211 214
212 if (!ast_type) { 215 if (!ast_type) {
213 kref_get(&lkb->lkb_ref); 216 kref_get(&lkb->lkb_ref);
@@ -267,7 +270,7 @@ static int device_user_lock(struct dlm_user_proc *proc,
267 goto out; 270 goto out;
268 } 271 }
269 272
270 ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 273 ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
271 if (!ua) 274 if (!ua)
272 goto out; 275 goto out;
273 ua->proc = proc; 276 ua->proc = proc;
@@ -307,7 +310,7 @@ static int device_user_unlock(struct dlm_user_proc *proc,
307 if (!ls) 310 if (!ls)
308 return -ENOENT; 311 return -ENOENT;
309 312
310 ua = kzalloc(sizeof(struct dlm_user_args), GFP_KERNEL); 313 ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
311 if (!ua) 314 if (!ua)
312 goto out; 315 goto out;
313 ua->proc = proc; 316 ua->proc = proc;
@@ -352,7 +355,7 @@ static int dlm_device_register(struct dlm_ls *ls, char *name)
352 355
353 error = -ENOMEM; 356 error = -ENOMEM;
354 len = strlen(name) + strlen(name_prefix) + 2; 357 len = strlen(name) + strlen(name_prefix) + 2;
355 ls->ls_device.name = kzalloc(len, GFP_KERNEL); 358 ls->ls_device.name = kzalloc(len, GFP_NOFS);
356 if (!ls->ls_device.name) 359 if (!ls->ls_device.name)
357 goto fail; 360 goto fail;
358 361
@@ -520,7 +523,7 @@ static ssize_t device_write(struct file *file, const char __user *buf,
520#endif 523#endif
521 return -EINVAL; 524 return -EINVAL;
522 525
523 kbuf = kzalloc(count + 1, GFP_KERNEL); 526 kbuf = kzalloc(count + 1, GFP_NOFS);
524 if (!kbuf) 527 if (!kbuf)
525 return -ENOMEM; 528 return -ENOMEM;
526 529
@@ -546,7 +549,7 @@ static ssize_t device_write(struct file *file, const char __user *buf,
546 549
547 /* add 1 after namelen so that the name string is terminated */ 550 /* add 1 after namelen so that the name string is terminated */
548 kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1, 551 kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1,
549 GFP_KERNEL); 552 GFP_NOFS);
550 if (!kbuf) { 553 if (!kbuf) {
551 kfree(k32buf); 554 kfree(k32buf);
552 return -ENOMEM; 555 return -ENOMEM;
@@ -648,7 +651,7 @@ static int device_open(struct inode *inode, struct file *file)
648 if (!ls) 651 if (!ls)
649 return -ENOENT; 652 return -ENOENT;
650 653
651 proc = kzalloc(sizeof(struct dlm_user_proc), GFP_KERNEL); 654 proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS);
652 if (!proc) { 655 if (!proc) {
653 dlm_put_lockspace(ls); 656 dlm_put_lockspace(ls);
654 return -ENOMEM; 657 return -ENOMEM;