diff options
| author | Christoph Hellwig <hch@lst.de> | 2015-01-14 04:42:32 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@fb.com> | 2015-01-20 16:02:58 -0500 |
| commit | b4caecd48005fbed3949dde6c1cb233142fd69e9 (patch) | |
| tree | 1fdd9b7c15568c79eb3c1ed84a39858ddbcbc88b /include/linux/fs.h | |
| parent | 97b713ba3ebaa6c8d84c2c720f5468a7c6a6eb4e (diff) | |
fs: introduce f_op->mmap_capabilities for nommu mmap support
Since "BDI: Provide backing device capability information [try #3]" the
backing_dev_info structure also provides flags for the kind of mmap
operation available in a nommu environment, which is entirely unrelated
to it's original purpose.
Introduce a new nommu-only file operation to provide this information to
the nommu mmap code instead. Splitting this from the backing_dev_info
structure allows to remove lots of backing_dev_info instance that aren't
otherwise needed, and entirely gets rid of the concept of providing a
backing_dev_info for a character device. It also removes the need for
the mtd_inodefs filesystem.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Tejun Heo <tj@kernel.org>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 42efe13077b6..1dada399aa23 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1502,6 +1502,26 @@ struct block_device_operations; | |||
| 1502 | #define HAVE_COMPAT_IOCTL 1 | 1502 | #define HAVE_COMPAT_IOCTL 1 |
| 1503 | #define HAVE_UNLOCKED_IOCTL 1 | 1503 | #define HAVE_UNLOCKED_IOCTL 1 |
| 1504 | 1504 | ||
| 1505 | /* | ||
| 1506 | * These flags let !MMU mmap() govern direct device mapping vs immediate | ||
| 1507 | * copying more easily for MAP_PRIVATE, especially for ROM filesystems. | ||
| 1508 | * | ||
| 1509 | * NOMMU_MAP_COPY: Copy can be mapped (MAP_PRIVATE) | ||
| 1510 | * NOMMU_MAP_DIRECT: Can be mapped directly (MAP_SHARED) | ||
| 1511 | * NOMMU_MAP_READ: Can be mapped for reading | ||
| 1512 | * NOMMU_MAP_WRITE: Can be mapped for writing | ||
| 1513 | * NOMMU_MAP_EXEC: Can be mapped for execution | ||
| 1514 | */ | ||
| 1515 | #define NOMMU_MAP_COPY 0x00000001 | ||
| 1516 | #define NOMMU_MAP_DIRECT 0x00000008 | ||
| 1517 | #define NOMMU_MAP_READ VM_MAYREAD | ||
| 1518 | #define NOMMU_MAP_WRITE VM_MAYWRITE | ||
| 1519 | #define NOMMU_MAP_EXEC VM_MAYEXEC | ||
| 1520 | |||
| 1521 | #define NOMMU_VMFLAGS \ | ||
| 1522 | (NOMMU_MAP_READ | NOMMU_MAP_WRITE | NOMMU_MAP_EXEC) | ||
| 1523 | |||
| 1524 | |||
| 1505 | struct iov_iter; | 1525 | struct iov_iter; |
| 1506 | 1526 | ||
| 1507 | struct file_operations { | 1527 | struct file_operations { |
| @@ -1536,6 +1556,9 @@ struct file_operations { | |||
| 1536 | long (*fallocate)(struct file *file, int mode, loff_t offset, | 1556 | long (*fallocate)(struct file *file, int mode, loff_t offset, |
| 1537 | loff_t len); | 1557 | loff_t len); |
| 1538 | void (*show_fdinfo)(struct seq_file *m, struct file *f); | 1558 | void (*show_fdinfo)(struct seq_file *m, struct file *f); |
| 1559 | #ifndef CONFIG_MMU | ||
| 1560 | unsigned (*mmap_capabilities)(struct file *); | ||
| 1561 | #endif | ||
| 1539 | }; | 1562 | }; |
| 1540 | 1563 | ||
| 1541 | struct inode_operations { | 1564 | struct inode_operations { |
