diff options
| author | Miklos Szeredi <mszeredi@redhat.com> | 2024-10-21 13:33:38 +0300 |
|---|---|---|
| committer | Amir Goldstein <amir73il@gmail.com> | 2024-11-11 12:45:03 +0300 |
| commit | 48b50624aec454ce0fa8f78ef96e2f43bc0be495 (patch) | |
| tree | 607d8001af0e76d0a734c0f1ddbe830665ea9cff /include/linux/backing-file.h | |
| parent | 3b6b99ef15ea37635604992ede9ebcccef38a239 (diff) | |
| download | linux-48b50624aec454ce0fa8f78ef96e2f43bc0be495.tar.xz | |
backing-file: clean up the API
- Pass iocb to ctx->end_write() instead of file + pos
- Get rid of ctx->user_file, which is redundant most of the time
- Instead pass iocb to backing_file_splice_read and
backing_file_splice_write
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'include/linux/backing-file.h')
| -rw-r--r-- | include/linux/backing-file.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/backing-file.h b/include/linux/backing-file.h index 2eed0ffb5e8f..1476a6ed1bfd 100644 --- a/include/linux/backing-file.h +++ b/include/linux/backing-file.h @@ -14,9 +14,8 @@ struct backing_file_ctx { const struct cred *cred; - struct file *user_file; - void (*accessed)(struct file *); - void (*end_write)(struct file *, loff_t, ssize_t); + void (*accessed)(struct file *file); + void (*end_write)(struct kiocb *iocb, ssize_t); }; struct file *backing_file_open(const struct path *user_path, int flags, @@ -31,13 +30,13 @@ ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter, ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter, struct kiocb *iocb, int flags, struct backing_file_ctx *ctx); -ssize_t backing_file_splice_read(struct file *in, loff_t *ppos, +ssize_t backing_file_splice_read(struct file *in, struct kiocb *iocb, struct pipe_inode_info *pipe, size_t len, unsigned int flags, struct backing_file_ctx *ctx); ssize_t backing_file_splice_write(struct pipe_inode_info *pipe, - struct file *out, loff_t *ppos, size_t len, - unsigned int flags, + struct file *out, struct kiocb *iocb, + size_t len, unsigned int flags, struct backing_file_ctx *ctx); int backing_file_mmap(struct file *file, struct vm_area_struct *vma, struct backing_file_ctx *ctx); |
