summaryrefslogtreecommitdiff
path: root/drivers/xen/grant-table.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-03-11 11:34:29 +0100
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2022-03-15 20:34:40 -0500
commitc94b731da21f10086a9e52d63c21c730e3f6c939 (patch)
treedcb2adb8a3e725a1f715e59b8e9ed7041a145e6c /drivers/xen/grant-table.c
parentb0f212633b31ddca99c76aa38f812fe492e8410a (diff)
xen/grant-table: remove readonly parameter from functions
The gnttab_end_foreign_access() family of functions is taking a "readonly" parameter, which isn't used. Remove it from the function parameters. Signed-off-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20220311103429.12845-3-jgross@suse.com Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/grant-table.c')
-rw-r--r--drivers/xen/grant-table.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 8963af8ec764..8ccccace2a4f 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -118,13 +118,12 @@ struct gnttab_ops {
unsigned long frame, unsigned flags);
/*
* Stop granting a grant entry to domain for accessing. Ref parameter is
- * reference of a grant entry whose grant access will be stopped,
- * readonly is not in use in this function. If the grant entry is
- * currently mapped for reading or writing, just return failure(==0)
- * directly and don't tear down the grant access. Otherwise, stop grant
- * access for this entry and return success(==1).
+ * reference of a grant entry whose grant access will be stopped.
+ * If the grant entry is currently mapped for reading or writing, just
+ * return failure(==0) directly and don't tear down the grant access.
+ * Otherwise, stop grant access for this entry and return success(==1).
*/
- int (*end_foreign_access_ref)(grant_ref_t ref, int readonly);
+ int (*end_foreign_access_ref)(grant_ref_t ref);
/*
* Read the frame number related to a given grant reference.
*/
@@ -270,7 +269,7 @@ int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
}
EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
-static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly)
+static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref)
{
u16 flags, nflags;
u16 *pflags;
@@ -286,7 +285,7 @@ static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly)
return 1;
}
-static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref, int readonly)
+static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref)
{
gnttab_shared.v2[ref].hdr.flags = 0;
mb(); /* Concurrent access by hypervisor. */
@@ -309,14 +308,14 @@ static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref, int readonly)
return 1;
}
-static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly)
+static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref)
{
- return gnttab_interface->end_foreign_access_ref(ref, readonly);
+ return gnttab_interface->end_foreign_access_ref(ref);
}
-int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly)
+int gnttab_end_foreign_access_ref(grant_ref_t ref)
{
- if (_gnttab_end_foreign_access_ref(ref, readonly))
+ if (_gnttab_end_foreign_access_ref(ref))
return 1;
pr_warn("WARNING: g.e. %#x still in use!\n", ref);
return 0;
@@ -336,7 +335,6 @@ static unsigned long gnttab_read_frame_v2(grant_ref_t ref)
struct deferred_entry {
struct list_head list;
grant_ref_t ref;
- bool ro;
uint16_t warn_delay;
struct page *page;
};
@@ -360,7 +358,7 @@ static void gnttab_handle_deferred(struct timer_list *unused)
break;
list_del(&entry->list);
spin_unlock_irqrestore(&gnttab_list_lock, flags);
- if (_gnttab_end_foreign_access_ref(entry->ref, entry->ro)) {
+ if (_gnttab_end_foreign_access_ref(entry->ref)) {
put_free_entry(entry->ref);
pr_debug("freeing g.e. %#x (pfn %#lx)\n",
entry->ref, page_to_pfn(entry->page));
@@ -386,8 +384,7 @@ static void gnttab_handle_deferred(struct timer_list *unused)
spin_unlock_irqrestore(&gnttab_list_lock, flags);
}
-static void gnttab_add_deferred(grant_ref_t ref, bool readonly,
- struct page *page)
+static void gnttab_add_deferred(grant_ref_t ref, struct page *page)
{
struct deferred_entry *entry;
gfp_t gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
@@ -405,7 +402,6 @@ static void gnttab_add_deferred(grant_ref_t ref, bool readonly,
unsigned long flags;
entry->ref = ref;
- entry->ro = readonly;
entry->page = page;
entry->warn_delay = 60;
spin_lock_irqsave(&gnttab_list_lock, flags);
@@ -423,7 +419,7 @@ static void gnttab_add_deferred(grant_ref_t ref, bool readonly,
int gnttab_try_end_foreign_access(grant_ref_t ref)
{
- int ret = _gnttab_end_foreign_access_ref(ref, 0);
+ int ret = _gnttab_end_foreign_access_ref(ref);
if (ret)
put_free_entry(ref);
@@ -432,15 +428,13 @@ int gnttab_try_end_foreign_access(grant_ref_t ref)
}
EXPORT_SYMBOL_GPL(gnttab_try_end_foreign_access);
-void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
- unsigned long page)
+void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page)
{
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0)
put_page(virt_to_page(page));
} else
- gnttab_add_deferred(ref, readonly,
- page ? virt_to_page(page) : NULL);
+ gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL);
}
EXPORT_SYMBOL_GPL(gnttab_end_foreign_access);