nusb/disk: small clenups

front
cinap_lenrek 2011-08-19 05:20:42 +02:00
parent d25b95f4f2
commit a4d2297e96
2 changed files with 3 additions and 22 deletions

View File

@ -256,15 +256,6 @@ umsrecover(void)
return 0;
}
static void
umsfatal(void)
{
// int i;
devctl(dev, "detach");
// for(i = 0; i < ums->maxlun; i++)
// usbfsdel(&ums->lun[i].fs);
}
static int
ispow2(uvlong ul)
@ -478,11 +469,9 @@ umsrequest(Umsc *umsc, ScsiPtr *cmd, ScsiPtr *data, int *status)
Fail:
*status = STharderr;
if(ums->nerrs++ > 15){
fprint(2, "disk: %s: too many errors: device detached\n", dev->dir);
umsfatal();
}else
umsrecover();
if(ums->nerrs++ > 15)
sysfatal("%s: too many errors", dev->dir);
umsrecover();
return -1;
}
@ -700,7 +689,6 @@ dread(Req *req)
data = req->ofcall.data;
offset = req->ifcall.offset;
qlock(ums);
switch(path){
case Qdir:
dirread9p(req, dirgen, lun);
@ -776,7 +764,6 @@ dread(Req *req)
respond(req, nil);
break;
}
qunlock(ums);
}
static void
@ -798,7 +785,6 @@ dwrite(Req *req)
data = req->ifcall.data;
offset = req->ifcall.offset;
qlock(ums);
switch(path){
case Qctl:
s = emallocz(count+1, 1);
@ -902,7 +888,6 @@ dwrite(Req *req)
respond(req, nil);
break;
}
qunlock(ums);
}
int

View File

@ -88,7 +88,6 @@ struct Umsc
struct Ums
{
QLock;
Dev *epin;
Dev *epout;
Umsc *lun;
@ -119,6 +118,3 @@ struct Csw
long dataresidue;
uchar status;
};
int diskmain(Dev*, int, char**);