[PATCH] fuse: validate rootmode mount option
[deliverable/linux.git] / fs / fuse / fuse_i.h
index ac12b01f44468c52a86dbd934c1d0126909342f1..68ae87cbafab556a8b3843681274f7ac911ceae8 100644 (file)
@@ -59,13 +59,13 @@ struct fuse_inode {
        struct fuse_req *forget_req;
 
        /** Time in jiffies until the file attributes are valid */
-       unsigned long i_time;
+       u64 i_time;
 };
 
 /** FUSE specific file data */
 struct fuse_file {
        /** Request reserved for flush and release */
-       struct fuse_req *release_req;
+       struct fuse_req *reserved_req;
 
        /** File handle used by userspace */
        u64 fh;
@@ -131,6 +131,7 @@ enum fuse_req_state {
        FUSE_REQ_PENDING,
        FUSE_REQ_READING,
        FUSE_REQ_SENT,
+       FUSE_REQ_WRITING,
        FUSE_REQ_FINISHED
 };
 
@@ -144,9 +145,15 @@ struct fuse_req {
            fuse_conn */
        struct list_head list;
 
+       /** Entry on the interrupts list  */
+       struct list_head intr_entry;
+
        /** refcount */
        atomic_t count;
 
+       /** Unique ID for the interrupt request */
+       u64 intr_unique;
+
        /*
         * The following bitfields are either set once before the
         * request is queued or setting/clearing them is protected by
@@ -159,12 +166,15 @@ struct fuse_req {
        /** Force sending of the request even if interrupted */
        unsigned force:1;
 
-       /** The request was interrupted */
-       unsigned interrupted:1;
+       /** The request was aborted */
+       unsigned aborted:1;
 
        /** Request is sent in the background */
        unsigned background:1;
 
+       /** The request has been interrupted */
+       unsigned interrupted:1;
+
        /** Data is being copied to/from the request */
        unsigned locked:1;
 
@@ -190,6 +200,7 @@ struct fuse_req {
                struct fuse_init_in init_in;
                struct fuse_init_out init_out;
                struct fuse_read_in read_in;
+               struct fuse_lk_in lk_in;
        } misc;
 
        /** page vector */
@@ -212,6 +223,9 @@ struct fuse_req {
 
        /** Request completion callback */
        void (*end)(struct fuse_conn *, struct fuse_req *);
+
+       /** Request is stolen from fuse_file->reserved_req */
+       struct file *stolen_file;
 };
 
 /**
@@ -225,6 +239,9 @@ struct fuse_conn {
        /** Lock protecting accessess to  members of this structure */
        spinlock_t lock;
 
+       /** Mutex protecting against directory alias creation */
+       struct mutex inst_mutex;
+
        /** Refcount */
        atomic_t count;
 
@@ -258,6 +275,9 @@ struct fuse_conn {
        /** Number of requests currently in the background */
        unsigned num_background;
 
+       /** Pending interrupts */
+       struct list_head interrupts;
+
        /** Flag indicating if connection is blocked.  This will be
            the case before the INIT reply is received, and if there
            are too many outstading backgrounds requests */
@@ -278,6 +298,9 @@ struct fuse_conn {
            reply, before any other request, and never cleared */
        unsigned conn_error : 1;
 
+       /** Connection successful.  Only set in INIT */
+       unsigned conn_init : 1;
+
        /** Do readpages asynchronously?  Only set in INIT */
        unsigned async_read : 1;
 
@@ -307,12 +330,21 @@ struct fuse_conn {
        /** Is removexattr not implemented by fs? */
        unsigned no_removexattr : 1;
 
+       /** Are file locking primitives not implemented by fs? */
+       unsigned no_lock : 1;
+
        /** Is access not implemented by fs? */
        unsigned no_access : 1;
 
        /** Is create not implemented by fs? */
        unsigned no_create : 1;
 
+       /** Is interrupt not implemented by fs? */
+       unsigned no_interrupt : 1;
+
+       /** Is bmap not implemented by fs? */
+       unsigned no_bmap : 1;
+
        /** The number of requests waiting for completion */
        atomic_t num_waiting;
 
@@ -336,6 +368,12 @@ struct fuse_conn {
 
        /** O_ASYNC requests */
        struct fasync_struct *fasync;
+
+       /** Key for lock owner ID scrambling */
+       u32 scramble_key[4];
+
+       /** Reserved request for the DESTROY message */
+       struct fuse_req *destroy_req;
 };
 
 static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
@@ -452,10 +490,15 @@ struct fuse_req *fuse_request_alloc(void);
 void fuse_request_free(struct fuse_req *req);
 
 /**
- * Reserve a preallocated request
+ * Get a request, may fail with -ENOMEM
  */
 struct fuse_req *fuse_get_req(struct fuse_conn *fc);
 
+/**
+ * Gets a requests for a file operation, always succeeds
+ */
+struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file);
+
 /**
  * Decrement reference count of a request.  If count goes to zero free
  * the request.
@@ -509,3 +552,8 @@ int fuse_ctl_add_conn(struct fuse_conn *fc);
  * Remove connection from control filesystem
  */
 void fuse_ctl_remove_conn(struct fuse_conn *fc);
+
+/**
+ * Is file type valid?
+ */
+int fuse_valid_type(int m);
This page took 0.042091 seconds and 5 git commands to generate.