Lines Matching defs:be

122 	struct blockif_elem *be, *tbe;
126 be = TAILQ_FIRST(&bc->bc_freeq);
127 assert(be != NULL);
128 assert(be->be_status == BST_FREE);
129 TAILQ_REMOVE(&bc->bc_freeq, be, be_link);
130 be->be_req = breq;
131 be->be_op = op;
143 be->be_block = off;
155 be->be_status = BST_PEND;
157 be->be_status = BST_BLOCK;
158 TAILQ_INSERT_TAIL(&bc->bc_pendq, be, be_link);
159 return (be->be_status == BST_PEND);
165 struct blockif_elem *be;
167 TAILQ_FOREACH(be, &bc->bc_pendq, be_link) {
168 if (be->be_status == BST_PEND)
170 assert(be->be_status == BST_BLOCK);
172 if (be == NULL)
174 TAILQ_REMOVE(&bc->bc_pendq, be, be_link);
175 be->be_status = BST_BUSY;
176 be->be_tid = t;
177 TAILQ_INSERT_TAIL(&bc->bc_busyq, be, be_link);
178 *bep = be;
183 blockif_complete(struct blockif_ctxt *bc, struct blockif_elem *be)
187 if (be->be_status == BST_DONE || be->be_status == BST_BUSY)
188 TAILQ_REMOVE(&bc->bc_busyq, be, be_link);
190 TAILQ_REMOVE(&bc->bc_pendq, be, be_link);
192 if (tbe->be_req->br_offset == be->be_block)
195 be->be_tid = 0;
196 be->be_status = BST_FREE;
197 be->be_req = NULL;
198 TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link);
202 blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf)
209 br = be->be_req;
213 switch (be->be_op) {
317 be->be_status = BST_DONE;
326 struct blockif_elem *be;
339 while (blockif_dequeue(bc, t, &be)) {
341 blockif_proc(bc, be, buf);
343 blockif_complete(bc, be);
495 * size be a multiple of the device's sector size.
618 struct blockif_elem *be;
626 TAILQ_FOREACH(be, &bc->bc_pendq, be_link) {
627 if (be->be_req == breq)
630 if (be != NULL) {
634 blockif_complete(bc, be);
643 TAILQ_FOREACH(be, &bc->bc_busyq, be_link) {
644 if (be->be_req == breq)
647 if (be == NULL) {
659 while (be->be_status == BST_BUSY) {
674 pthread_kill(be->be_tid, SIGCONT);