aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h17
-rw-r--r--include/linux/pipe_fs_i.h18
-rw-r--r--include/linux/sched.h6
-rw-r--r--include/linux/syscalls.h7
4 files changed, 29 insertions, 19 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 504dcf5b297b..162c6e57307a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1039,8 +1039,8 @@ struct file_operations {
1039 int (*check_flags)(int); 1039 int (*check_flags)(int);
1040 int (*dir_notify)(struct file *filp, unsigned long arg); 1040 int (*dir_notify)(struct file *filp, unsigned long arg);
1041 int (*flock) (struct file *, int, struct file_lock *); 1041 int (*flock) (struct file *, int, struct file_lock *);
1042 ssize_t (*splice_write)(struct inode *, struct file *, size_t, unsigned int); 1042 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int);
1043 ssize_t (*splice_read)(struct file *, struct inode *, size_t, unsigned int); 1043 ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
1044}; 1044};
1045 1045
1046struct inode_operations { 1046struct inode_operations {
@@ -1611,8 +1611,17 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor
1611extern void do_generic_mapping_read(struct address_space *mapping, 1611extern void do_generic_mapping_read(struct address_space *mapping,
1612 struct file_ra_state *, struct file *, 1612 struct file_ra_state *, struct file *,
1613 loff_t *, read_descriptor_t *, read_actor_t); 1613 loff_t *, read_descriptor_t *, read_actor_t);
1614extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int); 1614
1615extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int); 1615/* fs/splice.c */
1616extern ssize_t generic_file_splice_read(struct file *,
1617 struct pipe_inode_info *, size_t, unsigned int);
1618extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
1619 struct file *, size_t, unsigned int);
1620extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
1621 struct file *out, size_t len, unsigned int flags);
1622extern long do_splice_direct(struct file *in, struct file *out,
1623 size_t len, unsigned int flags);
1624
1616extern void 1625extern void
1617file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 1626file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
1618extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, 1627extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ec384958d509..123a7c24bc72 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -36,27 +36,19 @@ struct pipe_inode_info {
36 unsigned int w_counter; 36 unsigned int w_counter;
37 struct fasync_struct *fasync_readers; 37 struct fasync_struct *fasync_readers;
38 struct fasync_struct *fasync_writers; 38 struct fasync_struct *fasync_writers;
39 struct inode *inode;
39}; 40};
40 41
41/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual 42/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
42 memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ 43 memory allocation, whereas PIPE_BUF makes atomicity guarantees. */
43#define PIPE_SIZE PAGE_SIZE 44#define PIPE_SIZE PAGE_SIZE
44 45
45#define PIPE_MUTEX(inode) (&(inode).i_mutex)
46#define PIPE_WAIT(inode) (&(inode).i_pipe->wait)
47#define PIPE_READERS(inode) ((inode).i_pipe->readers)
48#define PIPE_WRITERS(inode) ((inode).i_pipe->writers)
49#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers)
50#define PIPE_RCOUNTER(inode) ((inode).i_pipe->r_counter)
51#define PIPE_WCOUNTER(inode) ((inode).i_pipe->w_counter)
52#define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers))
53#define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers))
54
55/* Drop the inode semaphore and wait for a pipe event, atomically */ 46/* Drop the inode semaphore and wait for a pipe event, atomically */
56void pipe_wait(struct inode * inode); 47void pipe_wait(struct pipe_inode_info *pipe);
57 48
58struct inode* pipe_new(struct inode* inode); 49struct pipe_inode_info * alloc_pipe_info(struct inode * inode);
59void free_pipe_info(struct inode* inode); 50void free_pipe_info(struct inode * inode);
51void __free_pipe_info(struct pipe_inode_info *);
60 52
61/* 53/*
62 * splice is tied to pipes as a transport (at least for now), so we'll just 54 * splice is tied to pipes as a transport (at least for now), so we'll just
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 83d657811d01..e3539c14e47e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -684,6 +684,7 @@ static inline void prefetch_stack(struct task_struct *t) { }
684 684
685struct audit_context; /* See audit.c */ 685struct audit_context; /* See audit.c */
686struct mempolicy; 686struct mempolicy;
687struct pipe_inode_info;
687 688
688enum sleep_type { 689enum sleep_type {
689 SLEEP_NORMAL, 690 SLEEP_NORMAL,
@@ -882,6 +883,11 @@ struct task_struct {
882 883
883 atomic_t fs_excl; /* holding fs exclusive resources */ 884 atomic_t fs_excl; /* holding fs exclusive resources */
884 struct rcu_head rcu; 885 struct rcu_head rcu;
886
887 /*
888 * cache last used pipe for splice
889 */
890 struct pipe_inode_info *splice_pipe;
885}; 891};
886 892
887static inline pid_t process_group(struct task_struct *tsk) 893static inline pid_t process_group(struct task_struct *tsk)
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 89c4180d42f5..f001bad28d9a 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -569,8 +569,11 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
569asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 569asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
570 int flags, int mode); 570 int flags, int mode);
571asmlinkage long sys_unshare(unsigned long unshare_flags); 571asmlinkage long sys_unshare(unsigned long unshare_flags);
572asmlinkage long sys_splice(int fdin, int fdout, size_t len, 572
573 unsigned int flags); 573asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
574 int fd_out, loff_t __user *off_out,
575 size_t len, unsigned int flags);
576
574asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 577asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
575 unsigned int flags); 578 unsigned int flags);
576 579