pipe: add pipe_buf_release() helper

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Miklos Szeredi 2016-09-27 10:45:12 +02:00 committed by Al Viro
parent 7bf2d1df80
commit a779638cf6
5 changed files with 25 additions and 22 deletions

View file

@ -709,9 +709,7 @@ static void pipe_advance(struct iov_iter *i, size_t size)
int unused = (pipe->curbuf + pipe->nrbufs) & (pipe->buffers - 1);
/* [curbuf,unused) is in use. Free [idx,unused) */
while (idx != unused) {
buf = &pipe->bufs[idx];
buf->ops->release(pipe, buf);
buf->ops = NULL;
pipe_buf_release(pipe, &pipe->bufs[idx]);
idx = next_idx(idx, pipe);
pipe->nrbufs--;
}