]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - include/linux/fs.h
fs: remove mapping->backing_dev_info
[mirror_ubuntu-jammy-kernel.git] / include / linux / fs.h
index f90c0282c11493f94a84095f61db94ac90974cc4..65d02de342e129a401ca92283ac74685e616387c 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/byteorder.h>
 #include <uapi/linux/fs.h>
 
+struct backing_dev_info;
 struct export_operations;
 struct hd_geometry;
 struct iovec;
@@ -135,7 +136,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 #define FMODE_CAN_WRITE         ((__force fmode_t)0x40000)
 
 /* File was opened by fanotify and shouldn't generate fanotify events */
-#define FMODE_NONOTIFY         ((__force fmode_t)0x1000000)
+#define FMODE_NONOTIFY         ((__force fmode_t)0x4000000)
 
 /*
  * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
@@ -394,7 +395,6 @@ int pagecache_write_end(struct file *, struct address_space *mapping,
                                loff_t pos, unsigned len, unsigned copied,
                                struct page *page, void *fsdata);
 
-struct backing_dev_info;
 struct address_space {
        struct inode            *host;          /* owner: inode, block_device */
        struct radix_tree_root  page_tree;      /* radix tree of all pages */
@@ -409,7 +409,6 @@ struct address_space {
        pgoff_t                 writeback_index;/* writeback starts here */
        const struct address_space_operations *a_ops;   /* methods */
        unsigned long           flags;          /* error bits/gfp mask */
-       struct backing_dev_info *backing_dev_info; /* device readahead, etc */
        spinlock_t              private_lock;   /* for use by the address_space */
        struct list_head        private_list;   /* ditto */
        void                    *private_data;  /* ditto */
@@ -1502,6 +1501,26 @@ struct block_device_operations;
 #define HAVE_COMPAT_IOCTL 1
 #define HAVE_UNLOCKED_IOCTL 1
 
+/*
+ * These flags let !MMU mmap() govern direct device mapping vs immediate
+ * copying more easily for MAP_PRIVATE, especially for ROM filesystems.
+ *
+ * NOMMU_MAP_COPY:     Copy can be mapped (MAP_PRIVATE)
+ * NOMMU_MAP_DIRECT:   Can be mapped directly (MAP_SHARED)
+ * NOMMU_MAP_READ:     Can be mapped for reading
+ * NOMMU_MAP_WRITE:    Can be mapped for writing
+ * NOMMU_MAP_EXEC:     Can be mapped for execution
+ */
+#define NOMMU_MAP_COPY         0x00000001
+#define NOMMU_MAP_DIRECT       0x00000008
+#define NOMMU_MAP_READ         VM_MAYREAD
+#define NOMMU_MAP_WRITE                VM_MAYWRITE
+#define NOMMU_MAP_EXEC         VM_MAYEXEC
+
+#define NOMMU_VMFLAGS \
+       (NOMMU_MAP_READ | NOMMU_MAP_WRITE | NOMMU_MAP_EXEC)
+
+
 struct iov_iter;
 
 struct file_operations {
@@ -1536,6 +1555,9 @@ struct file_operations {
        long (*fallocate)(struct file *file, int mode, loff_t offset,
                          loff_t len);
        void (*show_fdinfo)(struct seq_file *m, struct file *f);
+#ifndef CONFIG_MMU
+       unsigned (*mmap_capabilities)(struct file *);
+#endif
 };
 
 struct inode_operations {