diff options
| author | Christoph Hellwig <hch@sb.bsdonline.org> | 2002-07-27 21:24:07 +0200 |
|---|---|---|
| committer | Christoph Hellwig <hch@sb.bsdonline.org> | 2002-07-27 21:24:07 +0200 |
| commit | 6b1ca206c66dbeeec380813cd183a09de839b4bd (patch) | |
| tree | 266e666065c2d8da058f34856786be48fd8cce4e /include/linux/fs.h | |
| parent | 46979afd7f43d0ef8d03c09023fb6ebf5196fc90 (diff) | |
VFS: implement sendfile file operation
Currently the sendfile syscalls hardcode assumptions about the
implementation of the read file operations implementation. Although
it checks for the presence of a readpage address-space operation
filesystems in Linux are free to implement read differently from
the generic version (generic_file_read). Many filesystems such
as tmpfs, smbfs or xfs chose to implement it differently and need
additional locking, revalidation or checks.
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 21aa43cc5c4d..1d3334ca66d9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -757,6 +757,7 @@ struct file_operations { int (*lock) (struct file *, int, struct file_lock *); ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); + ssize_t (*sendfile) (struct file *, struct file *, loff_t *, size_t); ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); }; @@ -1234,6 +1235,7 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *); +extern ssize_t generic_file_sendfile(struct file *, struct file *, loff_t *, size_t); extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); ssize_t generic_file_direct_IO(int rw, struct inode *inode, char *buf, loff_t offset, size_t count); |
