/** * ttm_backup_handle_to_page_ptr() - Convert handle to struct page pointer * @handle: The handle to convert. * * Converts an opaque handle received from the * ttm_backup_backup_page() function to an (invalid) * struct page pointer suitable for a struct page array. * * Return: An (invalid) struct page pointer.
*/ staticinlinestruct page *
ttm_backup_handle_to_page_ptr(unsignedlong handle)
{ return (struct page *)(handle << 1 | 1);
}
/** * ttm_backup_page_ptr_is_handle() - Whether a struct page pointer is a handle * @page: The struct page pointer to check. * * Return: true if the struct page pointer is a handld returned from * ttm_backup_handle_to_page_ptr(). False otherwise.
*/ staticinlinebool ttm_backup_page_ptr_is_handle(conststruct page *page)
{ return (unsignedlong)page & 1;
}
/** * ttm_backup_page_ptr_to_handle() - Convert a struct page pointer to a handle * @page: The struct page pointer to convert * * Return: The handle that was previously used in * ttm_backup_handle_to_page_ptr() to obtain a struct page pointer, suitable * for use as argument in the struct ttm_backup_drop() or * ttm_backup_copy_page() functions.
*/ staticinlineunsignedlong
ttm_backup_page_ptr_to_handle(conststruct page *page)
{
WARN_ON(!ttm_backup_page_ptr_is_handle(page)); return (unsignedlong)page >> 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.