You've already forked linux-apfs-rw
mirror of
https://github.com/linux-apfs/linux-apfs-rw.git
synced 2026-05-01 15:01:34 -07:00
Fix signature of ->page_mkwrite() for before 4.11
On ->page_mkwrite(), newer kernels need to retrieve the vm_area_struct pointer from the vm_fault. For older kernels this would not have been possible, and the vm_area_struct was passed as an argument instead. Use macros to get all versions to build. This problem was reported by Luflosi here: https://github.com/linux-apfs/linux-apfs-rw/issues/19#issuecomment-918033297 Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
This commit is contained in:
@@ -9,9 +9,14 @@
|
||||
typedef int vm_fault_t;
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
static vm_fault_t apfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
{
|
||||
#else
|
||||
static vm_fault_t apfs_page_mkwrite(struct vm_fault *vmf)
|
||||
{
|
||||
struct vm_area_struct *vma = vmf->vma;
|
||||
#endif
|
||||
struct page *page = vmf->page;
|
||||
struct inode *inode = file_inode(vmf->vma->vm_file);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
|
||||
Reference in New Issue
Block a user