aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-04-02 17:11:04 -0400
committerJens Axboe <axboe@suse.de>2006-04-02 17:11:04 -0400
commit3e7ee3e7b36fa4e2d88d8fb0a2577be95fc4636d (patch)
tree46e972e78122f8a719dafc87572bffb25716e745 /fs/pipe.c
parentad8d6f0a783ffa2ff9b0cf09910b889715772201 (diff)
[PATCH] splice: fix page stealing LRU handling.
Originally from Nick Piggin, just adapted to the newer branch. You can't check PageLRU without holding zone->lru_lock. The page release code can get away with it only because the page refcount is 0 at that point. Also, you can't reliably remove pages from the LRU unless the refcount is 0. Ever. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 5093408746b8..795df987cd38 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -95,6 +95,8 @@ static void anon_pipe_buf_release(struct pipe_inode_info *info, struct pipe_buff
95{ 95{
96 struct page *page = buf->page; 96 struct page *page = buf->page;
97 97
98 buf->flags &= ~PIPE_BUF_FLAG_STOLEN;
99
98 /* 100 /*
99 * If nobody else uses this page, and we don't already have a 101 * If nobody else uses this page, and we don't already have a
100 * temporary page, let's keep track of it as a one-deep 102 * temporary page, let's keep track of it as a one-deep
@@ -124,6 +126,7 @@ static void anon_pipe_buf_unmap(struct pipe_inode_info *info, struct pipe_buffer
124static int anon_pipe_buf_steal(struct pipe_inode_info *info, 126static int anon_pipe_buf_steal(struct pipe_inode_info *info,
125 struct pipe_buffer *buf) 127 struct pipe_buffer *buf)
126{ 128{
129 buf->flags |= PIPE_BUF_FLAG_STOLEN;
127 return 0; 130 return 0;
128} 131}
129 132