]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/fuse_i.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[linux-2.6-omap-h63xx.git] / fs / fuse / fuse_i.h
index 4fc5131f5c9d266132d72faa254d9b21e5aae5ef..5e64b815a5a16d737e655c8deeb2729288da81fa 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/backing-dev.h>
 #include <linux/mutex.h>
 #include <linux/rwsem.h>
+#include <linux/rbtree.h>
+#include <linux/poll.h>
 
 /** Max number of pages that can be used in a single read request */
 #define FUSE_MAX_PAGES_PER_REQ 32
@@ -100,6 +102,9 @@ struct fuse_file {
        /** Request reserved for flush and release */
        struct fuse_req *reserved_req;
 
+       /** Kernel file handle guaranteed to be unique */
+       u64 kh;
+
        /** File handle used by userspace */
        u64 fh;
 
@@ -108,6 +113,12 @@ struct fuse_file {
 
        /** Entry on inode's write_files list */
        struct list_head write_entry;
+
+       /** RB node to be linked on fuse_conn->polled_files */
+       struct rb_node polled_node;
+
+       /** Wait queue head for poll */
+       wait_queue_head_t poll_wait;
 };
 
 /** One input argument of a request */
@@ -322,6 +333,12 @@ struct fuse_conn {
        /** The list of requests under I/O */
        struct list_head io;
 
+       /** The next unique kernel file handle */
+       u64 khctr;
+
+       /** rbtree of fuse_files waiting for poll events indexed by ph */
+       struct rb_root polled_files;
+
        /** Number of requests currently in the background */
        unsigned num_background;
 
@@ -410,6 +427,9 @@ struct fuse_conn {
        /** Is bmap not implemented by fs? */
        unsigned no_bmap:1;
 
+       /** Is poll not implemented by fs? */
+       unsigned no_poll:1;
+
        /** Do multi-page cached writes */
        unsigned big_writes:1;
 
@@ -445,6 +465,9 @@ struct fuse_conn {
 
        /** Version counter for attribute changes */
        u64 attr_version;
+
+       /** Called on final put */
+       void (*release)(struct fuse_conn *);
 };
 
 static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
@@ -499,7 +522,7 @@ void fuse_read_fill(struct fuse_req *req, struct file *file,
  */
 int fuse_open_common(struct inode *inode, struct file *file, int isdir);
 
-struct fuse_file *fuse_file_alloc(void);
+struct fuse_file *fuse_file_alloc(struct fuse_conn *fc);
 void fuse_file_free(struct fuse_file *ff);
 void fuse_finish_open(struct inode *inode, struct file *file,
                      struct fuse_file *ff, struct fuse_open_out *outarg);
@@ -518,6 +541,12 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir);
 int fuse_fsync_common(struct file *file, struct dentry *de, int datasync,
                      int isdir);
 
+/**
+ * Notify poll wakeup
+ */
+int fuse_notify_poll_wakeup(struct fuse_conn *fc,
+                           struct fuse_notify_poll_wakeup_out *outarg);
+
 /**
  * Initialize file operations on a regular file
  */
@@ -593,19 +622,20 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);
 /**
  * Send a request (synchronous)
  */
-void request_send(struct fuse_conn *fc, struct fuse_req *req);
+void fuse_request_send(struct fuse_conn *fc, struct fuse_req *req);
 
 /**
  * Send a request with no reply
  */
-void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
+void fuse_request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
 
 /**
  * Send a request in the background
  */
-void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
+void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req);
 
-void request_send_background_locked(struct fuse_conn *fc, struct fuse_req *req);
+void fuse_request_send_background_locked(struct fuse_conn *fc,
+                                        struct fuse_req *req);
 
 /* Abort all requests */
 void fuse_abort_conn(struct fuse_conn *fc);
@@ -622,6 +652,11 @@ void fuse_invalidate_entry_cache(struct dentry *entry);
  */
 struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
 
+/**
+ * Initialize fuse_conn
+ */
+int fuse_conn_init(struct fuse_conn *fc, struct super_block *sb);
+
 /**
  * Release reference to fuse_conn
  */