Lines Matching refs:driver

22 	struct zpool_driver *driver;  member
33 void zpool_register_driver(struct zpool_driver *driver) in zpool_register_driver() argument
36 atomic_set(&driver->refcount, 0); in zpool_register_driver()
37 list_add(&driver->list, &drivers_head); in zpool_register_driver()
52 int zpool_unregister_driver(struct zpool_driver *driver) in zpool_unregister_driver() argument
57 refcount = atomic_read(&driver->refcount); in zpool_unregister_driver()
62 list_del(&driver->list); in zpool_unregister_driver()
72 struct zpool_driver *driver; in zpool_get_driver() local
75 list_for_each_entry(driver, &drivers_head, list) { in zpool_get_driver()
76 if (!strcmp(driver->type, type)) { in zpool_get_driver()
77 bool got = try_module_get(driver->owner); in zpool_get_driver()
80 atomic_inc(&driver->refcount); in zpool_get_driver()
82 return got ? driver : NULL; in zpool_get_driver()
90 static void zpool_put_driver(struct zpool_driver *driver) in zpool_put_driver() argument
92 atomic_dec(&driver->refcount); in zpool_put_driver()
93 module_put(driver->owner); in zpool_put_driver()
116 struct zpool_driver *driver = zpool_get_driver(type); in zpool_has_pool() local
118 if (!driver) { in zpool_has_pool()
120 driver = zpool_get_driver(type); in zpool_has_pool()
123 if (!driver) in zpool_has_pool()
126 zpool_put_driver(driver); in zpool_has_pool()
149 struct zpool_driver *driver; in zpool_create_pool() local
154 driver = zpool_get_driver(type); in zpool_create_pool()
156 if (!driver) { in zpool_create_pool()
158 driver = zpool_get_driver(type); in zpool_create_pool()
161 if (!driver) { in zpool_create_pool()
169 zpool_put_driver(driver); in zpool_create_pool()
173 zpool->driver = driver; in zpool_create_pool()
174 zpool->pool = driver->create(name, gfp); in zpool_create_pool()
178 zpool_put_driver(driver); in zpool_create_pool()
201 pr_debug("destroying pool type %s\n", zpool->driver->type); in zpool_destroy_pool()
203 zpool->driver->destroy(zpool->pool); in zpool_destroy_pool()
204 zpool_put_driver(zpool->driver); in zpool_destroy_pool()
220 return zpool->driver->type; in zpool_get_type()
236 return zpool->driver->malloc_support_movable; in zpool_malloc_support_movable()
258 return zpool->driver->malloc(zpool->pool, size, gfp, handle); in zpool_malloc()
277 zpool->driver->free(zpool->pool, handle); in zpool_free()
305 return zpool->driver->map(zpool->pool, handle, mapmode); in zpool_map_handle()
320 zpool->driver->unmap(zpool->pool, handle); in zpool_unmap_handle()
333 return zpool->driver->total_size(zpool->pool); in zpool_get_total_size()
351 return zpool->driver->sleep_mapped; in zpool_can_sleep_mapped()