svn commit: r249143 - stable/9/sys/geom
Alexander Motin
mav at FreeBSD.org
Fri Apr 5 10:13:45 UTC 2013
Author: mav
Date: Fri Apr 5 10:13:44 2013
New Revision: 249143
URL: http://svnweb.freebsd.org/changeset/base/249143
Log:
MFC r226736:
Improve style a bit.
Modified:
stable/9/sys/geom/geom_disk.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/geom/geom_disk.c
==============================================================================
--- stable/9/sys/geom/geom_disk.c Fri Apr 5 10:10:39 2013 (r249142)
+++ stable/9/sys/geom/geom_disk.c Fri Apr 5 10:13:44 2013 (r249143)
@@ -112,6 +112,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);
}
@@ -119,6 +120,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);
}
@@ -254,9 +256,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);
@@ -285,7 +287,7 @@ g_disk_ioctl(struct g_provider *pp, u_lo
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
@@ -583,6 +585,7 @@ disk_alloc(void)
void
disk_create(struct disk *dp, int version)
{
+
if (version != DISK_VERSION_02 && version != DISK_VERSION_01) {
printf("WARNING: Attempt to add disk %s%d %s",
dp->d_name, dp->d_unit,
@@ -674,4 +677,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");
-
More information about the svn-src-stable-9
mailing list