From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 14 Apr 2006 14:05:04 +0000 (+0100) Subject: Introduce gnttab_empty_grant_references() to check whether grant X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16158^2~2^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eea1cdc7f43c1be8d0306d703fdace75796f7475;p=xen.git Introduce gnttab_empty_grant_references() to check whether grant references is empty. Signed-off-by: Isaku Yamahata --- diff --git a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c index 71da6c4df9..64e023d0a9 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c @@ -65,6 +65,7 @@ EXPORT_SYMBOL_GPL(gnttab_end_foreign_transfer); EXPORT_SYMBOL_GPL(gnttab_alloc_grant_references); EXPORT_SYMBOL_GPL(gnttab_free_grant_references); EXPORT_SYMBOL_GPL(gnttab_free_grant_reference); +EXPORT_SYMBOL_GPL(gnttab_empty_grant_references); EXPORT_SYMBOL_GPL(gnttab_claim_grant_reference); EXPORT_SYMBOL_GPL(gnttab_release_grant_reference); EXPORT_SYMBOL_GPL(gnttab_request_free_callback); @@ -324,6 +325,12 @@ gnttab_alloc_grant_references(u16 count, grant_ref_t *head) return 0; } +int +gnttab_empty_grant_references(const grant_ref_t *private_head) +{ + return (*private_head == GNTTAB_LIST_END); +} + int gnttab_claim_grant_reference(grant_ref_t *private_head) { diff --git a/linux-2.6-xen-sparse/include/xen/gnttab.h b/linux-2.6-xen-sparse/include/xen/gnttab.h index 4b759485de..8ff6e6b4c5 100644 --- a/linux-2.6-xen-sparse/include/xen/gnttab.h +++ b/linux-2.6-xen-sparse/include/xen/gnttab.h @@ -91,6 +91,8 @@ void gnttab_free_grant_reference(grant_ref_t ref); void gnttab_free_grant_references(grant_ref_t head); +int gnttab_empty_grant_references(const grant_ref_t *pprivate_head); + int gnttab_claim_grant_reference(grant_ref_t *pprivate_head); void gnttab_release_grant_reference(grant_ref_t *private_head,