[PATCH] splice: fix bugs in pipe_to_file()
[powerpc.git] / include / linux / pipe_fs_i.h
index 123a7c2..3130977 100644 (file)
@@ -5,8 +5,7 @@
 
 #define PIPE_BUFFERS (16)
 
-#define PIPE_BUF_FLAG_STOLEN   0x01
-#define PIPE_BUF_FLAG_LRU      0x02
+#define PIPE_BUF_FLAG_LRU      0x01
 
 struct pipe_buffer {
        struct page *page;
@@ -21,6 +20,7 @@ struct pipe_buf_operations {
        void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *);
        void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
        int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
+       void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
 };
 
 struct pipe_inode_info {
@@ -60,4 +60,21 @@ void __free_pipe_info(struct pipe_inode_info *);
                                 /* from/to, of course */
 #define SPLICE_F_MORE  (0x04)  /* expect more data */
 
+/*
+ * Passed to the actors
+ */
+struct splice_desc {
+       unsigned int len, total_len;    /* current and remaining length */
+       unsigned int flags;             /* splice flags */
+       struct file *file;              /* file to read/write */
+       loff_t pos;                     /* file position */
+};
+
+typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
+                          struct splice_desc *);
+
+extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
+                               loff_t *, size_t, unsigned int,
+                               splice_actor *);
+
 #endif