diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -310,4 +310,6 @@ #define PAGE_ALIGNED(p) __is_aligned(p, PAGE_SIZE) +void vma_set_file(struct vm_area_struct *vma, struct linux_file *file); + #endif /* _LINUXKPI_LINUX_MM_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -833,6 +833,18 @@ return (0); } +void +vma_set_file(struct vm_area_struct *vma, struct linux_file *file) +{ + struct linux_file *tmp; + + /* Changing an anonymous vma with this is illegal */ + get_file(file); + tmp = vma->vm_file; + vma->vm_file = file; + fput(tmp); +} + static struct file_operations dummy_ldev_ops = { /* XXXKIB */ };