[BACK]Return to ccd.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/ccd.c between version 1.118.2.8 and 1.119

version 1.118.2.8, 2007/08/24 23:28:33 version 1.119, 2007/03/12 18:18:30
Line 261  ccdattach(int num)
Line 261  ccdattach(int num)
         for (i = 0; i < num; i++) {          for (i = 0; i < num; i++) {
                 cs = &ccd_softc[i];                  cs = &ccd_softc[i];
                 snprintf(cs->sc_xname, sizeof(cs->sc_xname), "ccd%d", i);                  snprintf(cs->sc_xname, sizeof(cs->sc_xname), "ccd%d", i);
                   cs->sc_dkdev.dk_name = cs->sc_xname;    /* XXX */
                 mutex_init(&cs->sc_lock, MUTEX_DRIVER, IPL_NONE);                  mutex_init(&cs->sc_lock, MUTEX_DRIVER, IPL_NONE);
                 disk_init(&cs->sc_dkdev, cs->sc_xname, NULL); /* XXX */                  pseudo_disk_init(&cs->sc_dkdev);
         }          }
 }  }
   
Line 670  ccdstrategy(struct buf *bp)
Line 671  ccdstrategy(struct buf *bp)
                         printf("ccdstrategy: unit %d: not inited\n", unit);                          printf("ccdstrategy: unit %d: not inited\n", unit);
 #endif  #endif
                 bp->b_error = ENXIO;                  bp->b_error = ENXIO;
                   bp->b_flags |= B_ERROR;
                 goto done;                  goto done;
         }          }
   
Line 764  ccdstart(struct ccd_softc *cs)
Line 766  ccdstart(struct ccd_softc *cs)
                         SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q);                          SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q);
                         if ((cbp->cb_buf.b_flags & B_READ) == 0)                          if ((cbp->cb_buf.b_flags & B_READ) == 0)
                                 cbp->cb_buf.b_vp->v_numoutput++;                                  cbp->cb_buf.b_vp->v_numoutput++;
                         bdev_strategy(&cbp->cb_buf);                          DEV_STRATEGY(&cbp->cb_buf);
                 }                  }
         }          }
 }  }
Line 837  ccdbuffer(struct ccd_softc *cs, struct b
Line 839  ccdbuffer(struct ccd_softc *cs, struct b
         cbp = CCD_GETBUF();          cbp = CCD_GETBUF();
         if (cbp == NULL)          if (cbp == NULL)
                 return (NULL);                  return (NULL);
         buf_init(&cbp->cb_buf);          BUF_INIT(&cbp->cb_buf);
         cbp->cb_buf.b_flags = bp->b_flags;          cbp->cb_buf.b_flags = bp->b_flags | B_CALL;
         cbp->cb_buf.b_oflags = bp->b_oflags;  
         cbp->cb_buf.b_cflags = bp->b_cflags;  
         cbp->cb_buf.b_iodone = ccdiodone;          cbp->cb_buf.b_iodone = ccdiodone;
         cbp->cb_buf.b_proc = bp->b_proc;          cbp->cb_buf.b_proc = bp->b_proc;
         cbp->cb_buf.b_dev = ci->ci_dev;          cbp->cb_buf.b_dev = ci->ci_dev;
Line 885  ccdintr(struct ccd_softc *cs, struct buf
Line 885  ccdintr(struct ccd_softc *cs, struct buf
         /*          /*
          * Request is done for better or worse, wakeup the top half.           * Request is done for better or worse, wakeup the top half.
          */           */
         if (bp->b_error != 0)          if (bp->b_flags & B_ERROR)
                 bp->b_resid = bp->b_bcount;                  bp->b_resid = bp->b_bcount;
         disk_unbusy(&cs->sc_dkdev, (bp->b_bcount - bp->b_resid),          disk_unbusy(&cs->sc_dkdev, (bp->b_bcount - bp->b_resid),
             (bp->b_flags & B_READ));              (bp->b_flags & B_READ));
Line 920  ccdiodone(struct buf *vbp)
Line 920  ccdiodone(struct buf *vbp)
         }          }
 #endif  #endif
   
         if (cbp->cb_buf.b_error != 0) {          if (cbp->cb_buf.b_flags & B_ERROR) {
                 bp->b_error = cbp->cb_buf.b_error;                  bp->b_flags |= B_ERROR;
                   bp->b_error = cbp->cb_buf.b_error ?
                       cbp->cb_buf.b_error : EIO;
   
                 printf("%s: error %d on component %d\n",                  printf("%s: error %d on component %d\n",
                        cs->sc_xname, bp->b_error, cbp->cb_comp);                         cs->sc_xname, bp->b_error, cbp->cb_comp);
         }          }
         count = cbp->cb_buf.b_bcount;          count = cbp->cb_buf.b_bcount;
         buf_destroy(&cbp->cb_buf);  
         CCD_PUTBUF(cbp);          CCD_PUTBUF(cbp);
   
         /*          /*
Line 1096  ccdioctl(dev_t dev, u_long cmd, void *da
Line 1098  ccdioctl(dev_t dev, u_long cmd, void *da
                         if (ccddebug & CCDB_INIT)                          if (ccddebug & CCDB_INIT)
                                 printf("ccdioctl: lookedup = %d\n", lookedup);                                  printf("ccdioctl: lookedup = %d\n", lookedup);
 #endif  #endif
                         if ((error = dk_lookup(cpp[i], l, &vpp[i],                          if ((error = dk_lookup(cpp[i], l, &vpp[i])) != 0) {
                             UIO_USERSPACE)) != 0) {  
                                 for (j = 0; j < lookedup; ++j)                                  for (j = 0; j < lookedup; ++j)
                                         (void)vn_close(vpp[j], FREAD|FWRITE,                                          (void)vn_close(vpp[j], FREAD|FWRITE,
                                             uc, l);                                              uc, l);
Line 1137  ccdioctl(dev_t dev, u_long cmd, void *da
Line 1138  ccdioctl(dev_t dev, u_long cmd, void *da
                 bufq_alloc(&cs->sc_bufq, "fcfs", 0);                  bufq_alloc(&cs->sc_bufq, "fcfs", 0);
   
                 /* Attach the disk. */                  /* Attach the disk. */
                 disk_attach(&cs->sc_dkdev);                  pseudo_disk_attach(&cs->sc_dkdev);
   
                 /* Try and read the disklabel. */                  /* Try and read the disklabel. */
                 ccdgetdisklabel(dev);                  ccdgetdisklabel(dev);
Line 1196  ccdioctl(dev_t dev, u_long cmd, void *da
Line 1197  ccdioctl(dev_t dev, u_long cmd, void *da
                 cs->sc_flags &= ~(CCDF_INITED|CCDF_VLABEL);                  cs->sc_flags &= ~(CCDF_INITED|CCDF_VLABEL);
   
                 /* Detatch the disk. */                  /* Detatch the disk. */
                 disk_detach(&cs->sc_dkdev);                  pseudo_disk_detach(&cs->sc_dkdev);
                 break;                  break;
   
         case DIOCGDINFO:          case DIOCGDINFO:

Legend:
Removed from v.1.118.2.8  
changed lines
  Added in v.1.119

CVSweb <webmaster@jp.NetBSD.org>