]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/fuse/fuse_i.h
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
[karo-tx-linux.git] / fs / fuse / fuse_i.h
index 86f0133038289e9ae4bf08cb9caabf7d7ff22413..6fc5aedaa0d52b3d86d94bde490aa5711e47cfd1 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
@@ -111,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 */
@@ -328,6 +336,9 @@ struct fuse_conn {
        /** 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;
 
@@ -416,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;
 
@@ -451,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)
@@ -476,7 +493,7 @@ static inline u64 get_node_id(struct inode *inode)
 /** Device operations */
 extern const struct file_operations fuse_dev_operations;
 
-extern struct dentry_operations fuse_dentry_operations;
+extern const struct dentry_operations fuse_dentry_operations;
 
 /**
  * Get a filled in inode
@@ -524,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
  */
@@ -599,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);
@@ -628,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
  */