Skip to content

Commit 1dbd11c

Browse files
committed
xen: remove gnttab_query_foreign_access()
Remove gnttab_query_foreign_access(), as it is unused and unsafe to use. All previous use cases assumed a grant would not be in use after gnttab_query_foreign_access() returned 0. This information is useless in best case, as it only refers to a situation in the past, which could have changed already. Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Jan Beulich <[email protected]>
1 parent d3b6372 commit 1dbd11c

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

drivers/xen/grant-table.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ struct gnttab_ops {
133133
* return the frame.
134134
*/
135135
unsigned long (*end_foreign_transfer_ref)(grant_ref_t ref);
136-
/*
137-
* Query the status of a grant entry. Ref parameter is reference of
138-
* queried grant entry, return value is the status of queried entry.
139-
* Detailed status(writing/reading) can be gotten from the return value
140-
* by bit operations.
141-
*/
142-
int (*query_foreign_access)(grant_ref_t ref);
143136
};
144137

145138
struct unmap_refs_callback_data {
@@ -284,22 +277,6 @@ int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
284277
}
285278
EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
286279

287-
static int gnttab_query_foreign_access_v1(grant_ref_t ref)
288-
{
289-
return gnttab_shared.v1[ref].flags & (GTF_reading|GTF_writing);
290-
}
291-
292-
static int gnttab_query_foreign_access_v2(grant_ref_t ref)
293-
{
294-
return grstatus[ref] & (GTF_reading|GTF_writing);
295-
}
296-
297-
int gnttab_query_foreign_access(grant_ref_t ref)
298-
{
299-
return gnttab_interface->query_foreign_access(ref);
300-
}
301-
EXPORT_SYMBOL_GPL(gnttab_query_foreign_access);
302-
303280
static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly)
304281
{
305282
u16 flags, nflags;
@@ -1427,7 +1404,6 @@ static const struct gnttab_ops gnttab_v1_ops = {
14271404
.update_entry = gnttab_update_entry_v1,
14281405
.end_foreign_access_ref = gnttab_end_foreign_access_ref_v1,
14291406
.end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v1,
1430-
.query_foreign_access = gnttab_query_foreign_access_v1,
14311407
};
14321408

14331409
static const struct gnttab_ops gnttab_v2_ops = {
@@ -1439,7 +1415,6 @@ static const struct gnttab_ops gnttab_v2_ops = {
14391415
.update_entry = gnttab_update_entry_v2,
14401416
.end_foreign_access_ref = gnttab_end_foreign_access_ref_v2,
14411417
.end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v2,
1442-
.query_foreign_access = gnttab_query_foreign_access_v2,
14431418
};
14441419

14451420
static bool gnttab_need_v2(void)

include/xen/grant_table.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ int gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn);
125125
unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref);
126126
unsigned long gnttab_end_foreign_transfer(grant_ref_t ref);
127127

128-
int gnttab_query_foreign_access(grant_ref_t ref);
129-
130128
/*
131129
* operations on reserved batches of grant references
132130
*/

0 commit comments

Comments
 (0)