]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/fuse_i.h
driver core: clean up device_shutdown
[linux-2.6-omap-h63xx.git] / fs / fuse / fuse_i.h
index 1764506fdd11bc4da0e89a658c9a0bbdaa2a51b0..3ab8a3048e8b8fa185028cdeab329463ed6b1245 100644 (file)
@@ -67,6 +67,12 @@ struct fuse_inode {
        /** The sticky bit in inode->i_mode may have been removed, so
            preserve the original mode */
        mode_t orig_i_mode;
+
+       /** Version of last attribute change */
+       u64 attr_version;
+
+       /** Files usable in writepage.  Protected by fc->lock */
+       struct list_head write_files;
 };
 
 /** FUSE specific file data */
@@ -79,6 +85,9 @@ struct fuse_file {
 
        /** Refcount */
        atomic_t count;
+
+       /** Entry on inode's write_files list */
+       struct list_head write_entry;
 };
 
 /** One input argument of a request */
@@ -210,6 +219,10 @@ struct fuse_req {
                struct fuse_init_in init_in;
                struct fuse_init_out init_out;
                struct fuse_read_in read_in;
+               struct {
+                       struct fuse_write_in in;
+                       struct fuse_write_out out;
+               } write;
                struct fuse_lk_in lk_in;
        } misc;
 
@@ -317,6 +330,9 @@ struct fuse_conn {
        /** Do readpages asynchronously?  Only set in INIT */
        unsigned async_read : 1;
 
+       /** Do not send separate SETATTR request before open(O_TRUNC)  */
+       unsigned atomic_o_trunc : 1;
+
        /*
         * The following bitfields are only for optimization purposes
         * and hence races in setting them will not cause malfunction
@@ -387,6 +403,9 @@ struct fuse_conn {
 
        /** Reserved request for the DESTROY message */
        struct fuse_req *destroy_req;
+
+       /** Version counter for attribute changes */
+       u64 attr_version;
 };
 
 static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
@@ -416,7 +435,8 @@ extern const struct file_operations fuse_dev_operations;
  * Get a filled in inode
  */
 struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
-                       int generation, struct fuse_attr *attr);
+                       int generation, struct fuse_attr *attr,
+                       u64 attr_valid, u64 attr_version);
 
 /**
  * Send FORGET command
@@ -427,7 +447,7 @@ void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
 /**
  * Initialize READ or READDIR request
  */
-void fuse_read_fill(struct fuse_req *req, struct fuse_file *ff,
+void fuse_read_fill(struct fuse_req *req, struct file *file,
                    struct inode *inode, loff_t pos, size_t count, int opcode);
 
 /**
@@ -477,7 +497,8 @@ void fuse_init_symlink(struct inode *inode);
 /**
  * Change attributes of an inode
  */
-void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr);
+void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr,
+                           u64 attr_valid, u64 attr_version);
 
 /**
  * Initialize the client device
@@ -565,3 +586,13 @@ void fuse_ctl_remove_conn(struct fuse_conn *fc);
  * Is file type valid?
  */
 int fuse_valid_type(int m);
+
+/**
+ * Is task allowed to perform filesystem operation?
+ */
+int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task);
+
+u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id);
+
+int fuse_update_attributes(struct inode *inode, struct kstat *stat,
+                          struct file *file, bool *refreshed);