Skip to content

Commit

Permalink
coda: get rid of CODA_FREE()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jan Harkes <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Colin Ian King <[email protected]>
Cc: David Howells <[email protected]>
Cc: Fabian Frederick <[email protected]>
Cc: Mikko Rapeli <[email protected]>
Cc: Sam Protsenko <[email protected]>
Cc: Yann Droneaud <[email protected]>
Cc: Zhouyang Jia <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dan Carpenter authored and torvalds committed Jul 17, 2019
1 parent 4dc4819 commit 936dae4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
2 changes: 0 additions & 2 deletions fs/coda/coda_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ unsigned short coda_flags_to_cflags(unsigned short);
void coda_sysctl_init(void);
void coda_sysctl_clean(void);

#define CODA_FREE(ptr, size) kvfree((ptr))

/* inode to cnode access functions */

static inline struct coda_inode_info *ITOC(struct inode *inode)
Expand Down
8 changes: 4 additions & 4 deletions fs/coda/psdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
goto out;
}
if (copy_from_user(dcbuf, buf, nbytes)) {
CODA_FREE(dcbuf, nbytes);
kvfree(dcbuf);
retval = -EFAULT;
goto out;
}

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

CODA_FREE(dcbuf, nbytes);
kvfree(dcbuf);
if (error) {
pr_warn("%s: coda_downcall error: %d\n",
__func__, error);
Expand Down Expand Up @@ -263,7 +263,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,
goto out;
}

CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
kvfree(req->uc_data);
kfree(req);
out:
mutex_unlock(&vcp->vc_mutex);
Expand Down Expand Up @@ -325,7 +325,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)

/* Async requests need to be freed here */
if (req->uc_flags & CODA_REQ_ASYNC) {
CODA_FREE(req->uc_data, sizeof(struct coda_in_hdr));
kvfree(req->uc_data);
kfree(req);
continue;
}
Expand Down
36 changes: 18 additions & 18 deletions fs/coda/upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp)
if (!error)
*fidp = outp->coda_root.VFid;

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

Expand Down Expand Up @@ -262,7 +262,7 @@ int venus_rename(struct super_block *sb, struct CodaFid *old_fid,

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

Expand Down Expand Up @@ -398,7 +398,7 @@ int venus_link(struct super_block *sb, struct CodaFid *fid,

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

Expand Down Expand Up @@ -433,7 +433,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

Expand Down Expand Up @@ -543,7 +543,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
}

exit:
CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

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

CODA_FREE(inp, insize);
kvfree(inp);
return error;
}

Expand Down

0 comments on commit 936dae4

Please sign in to comment.