Skip to content

Commit 936dae4

Browse files
Dan Carpentertorvalds
authored andcommitted
coda: get rid of CODA_FREE()
The CODA_FREE() macro just calls kvfree(). We can call that directly instead. Link: http://lkml.kernel.org/r/4950a94fd30ec5f84835dd4ca0bb67c0448672f5.1558117389.git.jaharkes@cs.cmu.edu Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Colin Ian King <colin.king@canonical.com> Cc: David Howells <dhowells@redhat.com> Cc: Fabian Frederick <fabf@skynet.be> Cc: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Sam Protsenko <semen.protsenko@linaro.org> Cc: Yann Droneaud <ydroneaud@opteya.com> Cc: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4dc4819 commit 936dae4

3 files changed

Lines changed: 22 additions & 24 deletions

File tree

‎fs/coda/coda_linux.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ unsigned short coda_flags_to_cflags(unsigned short);
6363
void coda_sysctl_init(void);
6464
void coda_sysctl_clean(void);
6565

66-
#define CODA_FREE(ptr, size) kvfree((ptr))
67-
6866
/* inode to cnode access functions */
6967

7068
static inline struct coda_inode_info *ITOC(struct inode *inode)

‎fs/coda/psdev.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
129129
goto out;
130130
}
131131
if (copy_from_user(dcbuf, buf, nbytes)) {
132-
CODA_FREE(dcbuf, nbytes);
132+
kvfree(dcbuf);
133133
retval = -EFAULT;
134134
goto out;
135135
}
136136

137137
/* what downcall errors does Venus handle ? */
138138
error = coda_downcall(vcp, hdr.opcode, dcbuf, nbytes);
139139

140-
CODA_FREE(dcbuf, nbytes);
140+
kvfree(dcbuf);
141141
if (error) {
142142
pr_warn("%s: coda_downcall error: %d\n",
143143
__func__, error);
@@ -263,7 +263,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,
263263
goto out;
264264
}
265265

266-
CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
266+
kvfree(req->uc_data);
267267
kfree(req);
268268
out:
269269
mutex_unlock(&vcp->vc_mutex);
@@ -325,7 +325,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
325325

326326
/* Async requests need to be freed here */
327327
if (req->uc_flags & CODA_REQ_ASYNC) {
328-
CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
328+
kvfree(req->uc_data);
329329
kfree(req);
330330
continue;
331331
}

‎fs/coda/upcall.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp)
8585
if (!error)
8686
*fidp = outp->coda_root.VFid;
8787

88-
CODA_FREE(inp, insize);
88+
kvfree(inp);
8989
return error;
9090
}
9191

@@ -104,7 +104,7 @@ int venus_getattr(struct super_block *sb, struct CodaFid *fid,
104104
if (!error)
105105
*attr = outp->coda_getattr.attr;
106106

107-
CODA_FREE(inp, insize);
107+
kvfree(inp);
108108
return error;
109109
}
110110

@@ -123,7 +123,7 @@ int venus_setattr(struct super_block *sb, struct CodaFid *fid,
123123

124124
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
125125

126-
CODA_FREE(inp, insize);
126+
kvfree(inp);
127127
return error;
128128
}
129129

@@ -153,7 +153,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid,
153153
*type = outp->coda_lookup.vtype;
154154
}
155155

156-
CODA_FREE(inp, insize);
156+
kvfree(inp);
157157
return error;
158158
}
159159

@@ -173,7 +173,7 @@ int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
173173

174174
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
175175

176-
CODA_FREE(inp, insize);
176+
kvfree(inp);
177177
return error;
178178
}
179179

@@ -194,7 +194,7 @@ int venus_open(struct super_block *sb, struct CodaFid *fid,
194194
if (!error)
195195
*fh = outp->coda_open_by_fd.fh;
196196

197-
CODA_FREE(inp, insize);
197+
kvfree(inp);
198198
return error;
199199
}
200200

@@ -224,7 +224,7 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
224224
*newfid = outp->coda_mkdir.VFid;
225225
}
226226

227-
CODA_FREE(inp, insize);
227+
kvfree(inp);
228228
return error;
229229
}
230230

@@ -262,7 +262,7 @@ int venus_rename(struct super_block *sb, struct CodaFid *old_fid,
262262

263263
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
264264

265-
CODA_FREE(inp, insize);
265+
kvfree(inp);
266266
return error;
267267
}
268268

@@ -295,7 +295,7 @@ int venus_create(struct super_block *sb, struct CodaFid *dirfid,
295295
*newfid = outp->coda_create.VFid;
296296
}
297297

298-
CODA_FREE(inp, insize);
298+
kvfree(inp);
299299
return error;
300300
}
301301

@@ -318,7 +318,7 @@ int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
318318

319319
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
320320

321-
CODA_FREE(inp, insize);
321+
kvfree(inp);
322322
return error;
323323
}
324324

@@ -340,7 +340,7 @@ int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
340340

341341
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
342342

343-
CODA_FREE(inp, insize);
343+
kvfree(inp);
344344
return error;
345345
}
346346

@@ -370,7 +370,7 @@ int venus_readlink(struct super_block *sb, struct CodaFid *fid,
370370
*(buffer + retlen) = '\0';
371371
}
372372

373-
CODA_FREE(inp, insize);
373+
kvfree(inp);
374374
return error;
375375
}
376376

@@ -398,7 +398,7 @@ int venus_link(struct super_block *sb, struct CodaFid *fid,
398398

399399
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
400400

401-
CODA_FREE(inp, insize);
401+
kvfree(inp);
402402
return error;
403403
}
404404

@@ -433,7 +433,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
433433

434434
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
435435

436-
CODA_FREE(inp, insize);
436+
kvfree(inp);
437437
return error;
438438
}
439439

@@ -449,7 +449,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
449449
inp->coda_fsync.VFid = *fid;
450450
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
451451

452-
CODA_FREE(inp, insize);
452+
kvfree(inp);
453453
return error;
454454
}
455455

@@ -467,7 +467,7 @@ int venus_access(struct super_block *sb, struct CodaFid *fid, int mask)
467467

468468
error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
469469

470-
CODA_FREE(inp, insize);
470+
kvfree(inp);
471471
return error;
472472
}
473473

@@ -543,7 +543,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
543543
}
544544

545545
exit:
546-
CODA_FREE(inp, insize);
546+
kvfree(inp);
547547
return error;
548548
}
549549

@@ -565,7 +565,7 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs)
565565
sfs->f_ffree = outp->coda_statfs.stat.f_ffree;
566566
}
567567

568-
CODA_FREE(inp, insize);
568+
kvfree(inp);
569569
return error;
570570
}
571571

0 commit comments

Comments
 (0)