Lines Matching refs:watch

62 	struct xs_watch watch;  member
184 struct xs_dev_watch *watch; in xs_dev_find_watch() local
186 LIST_FOREACH(watch, &u->watches, list) in xs_dev_find_watch()
187 if (strcmp(watch->token, token) == 0) in xs_dev_find_watch()
188 return (watch); in xs_dev_find_watch()
194 xs_dev_watch_cb(struct xs_watch *watch, const char **vec, unsigned int len) in xs_dev_watch_cb() argument
200 dwatch = (struct xs_dev_watch *)watch->callback_data; in xs_dev_watch_cb()
262 struct xs_dev_watch *watch; in xs_dev_write() local
332 watch = malloc(sizeof(*watch), M_XENSTORE, M_WAITOK); in xs_dev_write()
333 watch->watch.node = strdup(wpath, M_XENSTORE); in xs_dev_write()
334 watch->watch.callback = xs_dev_watch_cb; in xs_dev_write()
335 watch->watch.callback_data = (uintptr_t)watch; in xs_dev_write()
336 watch->watch.max_pending = max_pending_watches; in xs_dev_write()
337 watch->token = strdup(wtoken, M_XENSTORE); in xs_dev_write()
338 watch->user = u; in xs_dev_write()
340 error = xs_register_watch(&watch->watch); in xs_dev_write()
342 free(watch->token, M_XENSTORE); in xs_dev_write()
343 free(watch->watch.node, M_XENSTORE); in xs_dev_write()
344 free(watch, M_XENSTORE); in xs_dev_write()
348 LIST_INSERT_HEAD(&u->watches, watch, list); in xs_dev_write()
360 watch = xs_dev_find_watch(u, wtoken); in xs_dev_write()
361 if (watch == NULL) { in xs_dev_write()
366 LIST_REMOVE(watch, list); in xs_dev_write()
367 xs_unregister_watch(&watch->watch); in xs_dev_write()
368 free(watch->watch.node, M_XENSTORE); in xs_dev_write()
369 free(watch->token, M_XENSTORE); in xs_dev_write()
370 free(watch, M_XENSTORE); in xs_dev_write()
421 struct xs_dev_watch *watch, *tmpw; in xs_dev_dtor() local
431 LIST_FOREACH_SAFE(watch, &u->watches, list, tmpw) { in xs_dev_dtor()
432 LIST_REMOVE(watch, list); in xs_dev_dtor()
433 xs_unregister_watch(&watch->watch); in xs_dev_dtor()
434 free(watch->watch.node, M_XENSTORE); in xs_dev_dtor()
435 free(watch->token, M_XENSTORE); in xs_dev_dtor()
436 free(watch, M_XENSTORE); in xs_dev_dtor()