fs: fix kernel_read prototype

Use proper ssize_t and size_t types for the return value and count
argument, move the offset last and make it an in/out argument like
all other read/write helpers, and make the buf argument a void pointer
to get rid of lots of casts in the callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Christoph Hellwig
2017-09-01 17:39:13 +02:00
committed by Al Viro
parent c41fbad015
commit bdd1d2d3d2
17 changed files with 69 additions and 71 deletions

View File

@@ -368,9 +368,10 @@ static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx)
goto out;
while (1) {
loff_t pos = ctx->pos - 2;
/* read entries from the directory file */
ret = kernel_read(host_file, ctx->pos - 2, (char *)vdir,
sizeof(*vdir));
ret = kernel_read(host_file, vdir, sizeof(*vdir), &pos);
if (ret < 0) {
pr_err("%s: read dir %s failed %d\n",
__func__, coda_f2s(&cii->c_fid), ret);