Change printf() calls to log() calls.

This commit is contained in:
Greg Lehey 1999-03-02 06:56:39 +00:00
parent 80035a4cf1
commit 72dec6f286
3 changed files with 24 additions and 16 deletions

View file

@ -83,14 +83,14 @@ complete_rqe(struct buf *bp)
rq->error = EIO; /* no: catchall "I/O error" */
SD[rqe->sdno].lasterror = rq->error;
if (bp->b_flags & B_READ) {
printf("%s: fatal read I/O error\n", SD[rqe->sdno].name);
log(LOG_ERR, "%s: fatal read I/O error\n", SD[rqe->sdno].name);
set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* subdisk is crashed */
} else { /* write operation */
printf("%s: fatal write I/O error\n", SD[rqe->sdno].name);
log(LOG_ERR, "%s: fatal write I/O error\n", SD[rqe->sdno].name);
set_sd_state(rqe->sdno, sd_stale, setstate_force); /* subdisk is stale */
}
if (rq->error == ENXIO) { /* the drive's down too */
printf("%s: fatal drive I/O error\n", DRIVE[rqe->driveno].label.name);
log(LOG_ERR, "%s: fatal drive I/O error\n", DRIVE[rqe->driveno].label.name);
DRIVE[rqe->driveno].lasterror = rq->error;
set_drive_state(rqe->driveno, /* take the drive down */
drive_down,
@ -126,7 +126,8 @@ complete_rqe(struct buf *bp)
int i;
for (i = 0; i < ubp->b_bcount; i += 512) /* XXX debug */
if (((char *) ubp->b_data)[i] != '<') { /* and not what we expected */
printf("At 0x%x (offset 0x%x): '%c' (0x%x)\n",
log(LOG_DEBUG,
"At 0x%x (offset 0x%x): '%c' (0x%x)\n",
(int) (&((char *) ubp->b_data)[i]),
i,
((char *) ubp->b_data)[i],
@ -177,7 +178,7 @@ void
free_rqg(struct rqgroup *rqg)
{
if ((rqg->flags & XFR_GROUPOP) /* RAID 5 request */
&&(rqg->rqe) /* got a buffer structure */
&&(rqg->rqe) /* got a buffer structure */
&&(rqg->rqe->b.b_data)) /* and it has a buffer allocated */
Free(rqg->rqe->b.b_data); /* free it */
}

View file

@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
* $Id: vinumrequest.c,v 1.7.2.3 1999/02/11 05:50:30 grog Exp $
* $Id: vinumrequest.c,v 1.22 1999/01/17 06:15:46 grog Exp grog $
*/
#define REALLYKERNEL
@ -335,7 +335,8 @@ launch_requests(struct request *rq, int reviveok)
#if VINUMDEBUG
if (debug & DEBUG_REVIVECONFLICT)
printf("Revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
log(LOG_DEBUG,
"Revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
rq->sdno,
(u_int) rq,
rq->bp->b_flags & B_READ ? "Read" : "Write",
@ -348,13 +349,14 @@ launch_requests(struct request *rq, int reviveok)
rq->active = 0; /* nothing yet */
/* XXX This is probably due to a bug */
if (rq->rqg == NULL) { /* no request */
printf("vinum: null rqg");
log(LOG_ERR, "vinum: null rqg");
abortrequest(rq, EINVAL);
return -1;
}
#if VINUMDEBUG
if (debug & DEBUG_ADDRESSES)
printf("Request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
log(LOG_DEBUG,
"Request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
(u_int) rq,
rq->bp->b_flags & B_READ ? "Read" : "Write",
rq->bp->b_dev,
@ -378,7 +380,8 @@ launch_requests(struct request *rq, int reviveok)
rqe->b.b_flags |= B_ORDERED; /* XXX chase SCSI driver */
#if VINUMDEBUG
if (debug & DEBUG_ADDRESSES)
printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
log(LOG_DEBUG,
" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
rqe->b.b_flags & B_READ ? "Read" : "Write",
rqe->b.b_dev,
rqe->sdno,
@ -386,7 +389,8 @@ launch_requests(struct request *rq, int reviveok)
rqe->b.b_blkno,
rqe->b.b_bcount); /* XXX */
if (debug & DEBUG_NUMOUTPUT)
printf(" vinumstart sd %d numoutput %ld\n",
log(LOG_DEBUG,
" vinumstart sd %d numoutput %ld\n",
rqe->sdno,
rqe->b.b_vp->v_numoutput);
if (debug & DEBUG_LASTREQS)
@ -578,7 +582,7 @@ bre(struct request *rq,
default:
printf("vinum: invalid plex type in bre");
log(LOG_ERR, "vinum: invalid plex type %d in bre", plex->organization);
}
return status;
@ -840,7 +844,8 @@ sdio(struct buf *bp)
sbp->b.b_vp->v_numoutput++; /* one more output going */
#if VINUMDEBUG
if (debug & DEBUG_ADDRESSES)
printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
log(LOG_DEBUG,
" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
sbp->b.b_flags & B_READ ? "Read" : "Write",
sbp->b.b_dev,
sbp->sdno,
@ -848,7 +853,8 @@ sdio(struct buf *bp)
(int) sbp->b.b_blkno,
sbp->b.b_bcount); /* XXX */
if (debug & DEBUG_NUMOUTPUT)
printf(" vinumstart sd %d numoutput %ld\n",
log(LOG_DEBUG,
" vinumstart sd %d numoutput %ld\n",
sbp->sdno,
sbp->b.b_vp->v_numoutput);
#endif

View file

@ -159,7 +159,7 @@ revive_block(int sdno)
if (sd->revived >= sd->sectors) { /* finished */
sd->revived = 0;
set_sd_state(sdno, sd_up, setstate_force); /* bring the sd up */
printf("vinum: %s is %s\n", sd->name, sd_state(sd->state));
log(LOG_INFO, "vinum: %s is %s\n", sd->name, sd_state(sd->state));
save_config(); /* and save the updated configuration */
error = 0; /* we're done */
}
@ -169,7 +169,8 @@ revive_block(int sdno)
struct request *rq = sd->waitlist;
if (debug & DEBUG_REVIVECONFLICT)
printf("Relaunch revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
log(LOG_DEBUG,
"Relaunch revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
rq->sdno,
(u_int) rq,
rq->bp->b_flags & B_READ ? "Read" : "Write",