]> err.no Git - linux-2.6/blobdiff - fs/fuse/fuse_i.h
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
[linux-2.6] / fs / fuse / fuse_i.h
index bcb453f681119373b88a1a2894bb4820b3f0f170..46cf933aa3bf2dc22129c74a866628d9313984c6 100644 (file)
@@ -94,6 +94,11 @@ struct fuse_out {
        /** Header returned from userspace */
        struct fuse_out_header h;
 
+       /*
+        * The following bitfields are not changed during the request
+        * processing
+        */
+
        /** Last argument is variable length (can be shorter than
            arg->size) */
        unsigned argvar:1;
@@ -120,6 +125,8 @@ enum fuse_req_state {
        FUSE_REQ_FINISHED
 };
 
+struct fuse_conn;
+
 /**
  * A request to the client
  */
@@ -134,6 +141,12 @@ struct fuse_req {
        /** refcount */
        atomic_t count;
 
+       /*
+        * The following bitfields are either set once before the
+        * request is queued or setting/clearing them is protected by
+        * fuse_lock
+        */
+
        /** True if the request has reply */
        unsigned isreply:1;
 
@@ -167,6 +180,7 @@ struct fuse_req {
                struct fuse_release_in release_in;
                struct fuse_init_in init_in;
                struct fuse_init_out init_out;
+               struct fuse_read_in read_in;
        } misc;
 
        /** page vector */
@@ -186,6 +200,9 @@ struct fuse_req {
 
        /** File used in the request (or NULL) */
        struct file *file;
+
+       /** Request completion callback */
+       void (*end)(struct fuse_conn *, struct fuse_req *);
 };
 
 /**
@@ -244,15 +261,22 @@ struct fuse_conn {
        u64 reqctr;
 
        /** Mount is active */
-       unsigned mounted : 1;
+       unsigned mounted;
 
-       /** Connection established, cleared on umount and device
-           release */
-       unsigned connected : 1;
+       /** Connection established, cleared on umount, connection
+           abort and device release */
+       unsigned connected;
 
-       /** Connection failed (version mismatch) */
+       /** Connection failed (version mismatch).  Cannot race with
+           setting other bitfields since it is only set once in INIT
+           reply, before any other request, and never cleared */
        unsigned conn_error : 1;
 
+       /*
+        * The following bitfields are only for optimization purposes
+        * and hence races in setting them will not cause malfunction
+        */
+
        /** Is fsync not implemented by fs? */
        unsigned no_fsync : 1;
 
@@ -349,11 +373,10 @@ void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
                      unsigned long nodeid, u64 nlookup);
 
 /**
- * Send READ or READDIR request
+ * Initialize READ or READDIR request
  */
-size_t fuse_send_read_common(struct fuse_req *req, struct file *file,
-                            struct inode *inode, loff_t pos, size_t count,
-                            int isdir);
+void fuse_read_fill(struct fuse_req *req, struct file *file,
+                   struct inode *inode, loff_t pos, size_t count, int opcode);
 
 /**
  * Send OPEN or OPENDIR request
@@ -463,6 +486,9 @@ void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
  */
 void fuse_release_background(struct fuse_req *req);
 
+/* Abort all requests */
+void fuse_abort_conn(struct fuse_conn *fc);
+
 /**
  * Get the attributes of a file
  */
@@ -472,8 +498,3 @@ int fuse_do_getattr(struct inode *inode);
  * Invalidate inode attributes
  */
 void fuse_invalidate_attr(struct inode *inode);
-
-/**
- * Send the INIT message
- */
-void fuse_send_init(struct fuse_conn *fc);