aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-06-14 07:10:48 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-07-10 02:04:15 -0400
commitcac36bb06efe4880234524e117e0e712b10b1f16 (patch)
tree5220c6f2185cee1c6934cf8048975beac5bc94bb /fs
parentd96e6e71647846e0dab097efd9b8bf3a3a556dca (diff)
pipe: change the ->pin() operation to ->confirm()
The name 'pin' was badly chosen, it doesn't pin a pipe buffer in the most commonly used sense in the kernel. So change the name to 'confirm', after debating this issue with Hugh Dickins a bit. A good return from ->confirm() means that the buffer is really there, and that the contents are good. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/vfs.c2
-rw-r--r--fs/ocfs2/file.c4
-rw-r--r--fs/pipe.c9
-rw-r--r--fs/splice.c14
4 files changed, 15 insertions, 14 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 8176fbf5c006..8604e35bd48e 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -815,7 +815,7 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
815 size_t size; 815 size_t size;
816 int ret; 816 int ret;
817 817
818 ret = buf->ops->pin(pipe, buf); 818 ret = buf->ops->confirm(pipe, buf);
819 if (unlikely(ret)) 819 if (unlikely(ret))
820 return ret; 820 return ret;
821 821
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 44c2e2afa465..4979b6675717 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1583,7 +1583,7 @@ static int ocfs2_splice_write_actor(struct pipe_inode_info *pipe,
1583 ssize_t copied = 0; 1583 ssize_t copied = 0;
1584 struct ocfs2_splice_write_priv sp; 1584 struct ocfs2_splice_write_priv sp;
1585 1585
1586 ret = buf->ops->pin(pipe, buf); 1586 ret = buf->ops->confirm(pipe, buf);
1587 if (ret) 1587 if (ret)
1588 goto out; 1588 goto out;
1589 1589
@@ -1604,7 +1604,7 @@ static int ocfs2_splice_write_actor(struct pipe_inode_info *pipe,
1604 * might enter ocfs2_buffered_write_cluster() more 1604 * might enter ocfs2_buffered_write_cluster() more
1605 * than once, so keep track of our progress here. 1605 * than once, so keep track of our progress here.
1606 */ 1606 */
1607 copied = ocfs2_buffered_write_cluster(sd->file, 1607 copied = ocfs2_buffered_write_cluster(sd->u.file,
1608 (loff_t)sd->pos + total, 1608 (loff_t)sd->pos + total,
1609 count, 1609 count,
1610 ocfs2_map_and_write_splice_data, 1610 ocfs2_map_and_write_splice_data,
diff --git a/fs/pipe.c b/fs/pipe.c
index 3a89592bdf57..3694af10dd2c 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -203,7 +203,8 @@ void generic_pipe_buf_get(struct pipe_inode_info *info, struct pipe_buffer *buf)
203 page_cache_get(buf->page); 203 page_cache_get(buf->page);
204} 204}
205 205
206int generic_pipe_buf_pin(struct pipe_inode_info *info, struct pipe_buffer *buf) 206int generic_pipe_buf_confirm(struct pipe_inode_info *info,
207 struct pipe_buffer *buf)
207{ 208{
208 return 0; 209 return 0;
209} 210}
@@ -212,7 +213,7 @@ static const struct pipe_buf_operations anon_pipe_buf_ops = {
212 .can_merge = 1, 213 .can_merge = 1,
213 .map = generic_pipe_buf_map, 214 .map = generic_pipe_buf_map,
214 .unmap = generic_pipe_buf_unmap, 215 .unmap = generic_pipe_buf_unmap,
215 .pin = generic_pipe_buf_pin, 216 .confirm = generic_pipe_buf_confirm,
216 .release = anon_pipe_buf_release, 217 .release = anon_pipe_buf_release,
217 .steal = generic_pipe_buf_steal, 218 .steal = generic_pipe_buf_steal,
218 .get = generic_pipe_buf_get, 219 .get = generic_pipe_buf_get,
@@ -252,7 +253,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
252 if (chars > total_len) 253 if (chars > total_len)
253 chars = total_len; 254 chars = total_len;
254 255
255 error = ops->pin(pipe, buf); 256 error = ops->confirm(pipe, buf);
256 if (error) { 257 if (error) {
257 if (!ret) 258 if (!ret)
258 error = ret; 259 error = ret;
@@ -373,7 +374,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
373 int error, atomic = 1; 374 int error, atomic = 1;
374 void *addr; 375 void *addr;
375 376
376 error = ops->pin(pipe, buf); 377 error = ops->confirm(pipe, buf);
377 if (error) 378 if (error)
378 goto out; 379 goto out;
379 380
diff --git a/fs/splice.c b/fs/splice.c
index d257d666358b..c804121601b0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -85,8 +85,8 @@ static void page_cache_pipe_buf_release(struct pipe_inode_info *pipe,
85 buf->flags &= ~PIPE_BUF_FLAG_LRU; 85 buf->flags &= ~PIPE_BUF_FLAG_LRU;
86} 86}
87 87
88static int page_cache_pipe_buf_pin(struct pipe_inode_info *pipe, 88static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe,
89 struct pipe_buffer *buf) 89 struct pipe_buffer *buf)
90{ 90{
91 struct page *page = buf->page; 91 struct page *page = buf->page;
92 int err; 92 int err;
@@ -127,7 +127,7 @@ static const struct pipe_buf_operations page_cache_pipe_buf_ops = {
127 .can_merge = 0, 127 .can_merge = 0,
128 .map = generic_pipe_buf_map, 128 .map = generic_pipe_buf_map,
129 .unmap = generic_pipe_buf_unmap, 129 .unmap = generic_pipe_buf_unmap,
130 .pin = page_cache_pipe_buf_pin, 130 .confirm = page_cache_pipe_buf_confirm,
131 .release = page_cache_pipe_buf_release, 131 .release = page_cache_pipe_buf_release,
132 .steal = page_cache_pipe_buf_steal, 132 .steal = page_cache_pipe_buf_steal,
133 .get = generic_pipe_buf_get, 133 .get = generic_pipe_buf_get,
@@ -147,7 +147,7 @@ static const struct pipe_buf_operations user_page_pipe_buf_ops = {
147 .can_merge = 0, 147 .can_merge = 0,
148 .map = generic_pipe_buf_map, 148 .map = generic_pipe_buf_map,
149 .unmap = generic_pipe_buf_unmap, 149 .unmap = generic_pipe_buf_unmap,
150 .pin = generic_pipe_buf_pin, 150 .confirm = generic_pipe_buf_confirm,
151 .release = page_cache_pipe_buf_release, 151 .release = page_cache_pipe_buf_release,
152 .steal = user_page_pipe_buf_steal, 152 .steal = user_page_pipe_buf_steal,
153 .get = generic_pipe_buf_get, 153 .get = generic_pipe_buf_get,
@@ -525,7 +525,7 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
525 loff_t pos = sd->pos; 525 loff_t pos = sd->pos;
526 int ret, more; 526 int ret, more;
527 527
528 ret = buf->ops->pin(pipe, buf); 528 ret = buf->ops->confirm(pipe, buf);
529 if (!ret) { 529 if (!ret) {
530 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; 530 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
531 531
@@ -569,7 +569,7 @@ static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
569 /* 569 /*
570 * make sure the data in this buffer is uptodate 570 * make sure the data in this buffer is uptodate
571 */ 571 */
572 ret = buf->ops->pin(pipe, buf); 572 ret = buf->ops->confirm(pipe, buf);
573 if (unlikely(ret)) 573 if (unlikely(ret))
574 return ret; 574 return ret;
575 575
@@ -1341,7 +1341,7 @@ static int pipe_to_user(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
1341 char *src; 1341 char *src;
1342 int ret; 1342 int ret;
1343 1343
1344 ret = buf->ops->pin(pipe, buf); 1344 ret = buf->ops->confirm(pipe, buf);
1345 if (unlikely(ret)) 1345 if (unlikely(ret))
1346 return ret; 1346 return ret;
1347 1347