fuse: fix bad inode
[linux-2.6-microblaze.git] / fs / fuse / fuse_i.h
index d414c78..7c4b8cb 100644 (file)
@@ -172,6 +172,8 @@ enum {
        FUSE_I_INIT_RDPLUS,
        /** An operation changing file size is in progress  */
        FUSE_I_SIZE_UNSTABLE,
+       /* Bad inode */
+       FUSE_I_BAD,
 };
 
 struct fuse_conn;
@@ -859,6 +861,16 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc)
        return atomic64_read(&fc->attr_version);
 }
 
+static inline void fuse_make_bad(struct inode *inode)
+{
+       set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
+}
+
+static inline bool fuse_is_bad(struct inode *inode)
+{
+       return unlikely(test_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state));
+}
+
 /** Device operations */
 extern const struct file_operations fuse_dev_operations;