diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index e49f10cc8a73..ed5a0900b94d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -51,6 +51,7 @@ struct swap_info_struct; | |||
51 | struct seq_file; | 51 | struct seq_file; |
52 | struct workqueue_struct; | 52 | struct workqueue_struct; |
53 | struct iov_iter; | 53 | struct iov_iter; |
54 | struct vm_fault; | ||
54 | 55 | ||
55 | extern void __init inode_init(void); | 56 | extern void __init inode_init(void); |
56 | extern void __init inode_init_early(void); | 57 | extern void __init inode_init_early(void); |
@@ -361,8 +362,6 @@ struct address_space_operations { | |||
361 | int (*releasepage) (struct page *, gfp_t); | 362 | int (*releasepage) (struct page *, gfp_t); |
362 | void (*freepage)(struct page *); | 363 | void (*freepage)(struct page *); |
363 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); | 364 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); |
364 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | ||
365 | void **, unsigned long *); | ||
366 | /* | 365 | /* |
367 | * migrate the contents of a page to the specified target. If | 366 | * migrate the contents of a page to the specified target. If |
368 | * migrate_mode is MIGRATE_ASYNC, it must not block. | 367 | * migrate_mode is MIGRATE_ASYNC, it must not block. |
@@ -1677,6 +1676,11 @@ struct super_operations { | |||
1677 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | 1676 | #define S_IMA 1024 /* Inode has an associated IMA struct */ |
1678 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | 1677 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ |
1679 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ | 1678 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ |
1679 | #ifdef CONFIG_FS_DAX | ||
1680 | #define S_DAX 8192 /* Direct Access, avoiding the page cache */ | ||
1681 | #else | ||
1682 | #define S_DAX 0 /* Make all the DAX code disappear */ | ||
1683 | #endif | ||
1680 | 1684 | ||
1681 | /* | 1685 | /* |
1682 | * Note that nosuid etc flags are inode-specific: setting some file-system | 1686 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -1714,6 +1718,7 @@ struct super_operations { | |||
1714 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | 1718 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) |
1715 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | 1719 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) |
1716 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | 1720 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) |
1721 | #define IS_DAX(inode) ((inode)->i_flags & S_DAX) | ||
1717 | 1722 | ||
1718 | #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ | 1723 | #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ |
1719 | (inode)->i_rdev == WHITEOUT_DEV) | 1724 | (inode)->i_rdev == WHITEOUT_DEV) |
@@ -2581,19 +2586,13 @@ extern loff_t fixed_size_llseek(struct file *file, loff_t offset, | |||
2581 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2586 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2582 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2587 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2583 | 2588 | ||
2584 | #ifdef CONFIG_FS_XIP | 2589 | ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *, |
2585 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, | 2590 | loff_t, get_block_t, dio_iodone_t, int flags); |
2586 | loff_t *ppos); | 2591 | int dax_clear_blocks(struct inode *, sector_t block, long size); |
2587 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); | 2592 | int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); |
2588 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, | 2593 | int dax_truncate_page(struct inode *, loff_t from, get_block_t); |
2589 | size_t len, loff_t *ppos); | 2594 | int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t); |
2590 | extern int xip_truncate_page(struct address_space *mapping, loff_t from); | 2595 | #define dax_mkwrite(vma, vmf, gb) dax_fault(vma, vmf, gb) |
2591 | #else | ||
2592 | static inline int xip_truncate_page(struct address_space *mapping, loff_t from) | ||
2593 | { | ||
2594 | return 0; | ||
2595 | } | ||
2596 | #endif | ||
2597 | 2596 | ||
2598 | #ifdef CONFIG_BLOCK | 2597 | #ifdef CONFIG_BLOCK |
2599 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, | 2598 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, |
@@ -2750,6 +2749,11 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root); | |||
2750 | extern void save_mount_options(struct super_block *sb, char *options); | 2749 | extern void save_mount_options(struct super_block *sb, char *options); |
2751 | extern void replace_mount_options(struct super_block *sb, char *options); | 2750 | extern void replace_mount_options(struct super_block *sb, char *options); |
2752 | 2751 | ||
2752 | static inline bool io_is_direct(struct file *filp) | ||
2753 | { | ||
2754 | return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp)); | ||
2755 | } | ||
2756 | |||
2753 | static inline ino_t parent_ino(struct dentry *dentry) | 2757 | static inline ino_t parent_ino(struct dentry *dentry) |
2754 | { | 2758 | { |
2755 | ino_t res; | 2759 | ino_t res; |