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

View File

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