diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-07-16 19:28:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 22:23:23 -0400 |
commit | 936dae4525322fb46f6f7bb407c5663c83e5d353 (patch) | |
tree | 42d658c3b29682cb6d08a059ad1d80ba9585bfed | |
parent | 4dc48193d748f0f0fbe37105a905466ff3a6ad50 (diff) |
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>
-rw-r--r-- | fs/coda/coda_linux.h | 2 | ||||
-rw-r--r-- | fs/coda/psdev.c | 8 | ||||
-rw-r--r-- | fs/coda/upcall.c | 36 |
3 files changed, 22 insertions, 24 deletions
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h index 1ea9521e79d7..517a363245c9 100644 --- a/fs/coda/coda_linux.h +++ b/fs/coda/coda_linux.h | |||
@@ -63,8 +63,6 @@ unsigned short coda_flags_to_cflags(unsigned short); | |||
63 | void coda_sysctl_init(void); | 63 | void coda_sysctl_init(void); |
64 | void coda_sysctl_clean(void); | 64 | void coda_sysctl_clean(void); |
65 | 65 | ||
66 | #define CODA_FREE(ptr, size) kvfree((ptr)) | ||
67 | |||
68 | /* inode to cnode access functions */ | 66 | /* inode to cnode access functions */ |
69 | 67 | ||
70 | static inline struct coda_inode_info *ITOC(struct inode *inode) | 68 | static inline struct coda_inode_info *ITOC(struct inode *inode) |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index f74296acc59e..3ac22a2b97e2 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -129,7 +129,7 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
129 | goto out; | 129 | goto out; |
130 | } | 130 | } |
131 | if (copy_from_user(dcbuf, buf, nbytes)) { | 131 | if (copy_from_user(dcbuf, buf, nbytes)) { |
132 | CODA_FREE(dcbuf, nbytes); | 132 | kvfree(dcbuf); |
133 | retval = -EFAULT; | 133 | retval = -EFAULT; |
134 | goto out; | 134 | goto out; |
135 | } | 135 | } |
@@ -137,7 +137,7 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
137 | /* what downcall errors does Venus handle ? */ | 137 | /* what downcall errors does Venus handle ? */ |
138 | error = coda_downcall(vcp, hdr.opcode, dcbuf, nbytes); | 138 | error = coda_downcall(vcp, hdr.opcode, dcbuf, nbytes); |
139 | 139 | ||
140 | CODA_FREE(dcbuf, nbytes); | 140 | kvfree(dcbuf); |
141 | if (error) { | 141 | if (error) { |
142 | pr_warn("%s: coda_downcall error: %d\n", | 142 | pr_warn("%s: coda_downcall error: %d\n", |
143 | __func__, error); | 143 | __func__, error); |
@@ -263,7 +263,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf, | |||
263 | goto out; | 263 | goto out; |
264 | } | 264 | } |
265 | 265 | ||
266 | CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr)); | 266 | kvfree(req->uc_data); |
267 | kfree(req); | 267 | kfree(req); |
268 | out: | 268 | out: |
269 | mutex_unlock(&vcp->vc_mutex); | 269 | mutex_unlock(&vcp->vc_mutex); |
@@ -325,7 +325,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) | |||
325 | 325 | ||
326 | /* Async requests need to be freed here */ | 326 | /* Async requests need to be freed here */ |
327 | if (req->uc_flags & CODA_REQ_ASYNC) { | 327 | if (req->uc_flags & CODA_REQ_ASYNC) { |
328 | CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr)); | 328 | kvfree(req->uc_data); |
329 | kfree(req); | 329 | kfree(req); |
330 | continue; | 330 | continue; |
331 | } | 331 | } |
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c index b6ac5fc98189..1e2f50722107 100644 --- a/fs/coda/upcall.c +++ b/fs/coda/upcall.c | |||
@@ -85,7 +85,7 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp) | |||
85 | if (!error) | 85 | if (!error) |
86 | *fidp = outp->coda_root.VFid; | 86 | *fidp = outp->coda_root.VFid; |
87 | 87 | ||
88 | CODA_FREE(inp, insize); | 88 | kvfree(inp); |
89 | return error; | 89 | return error; |
90 | } | 90 | } |
91 | 91 | ||
@@ -104,7 +104,7 @@ int venus_getattr(struct super_block *sb, struct CodaFid *fid, | |||
104 | if (!error) | 104 | if (!error) |
105 | *attr = outp->coda_getattr.attr; | 105 | *attr = outp->coda_getattr.attr; |
106 | 106 | ||
107 | CODA_FREE(inp, insize); | 107 | kvfree(inp); |
108 | return error; | 108 | return error; |
109 | } | 109 | } |
110 | 110 | ||
@@ -123,7 +123,7 @@ int venus_setattr(struct super_block *sb, struct CodaFid *fid, | |||
123 | 123 | ||
124 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 124 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
125 | 125 | ||
126 | CODA_FREE(inp, insize); | 126 | kvfree(inp); |
127 | return error; | 127 | return error; |
128 | } | 128 | } |
129 | 129 | ||
@@ -153,7 +153,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, | |||
153 | *type = outp->coda_lookup.vtype; | 153 | *type = outp->coda_lookup.vtype; |
154 | } | 154 | } |
155 | 155 | ||
156 | CODA_FREE(inp, insize); | 156 | kvfree(inp); |
157 | return error; | 157 | return error; |
158 | } | 158 | } |
159 | 159 | ||
@@ -173,7 +173,7 @@ int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | |||
173 | 173 | ||
174 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 174 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
175 | 175 | ||
176 | CODA_FREE(inp, insize); | 176 | kvfree(inp); |
177 | return error; | 177 | return error; |
178 | } | 178 | } |
179 | 179 | ||
@@ -194,7 +194,7 @@ int venus_open(struct super_block *sb, struct CodaFid *fid, | |||
194 | if (!error) | 194 | if (!error) |
195 | *fh = outp->coda_open_by_fd.fh; | 195 | *fh = outp->coda_open_by_fd.fh; |
196 | 196 | ||
197 | CODA_FREE(inp, insize); | 197 | kvfree(inp); |
198 | return error; | 198 | return error; |
199 | } | 199 | } |
200 | 200 | ||
@@ -224,7 +224,7 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, | |||
224 | *newfid = outp->coda_mkdir.VFid; | 224 | *newfid = outp->coda_mkdir.VFid; |
225 | } | 225 | } |
226 | 226 | ||
227 | CODA_FREE(inp, insize); | 227 | kvfree(inp); |
228 | return error; | 228 | return error; |
229 | } | 229 | } |
230 | 230 | ||
@@ -262,7 +262,7 @@ int venus_rename(struct super_block *sb, struct CodaFid *old_fid, | |||
262 | 262 | ||
263 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 263 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
264 | 264 | ||
265 | CODA_FREE(inp, insize); | 265 | kvfree(inp); |
266 | return error; | 266 | return error; |
267 | } | 267 | } |
268 | 268 | ||
@@ -295,7 +295,7 @@ int venus_create(struct super_block *sb, struct CodaFid *dirfid, | |||
295 | *newfid = outp->coda_create.VFid; | 295 | *newfid = outp->coda_create.VFid; |
296 | } | 296 | } |
297 | 297 | ||
298 | CODA_FREE(inp, insize); | 298 | kvfree(inp); |
299 | return error; | 299 | return error; |
300 | } | 300 | } |
301 | 301 | ||
@@ -318,7 +318,7 @@ int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid, | |||
318 | 318 | ||
319 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 319 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
320 | 320 | ||
321 | CODA_FREE(inp, insize); | 321 | kvfree(inp); |
322 | return error; | 322 | return error; |
323 | } | 323 | } |
324 | 324 | ||
@@ -340,7 +340,7 @@ int venus_remove(struct super_block *sb, struct CodaFid *dirfid, | |||
340 | 340 | ||
341 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 341 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
342 | 342 | ||
343 | CODA_FREE(inp, insize); | 343 | kvfree(inp); |
344 | return error; | 344 | return error; |
345 | } | 345 | } |
346 | 346 | ||
@@ -370,7 +370,7 @@ int venus_readlink(struct super_block *sb, struct CodaFid *fid, | |||
370 | *(buffer + retlen) = '\0'; | 370 | *(buffer + retlen) = '\0'; |
371 | } | 371 | } |
372 | 372 | ||
373 | CODA_FREE(inp, insize); | 373 | kvfree(inp); |
374 | return error; | 374 | return error; |
375 | } | 375 | } |
376 | 376 | ||
@@ -398,7 +398,7 @@ int venus_link(struct super_block *sb, struct CodaFid *fid, | |||
398 | 398 | ||
399 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 399 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
400 | 400 | ||
401 | CODA_FREE(inp, insize); | 401 | kvfree(inp); |
402 | return error; | 402 | return error; |
403 | } | 403 | } |
404 | 404 | ||
@@ -433,7 +433,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid, | |||
433 | 433 | ||
434 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 434 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
435 | 435 | ||
436 | CODA_FREE(inp, insize); | 436 | kvfree(inp); |
437 | return error; | 437 | return error; |
438 | } | 438 | } |
439 | 439 | ||
@@ -449,7 +449,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid) | |||
449 | inp->coda_fsync.VFid = *fid; | 449 | inp->coda_fsync.VFid = *fid; |
450 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 450 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
451 | 451 | ||
452 | CODA_FREE(inp, insize); | 452 | kvfree(inp); |
453 | return error; | 453 | return error; |
454 | } | 454 | } |
455 | 455 | ||
@@ -467,7 +467,7 @@ int venus_access(struct super_block *sb, struct CodaFid *fid, int mask) | |||
467 | 467 | ||
468 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); | 468 | error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
469 | 469 | ||
470 | CODA_FREE(inp, insize); | 470 | kvfree(inp); |
471 | return error; | 471 | return error; |
472 | } | 472 | } |
473 | 473 | ||
@@ -543,7 +543,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid, | |||
543 | } | 543 | } |
544 | 544 | ||
545 | exit: | 545 | exit: |
546 | CODA_FREE(inp, insize); | 546 | kvfree(inp); |
547 | return error; | 547 | return error; |
548 | } | 548 | } |
549 | 549 | ||
@@ -565,7 +565,7 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs) | |||
565 | sfs->f_ffree = outp->coda_statfs.stat.f_ffree; | 565 | sfs->f_ffree = outp->coda_statfs.stat.f_ffree; |
566 | } | 566 | } |
567 | 567 | ||
568 | CODA_FREE(inp, insize); | 568 | kvfree(inp); |
569 | return error; | 569 | return error; |
570 | } | 570 | } |
571 | 571 | ||