Commit 97903a26 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

staging: lustre: llite: drop uses of OBD free functions

Replace OBD_FREE and OBD_FREE_PTR by kfree.

The semantic patch that makes these changes is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression ptr, size;
@@

- OBD_FREE(ptr, size);
+ kfree(ptr);

@@
expression ptr;
@@

- OBD_FREE_PTR(ptr);
+ kfree(ptr);
// </smpl>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3746e6f9
...@@ -52,7 +52,7 @@ static void free_dentry_data(struct rcu_head *head) ...@@ -52,7 +52,7 @@ static void free_dentry_data(struct rcu_head *head)
struct ll_dentry_data *lld; struct ll_dentry_data *lld;
lld = container_of(head, struct ll_dentry_data, lld_rcu_head); lld = container_of(head, struct ll_dentry_data, lld_rcu_head);
OBD_FREE_PTR(lld); kfree(lld);
} }
/* should NOT be called with the dcache lock, see fs/dcache.c */ /* should NOT be called with the dcache lock, see fs/dcache.c */
...@@ -67,7 +67,7 @@ static void ll_release(struct dentry *de) ...@@ -67,7 +67,7 @@ static void ll_release(struct dentry *de)
if (lld->lld_it) { if (lld->lld_it) {
ll_intent_release(lld->lld_it); ll_intent_release(lld->lld_it);
OBD_FREE(lld->lld_it, sizeof(*lld->lld_it)); kfree(lld->lld_it);
} }
de->d_fsdata = NULL; de->d_fsdata = NULL;
...@@ -194,7 +194,7 @@ int ll_d_init(struct dentry *de) ...@@ -194,7 +194,7 @@ int ll_d_init(struct dentry *de)
de->d_fsdata = lld; de->d_fsdata = lld;
__d_lustre_invalidate(de); __d_lustre_invalidate(de);
} else { } else {
OBD_FREE_PTR(lld); kfree(lld);
} }
spin_unlock(&de->d_lock); spin_unlock(&de->d_lock);
} else { } else {
......
...@@ -239,7 +239,7 @@ static int ll_dir_filler(void *_hash, struct page *page0) ...@@ -239,7 +239,7 @@ static int ll_dir_filler(void *_hash, struct page *page0)
ll_pagevec_lru_add_file(&lru_pvec); ll_pagevec_lru_add_file(&lru_pvec);
if (page_pool != &page0) if (page_pool != &page0)
OBD_FREE(page_pool, sizeof(struct page *) * max_pages); kfree(page_pool);
return rc; return rc;
} }
...@@ -650,7 +650,7 @@ static int ll_send_mgc_param(struct obd_export *mgc, char *string) ...@@ -650,7 +650,7 @@ static int ll_send_mgc_param(struct obd_export *mgc, char *string)
sizeof(struct mgs_send_param), msp, NULL); sizeof(struct mgs_send_param), msp, NULL);
if (rc) if (rc)
CERROR("Failed to set parameter: %d\n", rc); CERROR("Failed to set parameter: %d\n", rc);
OBD_FREE_PTR(msp); kfree(msp);
return rc; return rc;
} }
...@@ -787,7 +787,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump, ...@@ -787,7 +787,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
end: end:
if (param != NULL) if (param != NULL)
OBD_FREE(param, MGS_PARAM_MAXLEN); kfree(param);
} }
return rc; return rc;
} }
...@@ -1072,7 +1072,7 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp, ...@@ -1072,7 +1072,7 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp,
rc = obd_iocontrol(cmd, exp, size, copy, NULL); rc = obd_iocontrol(cmd, exp, size, copy, NULL);
out: out:
OBD_FREE(copy, size); kfree(copy);
return rc; return rc;
} }
...@@ -1163,7 +1163,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1163,7 +1163,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
oqctl->qc_cmd = Q_QUOTAOFF; oqctl->qc_cmd = Q_QUOTAOFF;
obd_quotactl(sbi->ll_md_exp, oqctl); obd_quotactl(sbi->ll_md_exp, oqctl);
} }
OBD_FREE_PTR(oqctl); kfree(oqctl);
return rc; return rc;
} }
/* If QIF_SPACE is not set, client should collect the /* If QIF_SPACE is not set, client should collect the
...@@ -1206,11 +1206,11 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) ...@@ -1206,11 +1206,11 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
oqctl->qc_dqblk.dqb_valid &= ~QIF_SPACE; oqctl->qc_dqblk.dqb_valid &= ~QIF_SPACE;
} }
OBD_FREE_PTR(oqctl_tmp); kfree(oqctl_tmp);
} }
out: out:
QCTL_COPY(qctl, oqctl); QCTL_COPY(qctl, oqctl);
OBD_FREE_PTR(oqctl); kfree(oqctl);
} }
return rc; return rc;
...@@ -1437,7 +1437,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1437,7 +1437,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} }
free_lmv: free_lmv:
if (tmp) if (tmp)
OBD_FREE(tmp, lum_size); kfree(tmp);
return rc; return rc;
} }
case LL_IOC_REMOVE_ENTRY: { case LL_IOC_REMOVE_ENTRY: {
...@@ -1657,7 +1657,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1657,7 +1657,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (rc < 0) if (rc < 0)
CDEBUG(D_INFO, "obd_quotacheck failed: rc %d\n", rc); CDEBUG(D_INFO, "obd_quotacheck failed: rc %d\n", rc);
OBD_FREE_PTR(oqctl); kfree(oqctl);
return error ?: rc; return error ?: rc;
} }
case OBD_IOC_POLL_QUOTACHECK: { case OBD_IOC_POLL_QUOTACHECK: {
...@@ -1691,7 +1691,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1691,7 +1691,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out_poll; goto out_poll;
} }
out_poll: out_poll:
OBD_FREE_PTR(check); kfree(check);
return rc; return rc;
} }
case LL_IOC_QUOTACTL: { case LL_IOC_QUOTACTL: {
...@@ -1712,7 +1712,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1712,7 +1712,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
out_quotactl: out_quotactl:
OBD_FREE_PTR(qctl); kfree(qctl);
return rc; return rc;
} }
case OBD_IOC_GETDTNAME: case OBD_IOC_GETDTNAME:
...@@ -1781,13 +1781,13 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1781,13 +1781,13 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* We don't know the true size yet; copy the fixed-size part */ /* We don't know the true size yet; copy the fixed-size part */
if (copy_from_user(hur, (void *)arg, sizeof(*hur))) { if (copy_from_user(hur, (void *)arg, sizeof(*hur))) {
OBD_FREE_PTR(hur); kfree(hur);
return -EFAULT; return -EFAULT;
} }
/* Compute the whole struct size */ /* Compute the whole struct size */
totalsize = hur_len(hur); totalsize = hur_len(hur);
OBD_FREE_PTR(hur); kfree(hur);
if (totalsize < 0) if (totalsize < 0)
return -E2BIG; return -E2BIG;
...@@ -1865,7 +1865,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1865,7 +1865,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (!copy) if (!copy)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) { if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy); kfree(copy);
return -EFAULT; return -EFAULT;
} }
...@@ -1873,7 +1873,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1873,7 +1873,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (copy_to_user((char *)arg, copy, sizeof(*copy))) if (copy_to_user((char *)arg, copy, sizeof(*copy)))
rc = -EFAULT; rc = -EFAULT;
OBD_FREE_PTR(copy); kfree(copy);
return rc; return rc;
} }
case LL_IOC_HSM_COPY_END: { case LL_IOC_HSM_COPY_END: {
...@@ -1884,7 +1884,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1884,7 +1884,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (!copy) if (!copy)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(copy, (char *)arg, sizeof(*copy))) { if (copy_from_user(copy, (char *)arg, sizeof(*copy))) {
OBD_FREE_PTR(copy); kfree(copy);
return -EFAULT; return -EFAULT;
} }
...@@ -1892,7 +1892,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1892,7 +1892,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (copy_to_user((char *)arg, copy, sizeof(*copy))) if (copy_to_user((char *)arg, copy, sizeof(*copy)))
rc = -EFAULT; rc = -EFAULT;
OBD_FREE_PTR(copy); kfree(copy);
return rc; return rc;
} }
default: default:
......
...@@ -213,7 +213,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, ...@@ -213,7 +213,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp,
md_clear_open_replay_data(md_exp, och); md_clear_open_replay_data(md_exp, och);
/* Free @och if it is not waiting for DONE_WRITING. */ /* Free @och if it is not waiting for DONE_WRITING. */
och->och_fh.cookie = DEAD_HANDLE_MAGIC; och->och_fh.cookie = DEAD_HANDLE_MAGIC;
OBD_FREE_PTR(och); kfree(och);
} }
if (req) /* This is close request */ if (req) /* This is close request */
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
...@@ -693,7 +693,7 @@ int ll_file_open(struct inode *inode, struct file *file) ...@@ -693,7 +693,7 @@ int ll_file_open(struct inode *inode, struct file *file)
out_och_free: out_och_free:
if (rc) { if (rc) {
if (och_p && *och_p) { if (och_p && *och_p) {
OBD_FREE(*och_p, sizeof(struct obd_client_handle)); kfree(*och_p);
*och_p = NULL; /* OBD_FREE writes some magic there */ *och_p = NULL; /* OBD_FREE writes some magic there */
(*och_usecount)--; (*och_usecount)--;
} }
...@@ -875,7 +875,7 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode, ...@@ -875,7 +875,7 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode,
out_release_it: out_release_it:
ll_intent_release(&it); ll_intent_release(&it);
out: out:
OBD_FREE_PTR(och); kfree(och);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
...@@ -1779,7 +1779,7 @@ int ll_fid2path(struct inode *inode, void __user *arg) ...@@ -1779,7 +1779,7 @@ int ll_fid2path(struct inode *inode, void __user *arg)
rc = -EFAULT; rc = -EFAULT;
gf_free: gf_free:
OBD_FREE(gfout, outsize); kfree(gfout);
return rc; return rc;
} }
...@@ -1883,7 +1883,7 @@ int ll_data_version(struct inode *inode, __u64 *data_version, ...@@ -1883,7 +1883,7 @@ int ll_data_version(struct inode *inode, __u64 *data_version,
*data_version = obdo->o_data_version; *data_version = obdo->o_data_version;
} }
OBD_FREE_PTR(obdo); kfree(obdo);
out: out:
ccc_inode_lsm_put(inode, lsm); ccc_inode_lsm_put(inode, lsm);
return rc; return rc;
...@@ -2110,7 +2110,7 @@ static int ll_swap_layouts(struct file *file1, struct file *file2, ...@@ -2110,7 +2110,7 @@ static int ll_swap_layouts(struct file *file1, struct file *file2,
free: free:
if (llss != NULL) if (llss != NULL)
OBD_FREE_PTR(llss); kfree(llss);
return rc; return rc;
} }
...@@ -2195,10 +2195,10 @@ static int ll_hsm_import(struct inode *inode, struct file *file, ...@@ -2195,10 +2195,10 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
out: out:
if (hss != NULL) if (hss != NULL)
OBD_FREE_PTR(hss); kfree(hss);
if (attr != NULL) if (attr != NULL)
OBD_FREE_PTR(attr); kfree(attr);
return rc; return rc;
} }
...@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, hus); LUSTRE_OPC_ANY, hus);
if (IS_ERR(op_data)) { if (IS_ERR(op_data)) {
OBD_FREE_PTR(hus); kfree(hus);
return PTR_ERR(op_data); return PTR_ERR(op_data);
} }
...@@ -2361,7 +2361,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2361,7 +2361,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
OBD_FREE_PTR(hus); kfree(hus);
return rc; return rc;
} }
case LL_IOC_HSM_STATE_SET: { case LL_IOC_HSM_STATE_SET: {
...@@ -2373,13 +2373,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2373,13 +2373,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(hss, (char *)arg, sizeof(*hss))) { if (copy_from_user(hss, (char *)arg, sizeof(*hss))) {
OBD_FREE_PTR(hss); kfree(hss);
return -EFAULT; return -EFAULT;
} }
rc = ll_hsm_state_set(inode, hss); rc = ll_hsm_state_set(inode, hss);
OBD_FREE_PTR(hss); kfree(hss);
return rc; return rc;
} }
case LL_IOC_HSM_ACTION: { case LL_IOC_HSM_ACTION: {
...@@ -2394,7 +2394,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2394,7 +2394,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0, op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,
LUSTRE_OPC_ANY, hca); LUSTRE_OPC_ANY, hca);
if (IS_ERR(op_data)) { if (IS_ERR(op_data)) {
OBD_FREE_PTR(hca); kfree(hca);
return PTR_ERR(op_data); return PTR_ERR(op_data);
} }
...@@ -2405,7 +2405,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2405,7 +2405,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
OBD_FREE_PTR(hca); kfree(hca);
return rc; return rc;
} }
case LL_IOC_SET_LEASE: { case LL_IOC_SET_LEASE: {
...@@ -2500,13 +2500,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2500,13 +2500,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(hui, (void *)arg, sizeof(*hui))) { if (copy_from_user(hui, (void *)arg, sizeof(*hui))) {
OBD_FREE_PTR(hui); kfree(hui);
return -EFAULT; return -EFAULT;
} }
rc = ll_hsm_import(inode, file, hui); rc = ll_hsm_import(inode, file, hui);
OBD_FREE_PTR(hui); kfree(hui);
return rc; return rc;
} }
default: { default: {
...@@ -3251,7 +3251,7 @@ void ll_iocontrol_unregister(void *magic) ...@@ -3251,7 +3251,7 @@ void ll_iocontrol_unregister(void *magic)
list_del(&tmp->iocd_list); list_del(&tmp->iocd_list);
up_write(&llioc.ioc_sem); up_write(&llioc.ioc_sem);
OBD_FREE(tmp, size); kfree(tmp);
return; return;
} }
} }
...@@ -3619,6 +3619,6 @@ int ll_layout_restore(struct inode *inode) ...@@ -3619,6 +3619,6 @@ int ll_layout_restore(struct inode *inode)
hur->hur_request.hr_itemcount = 1; hur->hur_request.hr_itemcount = 1;
rc = obd_iocontrol(LL_IOC_HSM_REQUEST, cl_i2sbi(inode)->ll_md_exp, rc = obd_iocontrol(LL_IOC_HSM_REQUEST, cl_i2sbi(inode)->ll_md_exp,
len, hur, NULL); len, hur, NULL);
OBD_FREE(hur, len); kfree(hur);
return rc; return rc;
} }
...@@ -305,7 +305,7 @@ static void ll_done_writing(struct inode *inode) ...@@ -305,7 +305,7 @@ static void ll_done_writing(struct inode *inode)
ll_finish_md_op_data(op_data); ll_finish_md_op_data(op_data);
if (och) { if (och) {
md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och); md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och);
OBD_FREE_PTR(och); kfree(och);
} }
} }
...@@ -374,7 +374,7 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret) ...@@ -374,7 +374,7 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret)
task = kthread_run(ll_close_thread, lcq, "ll_close"); task = kthread_run(ll_close_thread, lcq, "ll_close");
if (IS_ERR(task)) { if (IS_ERR(task)) {
OBD_FREE(lcq, sizeof(*lcq)); kfree(lcq);
return PTR_ERR(task); return PTR_ERR(task);
} }
...@@ -389,5 +389,5 @@ void ll_close_thread_shutdown(struct ll_close_queue *lcq) ...@@ -389,5 +389,5 @@ void ll_close_thread_shutdown(struct ll_close_queue *lcq)
atomic_inc(&lcq->lcq_stop); atomic_inc(&lcq->lcq_stop);
wake_up(&lcq->lcq_waitq); wake_up(&lcq->lcq_waitq);
wait_for_completion(&lcq->lcq_comp); wait_for_completion(&lcq->lcq_comp);
OBD_FREE(lcq, sizeof(*lcq)); kfree(lcq);
} }
...@@ -145,7 +145,7 @@ static void ll_free_sbi(struct super_block *sb) ...@@ -145,7 +145,7 @@ static void ll_free_sbi(struct super_block *sb)
spin_lock(&ll_sb_lock); spin_lock(&ll_sb_lock);
list_del(&sbi->ll_list); list_del(&sbi->ll_list);
spin_unlock(&ll_sb_lock); spin_unlock(&ll_sb_lock);
OBD_FREE(sbi, sizeof(*sbi)); kfree(sbi);
} }
} }
...@@ -177,7 +177,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -177,7 +177,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
osfs = kzalloc(sizeof(*osfs), GFP_NOFS); osfs = kzalloc(sizeof(*osfs), GFP_NOFS);
if (!osfs) { if (!osfs) {
OBD_FREE_PTR(data); kfree(data);
return -ENOMEM; return -ENOMEM;
} }
...@@ -288,7 +288,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -288,7 +288,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
valid ^ CLIENT_CONNECT_MDT_REQD, ","); valid ^ CLIENT_CONNECT_MDT_REQD, ",");
LCONSOLE_ERROR_MSG(0x170, "Server %s does not support feature(s) needed for correct operation of this client (%s). Please upgrade server or downgrade client.\n", LCONSOLE_ERROR_MSG(0x170, "Server %s does not support feature(s) needed for correct operation of this client (%s). Please upgrade server or downgrade client.\n",
sbi->ll_md_exp->exp_obd->obd_name, buf); sbi->ll_md_exp->exp_obd->obd_name, buf);
OBD_FREE(buf, PAGE_CACHE_SIZE); kfree(buf);
err = -EPROTO; err = -EPROTO;
goto out_md_fid; goto out_md_fid;
} }
...@@ -493,7 +493,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -493,7 +493,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
err = md_getattr(sbi->ll_md_exp, op_data, &request); err = md_getattr(sbi->ll_md_exp, op_data, &request);
if (oc) if (oc)
capa_put(oc); capa_put(oc);
OBD_FREE_PTR(op_data); kfree(op_data);
if (err) { if (err) {
CERROR("%s: md_getattr failed for root: rc = %d\n", CERROR("%s: md_getattr failed for root: rc = %d\n",
sbi->ll_md_exp->exp_obd->obd_name, err); sbi->ll_md_exp->exp_obd->obd_name, err);
...@@ -575,9 +575,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -575,9 +575,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
} }
if (data != NULL) if (data != NULL)
OBD_FREE_PTR(data); kfree(data);
if (osfs != NULL) if (osfs != NULL)
OBD_FREE_PTR(osfs); kfree(osfs);
return err; return err;
out_root: out_root:
...@@ -596,9 +596,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, ...@@ -596,9 +596,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
sbi->ll_md_exp = NULL; sbi->ll_md_exp = NULL;
out: out:
if (data != NULL) if (data != NULL)
OBD_FREE_PTR(data); kfree(data);
if (osfs != NULL) if (osfs != NULL)
OBD_FREE_PTR(osfs); kfree(osfs);
lprocfs_unregister_mountpoint(sbi); lprocfs_unregister_mountpoint(sbi);
return err; return err;
} }
...@@ -924,7 +924,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) ...@@ -924,7 +924,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
lsi->lsi_llsbi = sbi = ll_init_sbi(); lsi->lsi_llsbi = sbi = ll_init_sbi();
if (!sbi) { if (!sbi) {
module_put(THIS_MODULE); module_put(THIS_MODULE);
OBD_FREE_PTR(cfg); kfree(cfg);
return -ENOMEM; return -ENOMEM;
} }
...@@ -986,15 +986,15 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) ...@@ -986,15 +986,15 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
out_free: out_free:
if (md) if (md)
OBD_FREE(md, strlen(lprof->lp_md) + instlen + 2); kfree(md);
if (dt) if (dt)
OBD_FREE(dt, strlen(lprof->lp_dt) + instlen + 2); kfree(dt);
if (err) if (err)
ll_put_super(sb); ll_put_super(sb);
else if (sbi->ll_flags & LL_SBI_VERBOSE) else if (sbi->ll_flags & LL_SBI_VERBOSE)
LCONSOLE_WARN("Mounted %s\n", profilenm); LCONSOLE_WARN("Mounted %s\n", profilenm);
OBD_FREE_PTR(cfg); kfree(cfg);
return err; return err;
} /* ll_fill_super */ } /* ll_fill_super */
...@@ -1118,8 +1118,7 @@ void ll_clear_inode(struct inode *inode) ...@@ -1118,8 +1118,7 @@ void ll_clear_inode(struct inode *inode)
ll_md_real_close(inode, FMODE_READ); ll_md_real_close(inode, FMODE_READ);
if (S_ISLNK(inode->i_mode) && lli->lli_symlink_name) { if (S_ISLNK(inode->i_mode) && lli->lli_symlink_name) {
OBD_FREE(lli->lli_symlink_name, kfree(lli->lli_symlink_name);
strlen(lli->lli_symlink_name) + 1);
lli->lli_symlink_name = NULL; lli->lli_symlink_name = NULL;
} }
...@@ -1949,7 +1948,7 @@ void ll_umount_begin(struct super_block *sb) ...@@ -1949,7 +1948,7 @@ void ll_umount_begin(struct super_block *sb)
obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_dt_exp, obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_dt_exp,
sizeof(*ioc_data), ioc_data, NULL); sizeof(*ioc_data), ioc_data, NULL);
OBD_FREE_PTR(ioc_data); kfree(ioc_data);
} }
/* Really, we'd like to wait until there are no requests outstanding, /* Really, we'd like to wait until there are no requests outstanding,
...@@ -2228,7 +2227,7 @@ void ll_finish_md_op_data(struct md_op_data *op_data) ...@@ -2228,7 +2227,7 @@ void ll_finish_md_op_data(struct md_op_data *op_data)
{ {
capa_put(op_data->op_capa1); capa_put(op_data->op_capa1);
capa_put(op_data->op_capa2); capa_put(op_data->op_capa2);
OBD_FREE_PTR(op_data); kfree(op_data);
} }
int ll_show_options(struct seq_file *seq, struct dentry *dentry) int ll_show_options(struct seq_file *seq, struct dentry *dentry)
......
...@@ -116,7 +116,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb, ...@@ -116,7 +116,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb,
/* mds_fid2dentry ignores f_type */ /* mds_fid2dentry ignores f_type */
rc = md_getattr(sbi->ll_md_exp, op_data, &req); rc = md_getattr(sbi->ll_md_exp, op_data, &req);
OBD_FREE_PTR(op_data); kfree(op_data);
if (rc) { if (rc) {
CERROR("can't get object attrs, fid "DFID", rc %d\n", CERROR("can't get object attrs, fid "DFID", rc %d\n",
PFID(fid), rc); PFID(fid), rc);
......
...@@ -94,7 +94,7 @@ static void rce_free(struct rmtacl_ctl_entry *rce) ...@@ -94,7 +94,7 @@ static void rce_free(struct rmtacl_ctl_entry *rce)
if (!list_empty(&rce->rce_list)) if (!list_empty(&rce->rce_list))
list_del(&rce->rce_list); list_del(&rce->rce_list);
OBD_FREE_PTR(rce); kfree(rce);
} }
static struct rmtacl_ctl_entry *__rct_search(struct rmtacl_ctl_table *rct, static struct rmtacl_ctl_entry *__rct_search(struct rmtacl_ctl_table *rct,
...@@ -205,7 +205,7 @@ void ee_free(struct eacl_entry *ee) ...@@ -205,7 +205,7 @@ void ee_free(struct eacl_entry *ee)
if (ee->ee_acl) if (ee->ee_acl)
lustre_ext_acl_xattr_free(ee->ee_acl); lustre_ext_acl_xattr_free(ee->ee_acl);
OBD_FREE_PTR(ee); kfree(ee);
} }
static struct eacl_entry *__et_search_del(struct eacl_table *et, pid_t key, static struct eacl_entry *__et_search_del(struct eacl_table *et, pid_t key,
......
...@@ -840,9 +840,9 @@ static int __init lloop_init(void) ...@@ -840,9 +840,9 @@ static int __init lloop_init(void)
out_mem3: out_mem3:
while (i--) while (i--)
put_disk(disks[i]); put_disk(disks[i]);
OBD_FREE(disks, max_loop * sizeof(*disks)); kfree(disks);
out_mem2: out_mem2:
OBD_FREE(loop_dev, max_loop * sizeof(*loop_dev)); kfree(loop_dev);
out_mem1: out_mem1:
unregister_blkdev(lloop_major, "lloop"); unregister_blkdev(lloop_major, "lloop");
ll_iocontrol_unregister(ll_iocontrol_magic); ll_iocontrol_unregister(ll_iocontrol_magic);
...@@ -863,8 +863,8 @@ static void lloop_exit(void) ...@@ -863,8 +863,8 @@ static void lloop_exit(void)
unregister_blkdev(lloop_major, "lloop"); unregister_blkdev(lloop_major, "lloop");
OBD_FREE(disks, max_loop * sizeof(*disks)); kfree(disks);
OBD_FREE(loop_dev, max_loop * sizeof(*loop_dev)); kfree(loop_dev);
} }
module_init(lloop_init); module_init(lloop_init);
......
...@@ -665,7 +665,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, ...@@ -665,7 +665,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
out_release: out_release:
ll_intent_release(it); ll_intent_release(it);
OBD_FREE(it, sizeof(*it)); kfree(it);
return rc; return rc;
} }
......
...@@ -312,7 +312,7 @@ static void ll_sa_entry_cleanup(struct ll_statahead_info *sai, ...@@ -312,7 +312,7 @@ static void ll_sa_entry_cleanup(struct ll_statahead_info *sai,
entry->se_minfo = NULL; entry->se_minfo = NULL;
ll_intent_release(&minfo->mi_it); ll_intent_release(&minfo->mi_it);
iput(minfo->mi_dir); iput(minfo->mi_dir);
OBD_FREE_PTR(minfo); kfree(minfo);
} }
if (req) { if (req) {
...@@ -336,7 +336,7 @@ static void ll_sa_entry_put(struct ll_statahead_info *sai, ...@@ -336,7 +336,7 @@ static void ll_sa_entry_put(struct ll_statahead_info *sai,
ll_sa_entry_cleanup(sai, entry); ll_sa_entry_cleanup(sai, entry);
iput(entry->se_inode); iput(entry->se_inode);
OBD_FREE(entry, entry->se_size); kfree(entry);
atomic_dec(&sai->sai_cache_count); atomic_dec(&sai->sai_cache_count);
} }
} }
...@@ -544,7 +544,7 @@ static void ll_sai_put(struct ll_statahead_info *sai) ...@@ -544,7 +544,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
LASSERT(agl_list_empty(sai)); LASSERT(agl_list_empty(sai));
iput(inode); iput(inode);
OBD_FREE_PTR(sai); kfree(sai);
} }
} }
...@@ -772,7 +772,7 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, ...@@ -772,7 +772,7 @@ static int ll_statahead_interpret(struct ptlrpc_request *req,
if (rc != 0) { if (rc != 0) {
ll_intent_release(it); ll_intent_release(it);
iput(dir); iput(dir);
OBD_FREE_PTR(minfo); kfree(minfo);
} }
if (sai != NULL) if (sai != NULL)
ll_sai_put(sai); ll_sai_put(sai);
...@@ -786,8 +786,8 @@ static void sa_args_fini(struct md_enqueue_info *minfo, ...@@ -786,8 +786,8 @@ static void sa_args_fini(struct md_enqueue_info *minfo,
iput(minfo->mi_dir); iput(minfo->mi_dir);
capa_put(minfo->mi_data.op_capa1); capa_put(minfo->mi_data.op_capa1);
capa_put(minfo->mi_data.op_capa2); capa_put(minfo->mi_data.op_capa2);
OBD_FREE_PTR(minfo); kfree(minfo);
OBD_FREE_PTR(einfo); kfree(einfo);
} }
/** /**
...@@ -816,15 +816,15 @@ static int sa_args_init(struct inode *dir, struct inode *child, ...@@ -816,15 +816,15 @@ static int sa_args_init(struct inode *dir, struct inode *child,
minfo = kzalloc(sizeof(*minfo), GFP_NOFS); minfo = kzalloc(sizeof(*minfo), GFP_NOFS);
if (!minfo) { if (!minfo) {
OBD_FREE_PTR(einfo); kfree(einfo);
return -ENOMEM; return -ENOMEM;
} }
op_data = ll_prep_md_op_data(&minfo->mi_data, dir, child, qstr->name, op_data = ll_prep_md_op_data(&minfo->mi_data, dir, child, qstr->name,
qstr->len, 0, LUSTRE_OPC_ANY, NULL); qstr->len, 0, LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data)) { if (IS_ERR(op_data)) {
OBD_FREE_PTR(einfo); kfree(einfo);
OBD_FREE_PTR(minfo); kfree(minfo);
return PTR_ERR(op_data); return PTR_ERR(op_data);
} }
...@@ -1720,7 +1720,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp, ...@@ -1720,7 +1720,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
out: out:
if (sai != NULL) if (sai != NULL)
OBD_FREE_PTR(sai); kfree(sai);
spin_lock(&lli->lli_sa_lock); spin_lock(&lli->lli_sa_lock);
lli->lli_opendir_key = NULL; lli->lli_opendir_key = NULL;
lli->lli_opendir_pid = 0; lli->lli_opendir_pid = 0;
......
...@@ -144,7 +144,7 @@ static int ll_xattr_cache_add(struct list_head *cache, ...@@ -144,7 +144,7 @@ static int ll_xattr_cache_add(struct list_head *cache,
return 0; return 0;
err_value: err_value:
OBD_FREE(xattr->xe_name, xattr->xe_namelen); kfree(xattr->xe_name);
err_name: err_name:
OBD_SLAB_FREE_PTR(xattr, xattr_kmem); OBD_SLAB_FREE_PTR(xattr, xattr_kmem);
...@@ -170,8 +170,8 @@ static int ll_xattr_cache_del(struct list_head *cache, ...@@ -170,8 +170,8 @@ static int ll_xattr_cache_del(struct list_head *cache,
if (ll_xattr_cache_find(cache, xattr_name, &xattr) == 0) { if (ll_xattr_cache_find(cache, xattr_name, &xattr) == 0) {
list_del(&xattr->xe_list); list_del(&xattr->xe_list);
OBD_FREE(xattr->xe_name, xattr->xe_namelen); kfree(xattr->xe_name);
OBD_FREE(xattr->xe_value, xattr->xe_vallen); kfree(xattr->xe_value);
OBD_SLAB_FREE_PTR(xattr, xattr_kmem); OBD_SLAB_FREE_PTR(xattr, xattr_kmem);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment