summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-10-05 01:28:21 +0000
committerneel <neel@FreeBSD.org>2014-10-05 01:28:21 +0000
commit16cbb8793a45363cd459773925c4c4862981337f (patch)
tree1e6608f8ef66c867da6e5230b193da69248605c9 /sys/geom
parent09ab9e29373f2b48f72ff71789f6afc0e01c2c91 (diff)
parent61bd408732db9323eacb07c5e0c0a11f957b76d0 (diff)
downloadFreeBSD-src-16cbb8793a45363cd459773925c4c4862981337f.zip
FreeBSD-src-16cbb8793a45363cd459773925c4c4862981337f.tar.gz
IFC @r272481
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_dev.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index a2034d3..c7104d8 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -281,7 +281,7 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
cp = dev->si_drv2;
if (cp == NULL)
- return(ENXIO); /* g_dev_taste() not done yet */
+ return (ENXIO); /* g_dev_taste() not done yet */
g_trace(G_T_ACCESS, "g_dev_open(%s, %d, %d, %p)",
cp->geom->name, flags, fmt, td);
@@ -312,7 +312,7 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
sc->sc_open += r + w + e;
mtx_unlock(&sc->sc_mtx);
}
- return(error);
+ return (error);
}
static int
@@ -324,10 +324,10 @@ g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td)
cp = dev->si_drv2;
if (cp == NULL)
- return(ENXIO);
+ return (ENXIO);
g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)",
cp->geom->name, flags, fmt, td);
-
+
r = flags & FREAD ? -1 : 0;
w = flags & FWRITE ? -1 : 0;
#ifdef notyet
@@ -361,7 +361,6 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
struct g_kerneldump kd;
off_t offset, length, chunk;
int i, error;
- u_int u;
cp = dev->si_drv2;
pp = cp->provider;
@@ -396,19 +395,17 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
error = g_io_getattr("GEOM::frontstuff", cp, &i, data);
break;
case DIOCSKERNELDUMP:
- u = *((u_int *)data);
- if (!u) {
- set_dumper(NULL, NULL);
- error = 0;
+ if (*(u_int *)data == 0) {
+ error = set_dumper(NULL, NULL);
break;
}
kd.offset = 0;
kd.length = OFF_MAX;
i = sizeof kd;
error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd);
- if (!error) {
+ if (error == 0) {
error = set_dumper(&kd.di, devtoname(dev));
- if (!error)
+ if (error == 0)
dev->si_flags |= SI_DUMPDEV;
}
break;
@@ -425,7 +422,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
error = EINVAL;
break;
}
- while (length > 0) {
+ while (length > 0) {
chunk = length;
if (g_dev_del_max_sectors != 0 && chunk >
g_dev_del_max_sectors * cp->provider->sectorsize) {
@@ -618,7 +615,7 @@ g_dev_orphan(struct g_consumer *cp)
/* Reset any dump-area set on this device */
if (dev->si_flags & SI_DUMPDEV)
- set_dumper(NULL, NULL);
+ (void)set_dumper(NULL, NULL);
/* Destroy the struct cdev *so we get no more requests */
destroy_dev_sched_cb(dev, g_dev_callback, cp);
OpenPOWER on IntegriCloud