On Wed, 2011-12-07 at 03:36 +0000, ANNIE LI wrote:OK, I can delete those.Thanks for your reviewing, Ian.Looks to be along the right lines. Thanks.OK, the initial interface is without v2 suffixes. It was added in orderEXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);Please drop the v2 suffixes on the public functions.
+int gnttab_grant_foreign_access_subpage_v2(domid_t domid, unsigned long frame,
+ int flags, unsigned page_off,
+ unsigned length)
to reminder user the interfaces are only available for grant table v2.
But I am fine to remove it, and following ops fn pointers are better.
Any reason not to route these via the ops table for consistency with allOk, it is good.
the other ops? Then your availability check becomes a test for NULL fn
pointer rather than a specific version.
How about following implements?
gnttab_v1_ops = {I think you can omit these since NULL is the default but perhaps
...
.access_subpage = NULL;
.access_ref_subpage = NULL;
.access_trans = NULL;
.access_ref_trans = NULL;
}
explicitly listing them is useful in a self documenting type way.
[...]
Thanks for pointing out this.Same operations for access_ref_subpage, access_trans and access_ref_trans.Typo: ..trans..
bool gnttab_subpage_available()
{
return (gnttab_interface->access_subpage != NULL);
}
bool gnttab_subpage_available()
--{Ian.
return (gnttab_interface->access_trans != NULL);
}
Thanks
Annie