- struct portals_handle *h = RCU2HANDLE(rcu);
- if (h->h_free_cb) {
- h->h_free_cb(h->h_ptr, h->h_size);
- } else {
- void *ptr = h->h_ptr;
- unsigned int size = h->h_size;
- OBD_FREE(ptr, size);
- }
+ struct portals_handle *h = RCU2HANDLE(rcu);
+ void *ptr = (void *)(unsigned long)h->h_cookie;
+
+ if (h->h_ops->hop_free != NULL)
+ h->h_ops->hop_free(ptr, h->h_size);
+ else
+ OBD_FREE(ptr, h->h_size);