summaryrefslogtreecommitdiff
path: root/fs/dlm
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/config.c20
-rw-r--r--fs/dlm/dir.c2
-rw-r--r--fs/dlm/lock.c4
-rw-r--r--fs/dlm/lockspace.c2
-rw-r--r--fs/dlm/lowcomms.c6
-rw-r--r--fs/dlm/member.c10
-rw-r--r--fs/dlm/midcomms.c2
-rw-r--r--fs/dlm/plock.c10
-rw-r--r--fs/dlm/user.c6
9 files changed, 31 insertions, 31 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 82cc3215663f..0f80fda98227 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -426,9 +426,9 @@ static struct config_group *make_cluster(struct config_group *g,
struct dlm_spaces *sps = NULL;
struct dlm_comms *cms = NULL;
- cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS);
- sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS);
- cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS);
+ cl = kzalloc_obj(struct dlm_cluster, GFP_NOFS);
+ sps = kzalloc_obj(struct dlm_spaces, GFP_NOFS);
+ cms = kzalloc_obj(struct dlm_comms, GFP_NOFS);
if (!cl || !sps || !cms)
goto fail;
@@ -480,8 +480,8 @@ static struct config_group *make_space(struct config_group *g, const char *name)
struct dlm_space *sp = NULL;
struct dlm_nodes *nds = NULL;
- sp = kzalloc(sizeof(struct dlm_space), GFP_NOFS);
- nds = kzalloc(sizeof(struct dlm_nodes), GFP_NOFS);
+ sp = kzalloc_obj(struct dlm_space, GFP_NOFS);
+ nds = kzalloc_obj(struct dlm_nodes, GFP_NOFS);
if (!sp || !nds)
goto fail;
@@ -531,7 +531,7 @@ static struct config_item *make_comm(struct config_group *g, const char *name)
if (rv)
return ERR_PTR(rv);
- cm = kzalloc(sizeof(struct dlm_comm), GFP_NOFS);
+ cm = kzalloc_obj(struct dlm_comm, GFP_NOFS);
if (!cm)
return ERR_PTR(-ENOMEM);
@@ -577,7 +577,7 @@ static struct config_item *make_node(struct config_group *g, const char *name)
if (rv)
return ERR_PTR(rv);
- nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS);
+ nd = kzalloc_obj(struct dlm_node, GFP_NOFS);
if (!nd)
return ERR_PTR(-ENOMEM);
@@ -602,7 +602,7 @@ static void drop_node(struct config_group *g, struct config_item *i)
struct dlm_node *nd = config_item_to_node(i);
struct dlm_member_gone *mb_gone;
- mb_gone = kzalloc(sizeof(*mb_gone), GFP_KERNEL);
+ mb_gone = kzalloc_obj(*mb_gone, GFP_KERNEL);
if (!mb_gone)
return;
@@ -701,7 +701,7 @@ static ssize_t comm_addr_store(struct config_item *item, const char *buf,
if (cm->addr_count >= DLM_MAX_ADDR_COUNT)
return -ENOSPC;
- addr = kzalloc(sizeof(*addr), GFP_NOFS);
+ addr = kzalloc_obj(*addr, GFP_NOFS);
if (!addr)
return -ENOMEM;
@@ -946,7 +946,7 @@ int dlm_config_nodes(char *lsname, struct dlm_config_node **nodes_out,
count = sp->members_count + sp->members_gone_count;
- nodes = kcalloc(count, sizeof(struct dlm_config_node), GFP_NOFS);
+ nodes = kzalloc_objs(struct dlm_config_node, count, GFP_NOFS);
if (!nodes) {
rv = -ENOMEM;
goto out;
diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
index 01c292379f5b..aa08e8f446a1 100644
--- a/fs/dlm/dir.c
+++ b/fs/dlm/dir.c
@@ -276,7 +276,7 @@ static struct dlm_dir_dump *init_dir_dump(struct dlm_ls *ls, int nodeid)
drop_dir_ctx(ls, nodeid);
}
- dd = kzalloc(sizeof(*dd), GFP_ATOMIC);
+ dd = kzalloc_obj(*dd, GFP_ATOMIC);
if (!dd)
return NULL;
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 47a09d6748cb..3b6e6a29eab8 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -5050,7 +5050,7 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls)
int wait_type, local_unlock_result, local_cancel_result;
int dir_nodeid;
- ms_local = kmalloc(sizeof(*ms_local), GFP_KERNEL);
+ ms_local = kmalloc_obj(*ms_local, GFP_KERNEL);
if (!ms_local)
return;
@@ -6288,7 +6288,7 @@ int dlm_debug_add_lkb(struct dlm_ls *ls, uint32_t lkb_id, char *name, int len,
if (lkb_dflags & BIT(DLM_DFL_USER_BIT))
return -EOPNOTSUPP;
- lksb = kzalloc(sizeof(*lksb), GFP_NOFS);
+ lksb = kzalloc_obj(*lksb, GFP_NOFS);
if (!lksb)
return -ENOMEM;
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index ddaa76558706..a9c98b4f378f 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -427,7 +427,7 @@ static int new_lockspace(const char *name, const char *cluster,
error = -ENOMEM;
- ls = kzalloc(sizeof(*ls), GFP_NOFS);
+ ls = kzalloc_obj(*ls, GFP_NOFS);
if (!ls)
goto out;
memcpy(ls->ls_name, name, namelen);
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index b3958008ba3f..5b6142787919 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -305,7 +305,7 @@ static struct connection *nodeid2con(int nodeid, gfp_t alloc)
if (con || !alloc)
return con;
- con = kzalloc(sizeof(*con), alloc);
+ con = kzalloc_obj(*con, alloc);
if (!con)
return NULL;
@@ -838,7 +838,7 @@ static struct processqueue_entry *new_processqueue_entry(int nodeid,
{
struct processqueue_entry *pentry;
- pentry = kmalloc(sizeof(*pentry), GFP_NOFS);
+ pentry = kmalloc_obj(*pentry, GFP_NOFS);
if (!pentry)
return NULL;
@@ -1052,7 +1052,7 @@ static int accept_from_sock(void)
struct connection *othercon = newcon->othercon;
if (!othercon) {
- othercon = kzalloc(sizeof(*othercon), GFP_NOFS);
+ othercon = kzalloc_obj(*othercon, GFP_NOFS);
if (!othercon) {
log_print("failed to allocate incoming socket");
up_write(&newcon->sock_lock);
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index c1b5598997b7..812d889f1ce5 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -211,7 +211,7 @@ int dlm_slots_assign(struct dlm_ls *ls, int *num_slots, int *slots_size,
}
array_size = max + need;
- array = kcalloc(array_size, sizeof(*array), GFP_NOFS);
+ array = kzalloc_objs(*array, array_size, GFP_NOFS);
if (!array)
return -ENOMEM;
@@ -323,7 +323,7 @@ static int dlm_add_member(struct dlm_ls *ls, struct dlm_config_node *node)
struct dlm_member *memb;
int error;
- memb = kzalloc(sizeof(*memb), GFP_NOFS);
+ memb = kzalloc_obj(*memb, GFP_NOFS);
if (!memb)
return -ENOMEM;
@@ -423,7 +423,7 @@ static void make_member_array(struct dlm_ls *ls)
}
ls->ls_total_weight = total;
- array = kmalloc_array(total, sizeof(*array), GFP_NOFS);
+ array = kmalloc_objs(*array, total, GFP_NOFS);
if (!array)
return;
@@ -511,7 +511,7 @@ void dlm_lsop_recover_done(struct dlm_ls *ls)
return;
num = ls->ls_num_nodes;
- slots = kcalloc(num, sizeof(*slots), GFP_KERNEL);
+ slots = kzalloc_objs(*slots, num, GFP_KERNEL);
if (!slots)
return;
@@ -726,7 +726,7 @@ int dlm_ls_start(struct dlm_ls *ls)
struct dlm_config_node *nodes = NULL;
int error, count;
- rv = kzalloc(sizeof(*rv), GFP_NOFS);
+ rv = kzalloc_obj(*rv, GFP_NOFS);
if (!rv)
return -ENOMEM;
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index 2c101bbe261a..d54bdd8fc4f2 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -351,7 +351,7 @@ int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr)
}
srcu_read_unlock(&nodes_srcu, idx);
- node = kmalloc(sizeof(*node), GFP_NOFS);
+ node = kmalloc_obj(*node, GFP_NOFS);
if (!node)
return -ENOMEM;
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 9ca83ef70ed1..e9598b3fe5d0 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -102,7 +102,7 @@ static int do_lock_cancel(const struct dlm_plock_info *orig_info)
struct plock_op *op;
int rv;
- op = kzalloc(sizeof(*op), GFP_NOFS);
+ op = kzalloc_obj(*op, GFP_NOFS);
if (!op)
return -ENOMEM;
@@ -131,7 +131,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
if (!ls)
return -EINVAL;
- op = kzalloc(sizeof(*op), GFP_NOFS);
+ op = kzalloc_obj(*op, GFP_NOFS);
if (!op) {
rv = -ENOMEM;
goto out;
@@ -148,7 +148,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
op->info.owner = (__u64)(long) fl->c.flc_owner;
/* async handling */
if (fl->fl_lmops && fl->fl_lmops->lm_grant) {
- op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
+ op_data = kzalloc_obj(*op_data, GFP_NOFS);
if (!op_data) {
dlm_release_plock_op(op);
rv = -ENOMEM;
@@ -297,7 +297,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
if (!ls)
return -EINVAL;
- op = kzalloc(sizeof(*op), GFP_NOFS);
+ op = kzalloc_obj(*op, GFP_NOFS);
if (!op) {
rv = -ENOMEM;
goto out;
@@ -430,7 +430,7 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
if (!ls)
return -EINVAL;
- op = kzalloc(sizeof(*op), GFP_NOFS);
+ op = kzalloc_obj(*op, GFP_NOFS);
if (!op) {
rv = -ENOMEM;
goto out;
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 51daf4acbe31..a8ed4c8fdc5b 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -262,7 +262,7 @@ static int device_user_lock(struct dlm_user_proc *proc,
goto out;
}
- ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
+ ua = kzalloc_obj(struct dlm_user_args, GFP_NOFS);
if (!ua)
goto out;
ua->proc = proc;
@@ -307,7 +307,7 @@ static int device_user_unlock(struct dlm_user_proc *proc,
if (!ls)
return -ENOENT;
- ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
+ ua = kzalloc_obj(struct dlm_user_args, GFP_NOFS);
if (!ua)
goto out;
ua->proc = proc;
@@ -645,7 +645,7 @@ static int device_open(struct inode *inode, struct file *file)
if (!ls)
return -ENOENT;
- proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS);
+ proc = kzalloc_obj(struct dlm_user_proc, GFP_NOFS);
if (!proc) {
dlm_put_lockspace(ls);
return -ENOMEM;