Commit cac36bb06efe4880234524e117e0e712b10b1f16
1 parent
d96e6e7164
Exists in
master
and in
4 other branches
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>
Showing 7 changed files with 22 additions and 20 deletions Side-by-side Diff
drivers/block/loop.c
fs/nfsd/vfs.c
fs/ocfs2/file.c
... | ... | @@ -1583,7 +1583,7 @@ |
1583 | 1583 | ssize_t copied = 0; |
1584 | 1584 | struct ocfs2_splice_write_priv sp; |
1585 | 1585 | |
1586 | - ret = buf->ops->pin(pipe, buf); | |
1586 | + ret = buf->ops->confirm(pipe, buf); | |
1587 | 1587 | if (ret) |
1588 | 1588 | goto out; |
1589 | 1589 | |
... | ... | @@ -1604,7 +1604,7 @@ |
1604 | 1604 | * might enter ocfs2_buffered_write_cluster() more |
1605 | 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 | 1608 | (loff_t)sd->pos + total, |
1609 | 1609 | count, |
1610 | 1610 | ocfs2_map_and_write_splice_data, |
fs/pipe.c
... | ... | @@ -203,7 +203,8 @@ |
203 | 203 | page_cache_get(buf->page); |
204 | 204 | } |
205 | 205 | |
206 | -int generic_pipe_buf_pin(struct pipe_inode_info *info, struct pipe_buffer *buf) | |
206 | +int generic_pipe_buf_confirm(struct pipe_inode_info *info, | |
207 | + struct pipe_buffer *buf) | |
207 | 208 | { |
208 | 209 | return 0; |
209 | 210 | } |
... | ... | @@ -212,7 +213,7 @@ |
212 | 213 | .can_merge = 1, |
213 | 214 | .map = generic_pipe_buf_map, |
214 | 215 | .unmap = generic_pipe_buf_unmap, |
215 | - .pin = generic_pipe_buf_pin, | |
216 | + .confirm = generic_pipe_buf_confirm, | |
216 | 217 | .release = anon_pipe_buf_release, |
217 | 218 | .steal = generic_pipe_buf_steal, |
218 | 219 | .get = generic_pipe_buf_get, |
... | ... | @@ -252,7 +253,7 @@ |
252 | 253 | if (chars > total_len) |
253 | 254 | chars = total_len; |
254 | 255 | |
255 | - error = ops->pin(pipe, buf); | |
256 | + error = ops->confirm(pipe, buf); | |
256 | 257 | if (error) { |
257 | 258 | if (!ret) |
258 | 259 | error = ret; |
... | ... | @@ -373,7 +374,7 @@ |
373 | 374 | int error, atomic = 1; |
374 | 375 | void *addr; |
375 | 376 | |
376 | - error = ops->pin(pipe, buf); | |
377 | + error = ops->confirm(pipe, buf); | |
377 | 378 | if (error) |
378 | 379 | goto out; |
379 | 380 |
fs/splice.c
... | ... | @@ -85,8 +85,8 @@ |
85 | 85 | buf->flags &= ~PIPE_BUF_FLAG_LRU; |
86 | 86 | } |
87 | 87 | |
88 | -static int page_cache_pipe_buf_pin(struct pipe_inode_info *pipe, | |
89 | - struct pipe_buffer *buf) | |
88 | +static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe, | |
89 | + struct pipe_buffer *buf) | |
90 | 90 | { |
91 | 91 | struct page *page = buf->page; |
92 | 92 | int err; |
... | ... | @@ -127,7 +127,7 @@ |
127 | 127 | .can_merge = 0, |
128 | 128 | .map = generic_pipe_buf_map, |
129 | 129 | .unmap = generic_pipe_buf_unmap, |
130 | - .pin = page_cache_pipe_buf_pin, | |
130 | + .confirm = page_cache_pipe_buf_confirm, | |
131 | 131 | .release = page_cache_pipe_buf_release, |
132 | 132 | .steal = page_cache_pipe_buf_steal, |
133 | 133 | .get = generic_pipe_buf_get, |
... | ... | @@ -147,7 +147,7 @@ |
147 | 147 | .can_merge = 0, |
148 | 148 | .map = generic_pipe_buf_map, |
149 | 149 | .unmap = generic_pipe_buf_unmap, |
150 | - .pin = generic_pipe_buf_pin, | |
150 | + .confirm = generic_pipe_buf_confirm, | |
151 | 151 | .release = page_cache_pipe_buf_release, |
152 | 152 | .steal = user_page_pipe_buf_steal, |
153 | 153 | .get = generic_pipe_buf_get, |
... | ... | @@ -525,7 +525,7 @@ |
525 | 525 | loff_t pos = sd->pos; |
526 | 526 | int ret, more; |
527 | 527 | |
528 | - ret = buf->ops->pin(pipe, buf); | |
528 | + ret = buf->ops->confirm(pipe, buf); | |
529 | 529 | if (!ret) { |
530 | 530 | more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; |
531 | 531 | |
... | ... | @@ -569,7 +569,7 @@ |
569 | 569 | /* |
570 | 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 | 573 | if (unlikely(ret)) |
574 | 574 | return ret; |
575 | 575 | |
... | ... | @@ -1341,7 +1341,7 @@ |
1341 | 1341 | char *src; |
1342 | 1342 | int ret; |
1343 | 1343 | |
1344 | - ret = buf->ops->pin(pipe, buf); | |
1344 | + ret = buf->ops->confirm(pipe, buf); | |
1345 | 1345 | if (unlikely(ret)) |
1346 | 1346 | return ret; |
1347 | 1347 |
include/linux/pipe_fs_i.h
... | ... | @@ -35,20 +35,21 @@ |
35 | 35 | /* |
36 | 36 | * Note on the nesting of these functions: |
37 | 37 | * |
38 | - * ->pin() | |
38 | + * ->confirm() | |
39 | 39 | * ->steal() |
40 | 40 | * ... |
41 | 41 | * ->map() |
42 | 42 | * ... |
43 | 43 | * ->unmap() |
44 | 44 | * |
45 | - * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). | |
45 | + * That is, ->map() must be called on a confirmed buffer, | |
46 | + * same goes for ->steal(). | |
46 | 47 | */ |
47 | 48 | struct pipe_buf_operations { |
48 | 49 | int can_merge; |
49 | 50 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); |
50 | 51 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); |
51 | - int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); | |
52 | + int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); | |
52 | 53 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
53 | 54 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); |
54 | 55 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); |
... | ... | @@ -69,7 +70,7 @@ |
69 | 70 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); |
70 | 71 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); |
71 | 72 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); |
72 | -int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); | |
73 | +int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); | |
73 | 74 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
74 | 75 | |
75 | 76 | #endif |
kernel/relay.c
... | ... | @@ -1055,7 +1055,7 @@ |
1055 | 1055 | .can_merge = 0, |
1056 | 1056 | .map = generic_pipe_buf_map, |
1057 | 1057 | .unmap = generic_pipe_buf_unmap, |
1058 | - .pin = generic_pipe_buf_pin, | |
1058 | + .confirm = generic_pipe_buf_confirm, | |
1059 | 1059 | .release = relay_pipe_buf_release, |
1060 | 1060 | .steal = generic_pipe_buf_steal, |
1061 | 1061 | .get = generic_pipe_buf_get, |