diff options
author | Jérôme Glisse <jglisse@redhat.com> | 2018-04-10 16:28:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 10:28:30 -0700 |
commit | 08232a4544cc6befaabfbec2087bedaf21b0da34 (patch) | |
tree | b762521d83a79209a997e9709f1de9d6228c34bb /include | |
parent | c719547f032d4610c7a20900baacae26d0b1ff3e (diff) |
mm/hmm: use struct for hmm_vma_fault(), hmm_vma_get_pfns() parameters
Both hmm_vma_fault() and hmm_vma_get_pfns() were taking a hmm_range struct
as parameter and were initializing that struct with others of their
parameters. Have caller of those function do this as they are likely to
already do and only pass this struct to both function this shorten
function signature and make it easier in the future to add new parameters
by simply adding them to the structure.
Link: http://lkml.kernel.org/r/20180323005527.758-7-jglisse@redhat.com
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Cc: Evgeny Baskakov <ebaskakov@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Mark Hairgrove <mhairgrove@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hmm.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/linux/hmm.h b/include/linux/hmm.h index fa7b51f65905..d0d6760cdada 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -274,6 +274,7 @@ void hmm_mirror_unregister(struct hmm_mirror *mirror); /* * struct hmm_range - track invalidation lock on virtual address range * + * @vma: the vm area struct for the range * @list: all range lock are on a list * @start: range virtual start address (inclusive) * @end: range virtual end address (exclusive) @@ -281,6 +282,7 @@ void hmm_mirror_unregister(struct hmm_mirror *mirror); * @valid: pfns array did not change since it has been fill by an HMM function */ struct hmm_range { + struct vm_area_struct *vma; struct list_head list; unsigned long start; unsigned long end; @@ -301,12 +303,8 @@ struct hmm_range { * * IF YOU DO NOT FOLLOW THE ABOVE RULE THE SNAPSHOT CONTENT MIGHT BE INVALID ! */ -int hmm_vma_get_pfns(struct vm_area_struct *vma, - struct hmm_range *range, - unsigned long start, - unsigned long end, - hmm_pfn_t *pfns); -bool hmm_vma_range_done(struct vm_area_struct *vma, struct hmm_range *range); +int hmm_vma_get_pfns(struct hmm_range *range); +bool hmm_vma_range_done(struct hmm_range *range); /* @@ -327,13 +325,7 @@ bool hmm_vma_range_done(struct vm_area_struct *vma, struct hmm_range *range); * * See the function description in mm/hmm.c for further documentation. */ -int hmm_vma_fault(struct vm_area_struct *vma, - struct hmm_range *range, - unsigned long start, - unsigned long end, - hmm_pfn_t *pfns, - bool write, - bool block); +int hmm_vma_fault(struct hmm_range *range, bool write, bool block); #endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */ |