diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-20 17:58:15 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-20 12:11:26 -0400 |
commit | b8d9e7f2411b0744df2ec33e80d7698180fef21a (patch) | |
tree | 60c2b6c0ab693d3a2d7b6907cc6b2e61b2b52877 /include/linux/pipe_fs_i.h | |
parent | 76887c256744740d6121af9bc4aa787712a1f694 (diff) | |
download | lwn-b8d9e7f2411b0744df2ec33e80d7698180fef21a.tar.gz lwn-b8d9e7f2411b0744df2ec33e80d7698180fef21a.zip |
fs: make the pipe_buf_operations ->confirm operation optional
Just return 0 for success if it is not present.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/pipe_fs_i.h')
-rw-r--r-- | include/linux/pipe_fs_i.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index e022b2459301..7c057daa0931 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -82,7 +82,7 @@ struct pipe_buf_operations { * and that the contents are good. If the pages in the pipe belong * to a file system, we may need to wait for IO completion in this * hook. Returns 0 for good, or a negative error value in case of - * error. + * error. If not present all pages are considered good. */ int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); @@ -195,6 +195,8 @@ static inline void pipe_buf_release(struct pipe_inode_info *pipe, static inline int pipe_buf_confirm(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { + if (!buf->ops->confirm) + return 0; return buf->ops->confirm(pipe, buf); } @@ -232,7 +234,6 @@ void free_pipe_info(struct pipe_inode_info *); /* Generic pipe buffer ops functions */ bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); -int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); |