diff options
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -267,7 +267,6 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to) | |||
267 | if (bufs) { | 267 | if (bufs) { |
268 | int curbuf = pipe->curbuf; | 268 | int curbuf = pipe->curbuf; |
269 | struct pipe_buffer *buf = pipe->bufs + curbuf; | 269 | struct pipe_buffer *buf = pipe->bufs + curbuf; |
270 | const struct pipe_buf_operations *ops = buf->ops; | ||
271 | size_t chars = buf->len; | 270 | size_t chars = buf->len; |
272 | size_t written; | 271 | size_t written; |
273 | int error; | 272 | int error; |
@@ -275,7 +274,7 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to) | |||
275 | if (chars > total_len) | 274 | if (chars > total_len) |
276 | chars = total_len; | 275 | chars = total_len; |
277 | 276 | ||
278 | error = ops->confirm(pipe, buf); | 277 | error = pipe_buf_confirm(pipe, buf); |
279 | if (error) { | 278 | if (error) { |
280 | if (!ret) | 279 | if (!ret) |
281 | ret = error; | 280 | ret = error; |
@@ -382,11 +381,10 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from) | |||
382 | int lastbuf = (pipe->curbuf + pipe->nrbufs - 1) & | 381 | int lastbuf = (pipe->curbuf + pipe->nrbufs - 1) & |
383 | (pipe->buffers - 1); | 382 | (pipe->buffers - 1); |
384 | struct pipe_buffer *buf = pipe->bufs + lastbuf; | 383 | struct pipe_buffer *buf = pipe->bufs + lastbuf; |
385 | const struct pipe_buf_operations *ops = buf->ops; | ||
386 | int offset = buf->offset + buf->len; | 384 | int offset = buf->offset + buf->len; |
387 | 385 | ||
388 | if (ops->can_merge && offset + chars <= PAGE_SIZE) { | 386 | if (buf->ops->can_merge && offset + chars <= PAGE_SIZE) { |
389 | ret = ops->confirm(pipe, buf); | 387 | ret = pipe_buf_confirm(pipe, buf); |
390 | if (ret) | 388 | if (ret) |
391 | goto out; | 389 | goto out; |
392 | 390 | ||