pipe: add pipe_buf_release() helper

Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Miklos Szeredi 2016-09-27 10:45:12 +02:00 • committed by Al Viro
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--;
}