Lines Matching full:provider

52 xhat_provider_register(xhat_provider_t *provider)  in xhat_provider_register()  argument
58 if (provider->xhat_provider_version != XHAT_PROVIDER_VERSION) { in xhat_provider_register()
59 cmn_err(CE_WARN, "XHAT provider version mismatch"); in xhat_provider_register()
63 if ((XHAT_POPS(provider)->xhat_alloc == NULL) || in xhat_provider_register()
64 (XHAT_POPS(provider)->xhat_free == NULL)) { in xhat_provider_register()
65 cmn_err(CE_WARN, "Malformed XHAT provider"); in xhat_provider_register()
70 provider->xblkcache->free_blks = NULL; in xhat_provider_register()
71 (void) strncpy(cache_name, provider->xhat_provider_name, in xhat_provider_register()
74 provider->xblkcache->cache = kmem_cache_create(cache_name, in xhat_provider_register()
75 provider->xhat_provider_blk_size, 0, NULL, NULL, in xhat_provider_register()
76 provider->xblkcache->reclaim, in xhat_provider_register()
77 (void *)provider, NULL, 0); in xhat_provider_register()
78 if (provider->xblkcache->cache == NULL) { in xhat_provider_register()
80 provider->xhat_provider_name); in xhat_provider_register()
84 mutex_init(&provider->xblkcache->lock, NULL, MUTEX_DEFAULT, NULL); in xhat_provider_register()
87 /* Insert provider in the global list */ in xhat_provider_register()
89 provider->next = xhat_provider; in xhat_provider_register()
90 provider->prev = NULL; in xhat_provider_register()
92 xhat_provider->prev = provider; in xhat_provider_register()
93 xhat_provider = provider; in xhat_provider_register()
102 xhat_provider_unregister(xhat_provider_t *provider) in xhat_provider_unregister() argument
104 if (provider->xhat_provider_version != XHAT_PROVIDER_VERSION) in xhat_provider_unregister()
109 if (provider->xhat_provider_refcnt) { in xhat_provider_unregister()
114 if (provider->next) in xhat_provider_unregister()
115 provider->next->prev = provider->prev; in xhat_provider_unregister()
116 if (provider->prev) in xhat_provider_unregister()
117 provider->prev->next = provider->next; in xhat_provider_unregister()
119 xhat_provider = provider->next; in xhat_provider_unregister()
120 provider->prev = NULL; in xhat_provider_unregister()
121 provider->next = NULL; in xhat_provider_unregister()
125 provider->xblkcache->reclaim(provider); in xhat_provider_unregister()
127 kmem_cache_destroy(provider->xblkcache->cache); in xhat_provider_unregister()
136 xhat_attach_xhat(xhat_provider_t *provider, struct as *as, in xhat_attach_xhat() argument
143 xh = XHAT_POPS(provider)->xhat_alloc(arg); in xhat_attach_xhat()
150 xh->xhat_provider = provider; in xhat_attach_xhat()
153 provider->xhat_provider_refcnt++; in xhat_attach_xhat()
161 XHAT_POPS(provider)->xhat_free(xh); in xhat_attach_xhat()
164 provider->xhat_provider_refcnt--; in xhat_attach_xhat()
186 xhat_detach_xhat(xhat_provider_t *provider, struct as *as) in xhat_detach_xhat() argument
194 if (xh->xhat_provider == provider) { in xhat_detach_xhat()
235 provider->xhat_provider_refcnt--; in xhat_detach_xhat()
246 XHAT_POPS(provider)->xhat_free(xh); in xhat_detach_xhat()