> In subsequent commits we are going to determine KSM eligibility prior to a > VMA being constructed, at which point we will of course not yet have access > to a VMA pointer. > > It is trivial to boil down the check logic to be parameterised on > mm_struct, file and VMA flags, so do so. > > As a part of this change, additionally expose and use file_is_dax() to > determine whether a file is being mapped under a DAX inode. > > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> > Acked-by: David Hildenbrand <david@xxxxxxxxxx> > Reviewed-by: Chengming Zhou <chengming.zhou@xxxxxxxxx> > --- > include/linux/fs.h | 7 ++++++- > mm/ksm.c | 32 ++++++++++++++++++++------------ > 2 files changed, 26 insertions(+), 13 deletions(-) All looks good to me. Reviewed-by: Xu Xin <xu.xin16@xxxxxxxxxx>