block: treat REQ_FUA and REQ_PREFLUSH as synchronous
[sfrench/cifs-2.6.git] / include / linux / fs.h
index 4ba5957ae0894bee1cad8db67f7f3b152e2b6f46..ccedccb28ec8bbe90ea212a348b2a14668a224b3 100644 (file)
@@ -196,12 +196,12 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 #define READ                   REQ_OP_READ
 #define WRITE                  REQ_OP_WRITE
 
-#define READ_SYNC              REQ_SYNC
+#define READ_SYNC              0
 #define WRITE_SYNC             (REQ_SYNC | REQ_NOIDLE)
 #define WRITE_ODIRECT          REQ_SYNC
-#define WRITE_FLUSH            (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH)
-#define WRITE_FUA              (REQ_SYNC | REQ_NOIDLE | REQ_FUA)
-#define WRITE_FLUSH_FUA                (REQ_SYNC | REQ_NOIDLE | REQ_PREFLUSH | REQ_FUA)
+#define WRITE_FLUSH            (REQ_NOIDLE | REQ_PREFLUSH)
+#define WRITE_FUA              (REQ_NOIDLE | REQ_FUA)
+#define WRITE_FLUSH_FUA                (REQ_NOIDLE | REQ_PREFLUSH | REQ_FUA)
 
 /*
  * Attribute flags.  These should be or-ed together to figure out what
@@ -440,8 +440,9 @@ struct address_space {
        unsigned long           nrexceptional;
        pgoff_t                 writeback_index;/* writeback starts here */
        const struct address_space_operations *a_ops;   /* methods */
-       unsigned long           flags;          /* error bits/gfp mask */
+       unsigned long           flags;          /* error bits */
        spinlock_t              private_lock;   /* for use by the address_space */
+       gfp_t                   gfp_mask;       /* implicit gfp mask for allocations */
        struct list_head        private_list;   /* ditto */
        void                    *private_data;  /* ditto */
 } __attribute__((aligned(sizeof(long))));
@@ -592,6 +593,7 @@ is_uncached_acl(struct posix_acl *acl)
 #define IOP_FASTPERM   0x0001
 #define IOP_LOOKUP     0x0002
 #define IOP_NOFOLLOW   0x0004
+#define IOP_XATTR      0x0008
 
 /*
  * Keep mostly read-only and often accessed (especially for
@@ -1472,6 +1474,7 @@ static inline void i_gid_write(struct inode *inode, gid_t gid)
 }
 
 extern struct timespec current_fs_time(struct super_block *sb);
+extern struct timespec current_time(struct inode *inode);
 
 /*
  * Snapshotting support.
@@ -1746,17 +1749,10 @@ struct inode_operations {
        int (*rmdir) (struct inode *,struct dentry *);
        int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
        int (*rename) (struct inode *, struct dentry *,
-                       struct inode *, struct dentry *);
-       int (*rename2) (struct inode *, struct dentry *,
                        struct inode *, struct dentry *, unsigned int);
        int (*setattr) (struct dentry *, struct iattr *);
        int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
-       int (*setxattr) (struct dentry *, struct inode *,
-                        const char *, const void *, size_t, int);
-       ssize_t (*getxattr) (struct dentry *, struct inode *,
-                            const char *, void *, size_t);
        ssize_t (*listxattr) (struct dentry *, char *, size_t);
-       int (*removexattr) (struct dentry *, const char *);
        int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
                      u64 len);
        int (*update_time)(struct inode *, struct timespec *, int);
@@ -2087,10 +2083,19 @@ struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
                        int flags, void *data);
-extern struct dentry *mount_pseudo(struct file_system_type *, char *,
-       const struct super_operations *ops,
-       const struct dentry_operations *dops,
-       unsigned long);
+extern struct dentry *mount_pseudo_xattr(struct file_system_type *, char *,
+                                        const struct super_operations *ops,
+                                        const struct xattr_handler **xattr,
+                                        const struct dentry_operations *dops,
+                                        unsigned long);
+
+static inline struct dentry *
+mount_pseudo(struct file_system_type *fs_type, char *name,
+            const struct super_operations *ops,
+            const struct dentry_operations *dops, unsigned long magic)
+{
+       return mount_pseudo_xattr(fs_type, name, ops, NULL, dops, magic);
+}
 
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
 #define fops_get(fops) \
@@ -2494,11 +2499,6 @@ extern void make_bad_inode(struct inode *);
 extern bool is_bad_inode(struct inode *);
 
 #ifdef CONFIG_BLOCK
-static inline bool op_is_write(unsigned int op)
-{
-       return op == REQ_OP_READ ? false : true;
-}
-
 /*
  * return data direction, READ or WRITE
  */
@@ -2929,6 +2929,7 @@ extern int vfs_stat(const char __user *, struct kstat *);
 extern int vfs_lstat(const char __user *, struct kstat *);
 extern int vfs_fstat(unsigned int, struct kstat *);
 extern int vfs_fstatat(int , const char __user *, struct kstat *, int);
+extern const char *vfs_get_link(struct dentry *, struct delayed_call *);
 
 extern int __generic_block_fiemap(struct inode *inode,
                                  struct fiemap_extent_info *fieinfo,
@@ -2960,7 +2961,8 @@ extern int simple_open(struct inode *inode, struct file *file);
 extern int simple_link(struct dentry *, struct inode *, struct dentry *);
 extern int simple_unlink(struct inode *, struct dentry *);
 extern int simple_rmdir(struct inode *, struct dentry *);
-extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
+extern int simple_rename(struct inode *, struct dentry *,
+                        struct inode *, struct dentry *, unsigned int);
 extern int noop_fsync(struct file *, loff_t, loff_t, int);
 extern int simple_empty(struct dentry *);
 extern int simple_readpage(struct file *file, struct page *page);