It is cleaner to use the uffd_info struct.
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
int (*zeropage)(struct uffd_info *info);
int (*cont)(struct vm_area_struct *dst_vma, unsigned long dst_addr,
bool wp, unsigned long increment);
- int (*poison)(struct vm_area_struct *dst_vma,
- unsigned long dst_addr, unsigned long increment);
-
+ int (*poison)(struct uffd_info *info);
/* Required features below */
ssize_t (*is_dst_valid)(struct vm_area_struct *dst_vma,
unsigned long dst_start, unsigned long len);
{
return PAGE_SIZE;
}
-int mfill_atomic_pte_poison(struct vm_area_struct *dst_vma,
- unsigned long dst_addr, unsigned long increment);
-
+int mfill_atomic_pte_poison(struct uffd_info *info);
int mfill_atomic_pte_continue(struct vm_area_struct *dst_vma,
unsigned long dst_addr, bool wp,
unsigned long increment);
return copy_folio_from_user(folio,(const void __user *)src_addr, true);
}
-static int hugetlb_mfill_pte_poison(struct vm_area_struct *dst_vma,
- unsigned long dst_addr, unsigned long increment);
-
+static int hugetlb_mfill_pte_poison(struct uffd_info *info);
static int hugetlb_mfill_pte_continue(struct vm_area_struct *dst_vma,
unsigned long dst_addr, bool wp_enabled,
unsigned long increment);
return 0;
}
-static int hugetlb_mfill_pte_poison(struct vm_area_struct *dst_vma,
- unsigned long dst_addr, unsigned long increment)
+static int hugetlb_mfill_pte_poison(struct uffd_info *info)
{
+ struct vm_area_struct *dst_vma = info->dst_vma;
+ unsigned long dst_addr = info->dst_addr;
struct mm_struct *dst_mm = dst_vma->vm_mm;
struct hstate *h = hstate_vma(dst_vma);
unsigned long size = huge_page_size(h);
int ret;
u32 hash;
- ret = hugetlb_mfill_prepare(dst_vma, dst_addr, increment,
+ ret = hugetlb_mfill_prepare(dst_vma, dst_addr, info->increment,
&dst_pte, &hash,
0 /* Not a continue, no one cares. */);
if (ret)
}
/* Handles UFFDIO_POISON for all non-hugetlb VMAs. */
-int mfill_atomic_pte_poison(struct vm_area_struct *dst_vma,
- unsigned long dst_addr, unsigned long increment)
+int mfill_atomic_pte_poison(struct uffd_info *info)
{
int ret;
+ struct vm_area_struct *dst_vma = info->dst_vma;
struct mm_struct *dst_mm = dst_vma->vm_mm;
+ unsigned long dst_addr = info->dst_addr;
pmd_t *dst_pmd;
pte_t _dst_pte, *dst_pte;
spinlock_t *ptl;
* tables under us; pte_offset_map_lock() will deal with that.
*/
if (uffd_flags_mode_is(flags, MFILL_ATOMIC_POISON)) {
- err = info.uffd_ops->poison(dst_vma, info.dst_addr,
- increment);
+ err = info.uffd_ops->poison(&info);
} else if (uffd_flags_mode_is(flags, MFILL_ATOMIC_CONTINUE)) {
err = info.uffd_ops->cont(dst_vma, info.dst_addr,
flags & MFILL_ATOMIC_WP,