Skip to content

Commit 0d2d0f3

Browse files
committed
fs/pipe: remove buggy and unused 'helper' function
While looking for incorrect users of the pipe head/tail fields (see commit c27c66a: "fs/pipe: Fix pipe_occupancy() with 16-bit indexes"), I found a bug in pipe_discard_from() that looked entirely broken. However, the fix is trivial: this buggy function isn't actually called by anything, so let's just remove it ASAP. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cfced12 commit 0d2d0f3

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

include/linux/pipe_fs_i.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,6 @@ static inline bool pipe_buf_try_steal(struct pipe_inode_info *pipe,
281281
return buf->ops->try_steal(pipe, buf);
282282
}
283283

284-
static inline void pipe_discard_from(struct pipe_inode_info *pipe,
285-
unsigned int old_head)
286-
{
287-
unsigned int mask = pipe->ring_size - 1;
288-
289-
while (pipe->head > old_head)
290-
pipe_buf_release(pipe, &pipe->bufs[--pipe->head & mask]);
291-
}
292-
293284
/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
294285
memory allocation, whereas PIPE_BUF makes atomicity guarantees. */
295286
#define PIPE_SIZE PAGE_SIZE

0 commit comments

Comments
 (0)