Lines Matching refs:watch

228 	struct xenbus_watch watch;  member
233 static void free_watch_adapter(struct watch_adapter *watch) in free_watch_adapter() argument
235 kfree(watch->watch.node); in free_watch_adapter()
236 kfree(watch->token); in free_watch_adapter()
237 kfree(watch); in free_watch_adapter()
243 struct watch_adapter *watch; in alloc_watch_adapter() local
245 watch = kzalloc(sizeof(*watch), GFP_KERNEL); in alloc_watch_adapter()
246 if (watch == NULL) in alloc_watch_adapter()
249 watch->watch.node = kstrdup(path, GFP_KERNEL); in alloc_watch_adapter()
250 if (watch->watch.node == NULL) in alloc_watch_adapter()
253 watch->token = kstrdup(token, GFP_KERNEL); in alloc_watch_adapter()
254 if (watch->token == NULL) in alloc_watch_adapter()
257 return watch; in alloc_watch_adapter()
260 free_watch_adapter(watch); in alloc_watch_adapter()
266 static void watch_fired(struct xenbus_watch *watch, in watch_fired() argument
277 adap = container_of(watch, struct watch_adapter, watch); in watch_fired()
310 struct watch_adapter *watch, *tmp_watch; in xenbus_worker() local
326 list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) { in xenbus_worker()
327 unregister_xenbus_watch(&watch->watch); in xenbus_worker()
328 list_del(&watch->list); in xenbus_worker()
329 free_watch_adapter(watch); in xenbus_worker()
498 struct watch_adapter *watch; in xenbus_write_watch() local
515 watch = alloc_watch_adapter(path, token); in xenbus_write_watch()
516 if (watch == NULL) { in xenbus_write_watch()
521 watch->watch.callback = watch_fired; in xenbus_write_watch()
522 watch->dev_data = u; in xenbus_write_watch()
524 err = register_xenbus_watch(&watch->watch); in xenbus_write_watch()
526 free_watch_adapter(watch); in xenbus_write_watch()
530 list_add(&watch->list, &u->watches); in xenbus_write_watch()
532 list_for_each_entry(watch, &u->watches, list) { in xenbus_write_watch()
533 if (!strcmp(watch->token, token) && in xenbus_write_watch()
534 !strcmp(watch->watch.node, path)) { in xenbus_write_watch()
535 unregister_xenbus_watch(&watch->watch); in xenbus_write_watch()
536 list_del(&watch->list); in xenbus_write_watch()
537 free_watch_adapter(watch); in xenbus_write_watch()