diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-04-10 09:18:35 -0400 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-04-10 09:18:35 -0400 |
commit | 3a326a2ce88e71d00ac0d133e314a3342a7709f8 (patch) | |
tree | 3a3cf55be19311c04d195e37baec9f49c4015b18 /include/linux | |
parent | 0b749ce3802428007a37870eb51ba3c0bdf90857 (diff) |
[PATCH] introduce a "kernel-internal pipe object" abstraction
separate out the 'internal pipe object' abstraction, and make it
usable to splice. This cleans up and fixes several aspects of the
internal splice APIs and the pipe code:
- pipes: the allocation and freeing of pipe_inode_info is now more symmetric
and more streamlined with existing kernel practices.
- splice: small micro-optimization: less pointer dereferencing in splice
methods
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Update XFS for the ->splice_read/->splice_write changes.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/fs.h | 8 | ||||
-rw-r--r-- | include/linux/pipe_fs_i.h | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1e9ebaba07b7..7e6454454fbd 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 | ||
1046 | struct inode_operations { | 1046 | struct inode_operations { |
@@ -1611,8 +1611,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor | |||
1611 | extern void do_generic_mapping_read(struct address_space *mapping, | 1611 | extern 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); |
1614 | extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int); | 1614 | extern ssize_t generic_file_splice_read(struct file *, struct pipe_inode_info *, size_t, unsigned int); |
1615 | extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int); | 1615 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, struct file *, size_t, unsigned int); |
1616 | extern void | 1616 | extern void |
1617 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1617 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
1618 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | 1618 | extern 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..9cf99cb34c15 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -36,6 +36,7 @@ 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 |
@@ -53,10 +54,10 @@ struct pipe_inode_info { | |||
53 | #define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers)) | 54 | #define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers)) |
54 | 55 | ||
55 | /* Drop the inode semaphore and wait for a pipe event, atomically */ | 56 | /* Drop the inode semaphore and wait for a pipe event, atomically */ |
56 | void pipe_wait(struct inode * inode); | 57 | void pipe_wait(struct pipe_inode_info *pipe); |
57 | 58 | ||
58 | struct inode* pipe_new(struct inode* inode); | 59 | struct pipe_inode_info * alloc_pipe_info(struct inode * inode); |
59 | void free_pipe_info(struct inode* inode); | 60 | void free_pipe_info(struct inode * inode); |
60 | 61 | ||
61 | /* | 62 | /* |
62 | * splice is tied to pipes as a transport (at least for now), so we'll just | 63 | * splice is tied to pipes as a transport (at least for now), so we'll just |