diff options
author | Christoph Hellwig <hch@lst.de> | 2017-09-01 11:39:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-04 19:05:15 -0400 |
commit | bdd1d2d3d251c65b74ac4493e08db18971c09240 (patch) | |
tree | 71df247eeb367203c59a26eed8a384398c2d8131 /net/9p | |
parent | c41fbad015dabb0a40ecca50c3ff5658eb6471ff (diff) |
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>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/trans_fd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index ddfa86648f95..f12815777beb 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -272,6 +272,7 @@ static int p9_fd_read(struct p9_client *client, void *v, int len) | |||
272 | { | 272 | { |
273 | int ret; | 273 | int ret; |
274 | struct p9_trans_fd *ts = NULL; | 274 | struct p9_trans_fd *ts = NULL; |
275 | loff_t pos; | ||
275 | 276 | ||
276 | if (client && client->status != Disconnected) | 277 | if (client && client->status != Disconnected) |
277 | ts = client->trans; | 278 | ts = client->trans; |
@@ -282,7 +283,8 @@ static int p9_fd_read(struct p9_client *client, void *v, int len) | |||
282 | if (!(ts->rd->f_flags & O_NONBLOCK)) | 283 | if (!(ts->rd->f_flags & O_NONBLOCK)) |
283 | p9_debug(P9_DEBUG_ERROR, "blocking read ...\n"); | 284 | p9_debug(P9_DEBUG_ERROR, "blocking read ...\n"); |
284 | 285 | ||
285 | ret = kernel_read(ts->rd, ts->rd->f_pos, v, len); | 286 | pos = ts->rd->f_pos; |
287 | ret = kernel_read(ts->rd, v, len, &pos); | ||
286 | if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN) | 288 | if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN) |
287 | client->status = Disconnected; | 289 | client->status = Disconnected; |
288 | return ret; | 290 | return ret; |