mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-15 23:41:35 -04:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
c719547f03
commit
08232a4544
@@ -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) */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user