]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - ipc/shm.c
Merge tag 'mm-stable-2023-11-01-14-33' of git://git.kernel.org/pub/scm/linux/kernel...
[thirdparty/kernel/stable.git] / ipc / shm.c
index 576a543b7cfff9c09187d8605bd3f3086af2a458..222aaf035afb7a15e5bebd35f5fee555d9d7c23e 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -562,30 +562,25 @@ static unsigned long shm_pagesize(struct vm_area_struct *vma)
 }
 
 #ifdef CONFIG_NUMA
-static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
+static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol)
 {
-       struct file *file = vma->vm_file;
-       struct shm_file_data *sfd = shm_file_data(file);
+       struct shm_file_data *sfd = shm_file_data(vma->vm_file);
        int err = 0;
 
        if (sfd->vm_ops->set_policy)
-               err = sfd->vm_ops->set_policy(vma, new);
+               err = sfd->vm_ops->set_policy(vma, mpol);
        return err;
 }
 
 static struct mempolicy *shm_get_policy(struct vm_area_struct *vma,
-                                       unsigned long addr)
+                                       unsigned long addr, pgoff_t *ilx)
 {
-       struct file *file = vma->vm_file;
-       struct shm_file_data *sfd = shm_file_data(file);
-       struct mempolicy *pol = NULL;
+       struct shm_file_data *sfd = shm_file_data(vma->vm_file);
+       struct mempolicy *mpol = vma->vm_policy;
 
        if (sfd->vm_ops->get_policy)
-               pol = sfd->vm_ops->get_policy(vma, addr);
-       else if (vma->vm_policy)
-               pol = vma->vm_policy;
-
-       return pol;
+               mpol = sfd->vm_ops->get_policy(vma, addr, ilx);
+       return mpol;
 }
 #endif