Lines Matching refs:rb
124 struct read_buffer *rb; in xenbus_file_read() local
142 rb = list_entry(u->read_buffers.next, struct read_buffer, list); in xenbus_file_read()
145 unsigned sz = min((unsigned)len - i, rb->len - rb->cons); in xenbus_file_read()
147 ret = copy_to_user(ubuf + i, &rb->msg[rb->cons], sz); in xenbus_file_read()
150 rb->cons += sz - ret; in xenbus_file_read()
159 if (rb->cons == rb->len) { in xenbus_file_read()
160 list_del(&rb->list); in xenbus_file_read()
161 kfree(rb); in xenbus_file_read()
164 rb = list_entry(u->read_buffers.next, in xenbus_file_read()
185 struct read_buffer *rb; in queue_reply() local
190 rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL); in queue_reply()
191 if (rb == NULL) in queue_reply()
194 rb->cons = 0; in queue_reply()
195 rb->len = len; in queue_reply()
197 memcpy(rb->msg, data, len); in queue_reply()
199 list_add_tail(&rb->list, queue); in queue_reply()
209 struct read_buffer *rb; in queue_cleanup() local
212 rb = list_entry(list->next, struct read_buffer, list); in queue_cleanup()
214 kfree(rb); in queue_cleanup()
556 struct read_buffer *rb, *tmp_rb; in xenbus_file_release() local
575 list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) { in xenbus_file_release()
576 list_del(&rb->list); in xenbus_file_release()
577 kfree(rb); in xenbus_file_release()