Improve style a bit.
MFC after: 3 days
This commit is contained in:
parent
44f9590751
commit
2536f7a375
@ -109,6 +109,7 @@ DECLARE_GEOM_CLASS(g_disk_class, g_disk);
|
||||
static void __inline
|
||||
g_disk_lock_giant(struct disk *dp)
|
||||
{
|
||||
|
||||
if (dp->d_flags & DISKFLAG_NEEDSGIANT)
|
||||
mtx_lock(&Giant);
|
||||
}
|
||||
@ -116,6 +117,7 @@ g_disk_lock_giant(struct disk *dp)
|
||||
static void __inline
|
||||
g_disk_unlock_giant(struct disk *dp)
|
||||
{
|
||||
|
||||
if (dp->d_flags & DISKFLAG_NEEDSGIANT)
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
@ -251,9 +253,9 @@ g_disk_done(struct bio *bp)
|
||||
if (bp2->bio_error == 0)
|
||||
bp2->bio_error = bp->bio_error;
|
||||
bp2->bio_completed += bp->bio_completed;
|
||||
if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) &&
|
||||
(sc = bp2->bio_to->geom->softc) &&
|
||||
(dp = sc->dp)) {
|
||||
if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0 &&
|
||||
(sc = bp2->bio_to->geom->softc) != NULL &&
|
||||
(dp = sc->dp) != NULL) {
|
||||
devstat_end_transaction_bio(dp->d_devstat, bp);
|
||||
}
|
||||
g_destroy_bio(bp);
|
||||
@ -282,7 +284,7 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct t
|
||||
g_disk_lock_giant(dp);
|
||||
error = dp->d_ioctl(dp, cmd, data, fflag, td);
|
||||
g_disk_unlock_giant(dp);
|
||||
return(error);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -546,6 +548,7 @@ disk_alloc(void)
|
||||
void
|
||||
disk_create(struct disk *dp, int version)
|
||||
{
|
||||
|
||||
if (version != DISK_VERSION_00 && version != DISK_VERSION_01) {
|
||||
printf("WARNING: Attempt to add disk %s%d %s",
|
||||
dp->d_name, dp->d_unit,
|
||||
@ -635,4 +638,3 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
|
||||
SYSCTL_PROC(_kern, OID_AUTO, disks,
|
||||
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
|
||||
sysctl_disks, "A", "names of available disks");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user