From: Thomas Hellstrom (VMware) Date: Tue, 24 Mar 2020 17:46:48 +0000 (+0100) Subject: fs: Constify vma argument to vma_is_dax X-Git-Tag: v5.7-rc1~87^2^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f05a3849f6449f67843113778bf56e02f2b4ddf8;p=thirdparty%2Fkernel%2Flinux.git fs: Constify vma argument to vma_is_dax The function is used by upcoming vma_is_special_huge() with which we want to use a const vma argument. Since for vma_is_dax() the vma argument is only dereferenced for reading, constify it. Cc: Andrew Morton Cc: Michal Hocko Cc: "Matthew Wilcox (Oracle)" Cc: "Kirill A. Shutemov" Cc: Ralph Campbell Cc: "Jérôme Glisse" Cc: "Christian König" Cc: Dan Williams Signed-off-by: Thomas Hellstrom (VMware) Reviewed-by: Roland Scheidegger Acked-by: Christian König --- diff --git a/include/linux/fs.h b/include/linux/fs.h index 3cd4fe6b845e7..2b38ce5b73adf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3391,7 +3391,7 @@ 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) +static inline bool vma_is_dax(const struct vm_area_struct *vma) { return vma->vm_file && IS_DAX(vma->vm_file->f_mapping->host); }