diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2018-06-08 10:09:28 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 10:09:28 -0300 |
commit | 5b5a04065fb5487303869fd6080c30f86530005d (patch) | |
tree | d1442504baf73be22d9e6bc1864206df5ccedfeb /include/linux/fs.h | |
parent | 0e674a64b86e2bb00ab43f56104d3ea85dda0066 (diff) | |
parent | 8d99753ad93af6bcaf798232eeb15e60bdd7e94b (diff) |
Merge pull request #25 from MaxKrummenacher/4.9-1.0.x-imx-stable-merge
4.9 1.0.x imx stable merge
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index d705ae084edd..18552189560b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -18,6 +18,7 @@ #include <linux/bug.h> #include <linux/mutex.h> #include <linux/rwsem.h> +#include <linux/mm_types.h> #include <linux/capability.h> #include <linux/semaphore.h> #include <linux/fiemap.h> @@ -3033,6 +3034,25 @@ static inline bool io_is_direct(struct file *filp) return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host); } +static inline bool vma_is_dax(struct vm_area_struct *vma) +{ + return vma->vm_file && IS_DAX(vma->vm_file->f_mapping->host); +} + +static inline bool vma_is_fsdax(struct vm_area_struct *vma) +{ + struct inode *inode; + + if (!vma->vm_file) + return false; + if (!vma_is_dax(vma)) + return false; + inode = file_inode(vma->vm_file); + if (S_ISCHR(inode->i_mode)) + return false; /* device-dax */ + return true; +} + static inline int iocb_flags(struct file *file) { int res = 0; |