mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
xen: switch gnttab_end_foreign_access() to take a struct page pointer
Instead of a virtual kernel address use a pointer of the associated struct page as second parameter of gnttab_end_foreign_access(). Most users have that pointer available already and are creating the virtual address from it, risking problems in case the memory is located in highmem. gnttab_end_foreign_access() itself won't need to get the struct page from the address again. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
@@ -101,10 +101,10 @@ int gnttab_end_foreign_access_ref(grant_ref_t ref);
|
||||
* Eventually end access through the given grant reference, and once that
|
||||
* access has been ended, free the given page too. Access will be ended
|
||||
* immediately iff the grant entry is not in use, otherwise it will happen
|
||||
* some time later. page may be 0, in which case no freeing will occur.
|
||||
* some time later. page may be NULL, in which case no freeing will occur.
|
||||
* Note that the granted page might still be accessed (read or write) by the
|
||||
* other side after gnttab_end_foreign_access() returns, so even if page was
|
||||
* specified as 0 it is not allowed to just reuse the page for other
|
||||
* specified as NULL it is not allowed to just reuse the page for other
|
||||
* purposes immediately. gnttab_end_foreign_access() will take an additional
|
||||
* reference to the granted page in this case, which is dropped only after
|
||||
* the grant is no longer in use.
|
||||
@@ -112,7 +112,7 @@ int gnttab_end_foreign_access_ref(grant_ref_t ref);
|
||||
* gnttab_end_foreign_access() are done via alloc_pages_exact() (and freeing
|
||||
* via free_pages_exact()) in order to avoid high order pages.
|
||||
*/
|
||||
void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page);
|
||||
void gnttab_end_foreign_access(grant_ref_t ref, struct page *page);
|
||||
|
||||
/*
|
||||
* End access through the given grant reference, iff the grant entry is
|
||||
|
Reference in New Issue
Block a user