Commit 7e4b4dfc authored by Dave Airlie's avatar Dave Airlie

Revert "mm: adjust apply_to_pfn_range interface for dropped token."

This reverts commit 6dfc43d3.

Going to revert the whole vmwwgfx pull.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6dfc43d3
...@@ -2687,7 +2687,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, ...@@ -2687,7 +2687,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
unsigned long size, pte_fn_t fn, void *data); unsigned long size, pte_fn_t fn, void *data);
struct pfn_range_apply; struct pfn_range_apply;
typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr, typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
struct pfn_range_apply *closure); struct pfn_range_apply *closure);
struct pfn_range_apply { struct pfn_range_apply {
struct mm_struct *mm; struct mm_struct *mm;
......
...@@ -26,6 +26,7 @@ struct apply_as { ...@@ -26,6 +26,7 @@ struct apply_as {
/** /**
* apply_pt_wrprotect - Leaf pte callback to write-protect a pte * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
* @pte: Pointer to the pte * @pte: Pointer to the pte
* @token: Page table token, see apply_to_pfn_range()
* @addr: The virtual page address * @addr: The virtual page address
* @closure: Pointer to a struct pfn_range_apply embedded in a * @closure: Pointer to a struct pfn_range_apply embedded in a
* struct apply_as * struct apply_as
...@@ -35,7 +36,7 @@ struct apply_as { ...@@ -35,7 +36,7 @@ struct apply_as {
* *
* Return: Always zero. * Return: Always zero.
*/ */
static int apply_pt_wrprotect(pte_t *pte, static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
unsigned long addr, unsigned long addr,
struct pfn_range_apply *closure) struct pfn_range_apply *closure)
{ {
...@@ -77,6 +78,7 @@ struct apply_as_clean { ...@@ -77,6 +78,7 @@ struct apply_as_clean {
/** /**
* apply_pt_clean - Leaf pte callback to clean a pte * apply_pt_clean - Leaf pte callback to clean a pte
* @pte: Pointer to the pte * @pte: Pointer to the pte
* @token: Page table token, see apply_to_pfn_range()
* @addr: The virtual page address * @addr: The virtual page address
* @closure: Pointer to a struct pfn_range_apply embedded in a * @closure: Pointer to a struct pfn_range_apply embedded in a
* struct apply_as_clean * struct apply_as_clean
...@@ -89,7 +91,7 @@ struct apply_as_clean { ...@@ -89,7 +91,7 @@ struct apply_as_clean {
* *
* Return: Always zero. * Return: Always zero.
*/ */
static int apply_pt_clean(pte_t *pte, static int apply_pt_clean(pte_t *pte, pgtable_t token,
unsigned long addr, unsigned long addr,
struct pfn_range_apply *closure) struct pfn_range_apply *closure)
{ {
......
...@@ -2053,7 +2053,7 @@ static int apply_to_pte_range(struct pfn_range_apply *closure, pmd_t *pmd, ...@@ -2053,7 +2053,7 @@ static int apply_to_pte_range(struct pfn_range_apply *closure, pmd_t *pmd,
token = pmd_pgtable(*pmd); token = pmd_pgtable(*pmd);
do { do {
err = closure->ptefn(pte++, addr, closure); err = closure->ptefn(pte++, token, addr, closure);
if (err) if (err)
break; break;
} while (addr += PAGE_SIZE, addr != end); } while (addr += PAGE_SIZE, addr != end);
...@@ -2194,14 +2194,14 @@ struct page_range_apply { ...@@ -2194,14 +2194,14 @@ struct page_range_apply {
* Callback wrapper to enable use of apply_to_pfn_range for * Callback wrapper to enable use of apply_to_pfn_range for
* the apply_to_page_range interface * the apply_to_page_range interface
*/ */
static int apply_to_page_range_wrapper(pte_t *pte, static int apply_to_page_range_wrapper(pte_t *pte, pgtable_t token,
unsigned long addr, unsigned long addr,
struct pfn_range_apply *pter) struct pfn_range_apply *pter)
{ {
struct page_range_apply *pra = struct page_range_apply *pra =
container_of(pter, typeof(*pra), pter); container_of(pter, typeof(*pra), pter);
return pra->fn(pte, NULL, addr, pra->data); return pra->fn(pte, token, addr, pra->data);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment