• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/block/

Lines Matching defs:bc

92 static void bsg_free_command(struct bsg_command *bc)
94 struct bsg_device *bd = bc->bd;
97 kmem_cache_free(bsg_cmd_cachep, bc);
108 struct bsg_command *bc = ERR_PTR(-EINVAL);
118 bc = kmem_cache_zalloc(bsg_cmd_cachep, GFP_KERNEL);
119 if (unlikely(!bc)) {
122 bc = ERR_PTR(-ENOMEM);
126 bc->bd = bd;
127 INIT_LIST_HEAD(&bc->list);
128 dprintk("%s: returning free cmd %p\n", bd->name, bc);
129 return bc;
132 return bc;
331 struct bsg_command *bc = rq->end_io_data;
332 struct bsg_device *bd = bc->bd;
335 dprintk("%s: finished rq %p bc %p, bio %p stat %d\n",
336 bd->name, rq, bc, bc->bio, uptodate);
338 bc->hdr.duration = jiffies_to_msecs(jiffies - bc->hdr.duration);
341 list_move_tail(&bc->list, &bd->done_list);
349 * do final setup of a 'bc' and submit the matching 'rq' to the block
353 struct bsg_command *bc, struct request *rq)
355 int at_head = (0 == (bc->hdr.flags & BSG_FLAG_Q_AT_TAIL));
358 * add bc command to busy queue and submit rq for io
360 bc->rq = rq;
361 bc->bio = rq->bio;
363 bc->bidi_bio = rq->next_rq->bio;
364 bc->hdr.duration = jiffies;
366 list_add_tail(&bc->list, &bd->busy_list);
369 dprintk("%s: queueing rq %p, bc %p\n", bd->name, rq, bc);
371 rq->end_io_data = bc;
377 struct bsg_command *bc = NULL;
381 bc = list_first_entry(&bd->done_list, struct bsg_command, list);
382 list_del(&bc->list);
387 return bc;
395 struct bsg_command *bc;
399 bc = bsg_next_done_cmd(bd);
400 if (bc)
404 bc = ERR_PTR(-EAGAIN);
410 bc = ERR_PTR(-ERESTARTSYS);
415 dprintk("%s: returning done %p\n", bd->name, bc);
417 return bc;
478 struct bsg_command *bc;
510 bc = bsg_get_done_cmd(bd);
511 if (IS_ERR(bc))
514 tret = blk_complete_sgv4_hdr_rq(bc->rq, &bc->hdr, bc->bio,
515 bc->bidi_bio);
519 bsg_free_command(bc);
529 struct bsg_command *bc;
538 bc = bsg_get_done_cmd(bd);
539 if (IS_ERR(bc)) {
540 ret = PTR_ERR(bc);
549 ret = blk_complete_sgv4_hdr_rq(bc->rq, &bc->hdr, bc->bio,
550 bc->bidi_bio);
552 if (copy_to_user(buf, &bc->hdr, sizeof(bc->hdr)))
555 bsg_free_command(bc);
612 struct bsg_command *bc;
621 bc = NULL;
626 bc = bsg_alloc_command(bd);
627 if (IS_ERR(bc)) {
628 ret = PTR_ERR(bc);
629 bc = NULL;
633 if (copy_from_user(&bc->hdr, buf, sizeof(bc->hdr))) {
641 rq = bsg_map_hdr(bd, &bc->hdr, has_write_perm, bc->sense);
648 bsg_add_command(bd, q, bc, rq);
649 bc = NULL;
656 if (bc)
657 bsg_free_command(bc);