• Home
  • Raw
  • Download

Lines Matching refs:u

103 	} u;  member
117 struct xenbus_file_priv *u = filp->private_data; in xenbus_file_read() local
122 mutex_lock(&u->reply_mutex); in xenbus_file_read()
123 while (list_empty(&u->read_buffers)) { in xenbus_file_read()
124 mutex_unlock(&u->reply_mutex); in xenbus_file_read()
125 ret = wait_event_interruptible(u->read_waitq, in xenbus_file_read()
126 !list_empty(&u->read_buffers)); in xenbus_file_read()
129 mutex_lock(&u->reply_mutex); in xenbus_file_read()
132 rb = list_entry(u->read_buffers.next, struct read_buffer, list); in xenbus_file_read()
152 if (list_empty(&u->read_buffers)) in xenbus_file_read()
154 rb = list_entry(u->read_buffers.next, in xenbus_file_read()
160 mutex_unlock(&u->reply_mutex); in xenbus_file_read()
292 struct xenbus_file_priv *u) in xenbus_write_transaction() argument
307 reply = xenbus_dev_request_and_reply(&u->u.msg); in xenbus_write_transaction()
317 list_add(&trans->list, &u->transactions); in xenbus_write_transaction()
319 list_for_each_entry(trans, &u->transactions, list) in xenbus_write_transaction()
320 if (trans->handle.id == u->u.msg.tx_id) in xenbus_write_transaction()
322 BUG_ON(&trans->list == &u->transactions); in xenbus_write_transaction()
328 mutex_lock(&u->reply_mutex); in xenbus_write_transaction()
329 rc = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg)); in xenbus_write_transaction()
331 rc = queue_reply(&staging_q, reply, u->u.msg.len); in xenbus_write_transaction()
333 list_splice_tail(&staging_q, &u->read_buffers); in xenbus_write_transaction()
334 wake_up(&u->read_waitq); in xenbus_write_transaction()
338 mutex_unlock(&u->reply_mutex); in xenbus_write_transaction()
346 static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) in xenbus_write_watch() argument
353 path = u->u.buffer + sizeof(u->u.msg); in xenbus_write_watch()
354 token = memchr(path, 0, u->u.msg.len); in xenbus_write_watch()
369 watch->dev_data = u; in xenbus_write_watch()
377 list_add(&watch->list, &u->watches); in xenbus_write_watch()
379 list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) { in xenbus_write_watch()
403 mutex_lock(&u->reply_mutex); in xenbus_write_watch()
404 rc = queue_reply(&u->read_buffers, &reply, sizeof(reply)); in xenbus_write_watch()
405 mutex_unlock(&u->reply_mutex); in xenbus_write_watch()
416 struct xenbus_file_priv *u = filp->private_data; in xenbus_file_write() local
437 mutex_lock(&u->msgbuffer_mutex); in xenbus_file_write()
444 if ((len + u->len) > sizeof(u->u.buffer)) { in xenbus_file_write()
446 u->len = 0; in xenbus_file_write()
451 ret = copy_from_user(u->u.buffer + u->len, ubuf, len); in xenbus_file_write()
462 u->len += len; in xenbus_file_write()
465 if (u->len < sizeof(u->u.msg)) in xenbus_file_write()
470 if ((sizeof(u->u.msg) + u->u.msg.len) > sizeof(u->u.buffer)) { in xenbus_file_write()
472 u->len = 0; in xenbus_file_write()
476 if (u->len < (sizeof(u->u.msg) + u->u.msg.len)) in xenbus_file_write()
483 msg_type = u->u.msg.type; in xenbus_file_write()
498 ret = xenbus_write_transaction(msg_type, u); in xenbus_file_write()
504 ret = xenbus_write_watch(msg_type, u); in xenbus_file_write()
515 u->len = 0; in xenbus_file_write()
518 mutex_unlock(&u->msgbuffer_mutex); in xenbus_file_write()
524 struct xenbus_file_priv *u; in xenbus_file_open() local
531 u = kzalloc(sizeof(*u), GFP_KERNEL); in xenbus_file_open()
532 if (u == NULL) in xenbus_file_open()
535 INIT_LIST_HEAD(&u->transactions); in xenbus_file_open()
536 INIT_LIST_HEAD(&u->watches); in xenbus_file_open()
537 INIT_LIST_HEAD(&u->read_buffers); in xenbus_file_open()
538 init_waitqueue_head(&u->read_waitq); in xenbus_file_open()
540 mutex_init(&u->reply_mutex); in xenbus_file_open()
541 mutex_init(&u->msgbuffer_mutex); in xenbus_file_open()
543 filp->private_data = u; in xenbus_file_open()
550 struct xenbus_file_priv *u = filp->private_data; in xenbus_file_release() local
559 list_for_each_entry_safe(trans, tmp, &u->transactions, list) { in xenbus_file_release()
565 list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) { in xenbus_file_release()
571 kfree(u); in xenbus_file_release()
578 struct xenbus_file_priv *u = file->private_data; in xenbus_file_poll() local
580 poll_wait(file, &u->read_waitq, wait); in xenbus_file_poll()
581 if (!list_empty(&u->read_buffers)) in xenbus_file_poll()