1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9 * DARPA CHATS research program. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 3. The names of the authors may not be used to endorse or promote 20 * products derived from this software without specific prior written 21 * permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 *
| 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9 * DARPA CHATS research program. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 3. The names of the authors may not be used to endorse or promote 20 * products derived from this software without specific prior written 21 * permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 *
|
35 * $FreeBSD: head/sys/geom/geom_disk.c 109623 2003-01-21 08:56:16Z alfred $
| 35 * $FreeBSD: head/sys/geom/geom_disk.c 110052 2003-01-29 19:47:25Z phk $
|
36 */ 37 38#include "opt_geom.h"
| 36 */ 37 38#include "opt_geom.h"
|
39#ifndef NO_GEOM
| |
40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/sysctl.h> 45#include <sys/bio.h> 46#include <sys/conf.h> 47#include <sys/disk.h> 48#include <sys/disklabel.h> 49#include <sys/malloc.h> 50#include <sys/sysctl.h> 51#include <sys/stdint.h> 52#include <machine/md_var.h> 53 54 55#include <sys/lock.h> 56#include <sys/mutex.h> 57#include <geom/geom.h> 58 59static g_access_t g_disk_access; 60 61struct g_class g_disk_class = { 62 "DISK", 63 NULL, 64 NULL, 65 G_CLASS_INITIALIZER 66}; 67 68DECLARE_GEOM_CLASS(g_disk_class, g_disk); 69
| 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/sysctl.h> 44#include <sys/bio.h> 45#include <sys/conf.h> 46#include <sys/disk.h> 47#include <sys/disklabel.h> 48#include <sys/malloc.h> 49#include <sys/sysctl.h> 50#include <sys/stdint.h> 51#include <machine/md_var.h> 52 53 54#include <sys/lock.h> 55#include <sys/mutex.h> 56#include <geom/geom.h> 57 58static g_access_t g_disk_access; 59 60struct g_class g_disk_class = { 61 "DISK", 62 NULL, 63 NULL, 64 G_CLASS_INITIALIZER 65}; 66 67DECLARE_GEOM_CLASS(g_disk_class, g_disk); 68
|
| 69static void __inline 70g_disk_lock_giant(struct disk *dp) 71{ 72 if (!(dp->d_devsw->d_flags & D_NOGIANT)) 73 mtx_lock(&Giant); 74} 75 76static void __inline 77g_disk_unlock_giant(struct disk *dp) 78{ 79 if (!(dp->d_devsw->d_flags & D_NOGIANT)) 80 mtx_unlock(&Giant); 81} 82
|
70static int 71g_disk_access(struct g_provider *pp, int r, int w, int e) 72{ 73 struct disk *dp; 74 dev_t dev; 75 int error; 76 77 g_trace(G_T_ACCESS, "g_disk_access(%s, %d, %d, %d)", 78 pp->name, r, w, e); 79 g_topology_assert(); 80 r += pp->acr; 81 w += pp->acw; 82 e += pp->ace; 83 dp = pp->geom->softc; 84 dev = dp->d_dev; 85 if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) {
| 83static int 84g_disk_access(struct g_provider *pp, int r, int w, int e) 85{ 86 struct disk *dp; 87 dev_t dev; 88 int error; 89 90 g_trace(G_T_ACCESS, "g_disk_access(%s, %d, %d, %d)", 91 pp->name, r, w, e); 92 g_topology_assert(); 93 r += pp->acr; 94 w += pp->acw; 95 e += pp->ace; 96 dp = pp->geom->softc; 97 dev = dp->d_dev; 98 if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) {
|
86 mtx_lock(&Giant);
| 99 g_disk_lock_giant(dp);
|
87 error = devsw(dev)->d_open(dev, 3, 0, NULL); 88 if (error != 0) 89 printf("Opened disk %s -> %d\n", pp->name, error);
| 100 error = devsw(dev)->d_open(dev, 3, 0, NULL); 101 if (error != 0) 102 printf("Opened disk %s -> %d\n", pp->name, error);
|
90 mtx_unlock(&Giant);
| 103 g_disk_unlock_giant(dp);
|
91 pp->mediasize = dp->d_mediasize; 92 pp->sectorsize = dp->d_sectorsize; 93 } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) {
| 104 pp->mediasize = dp->d_mediasize; 105 pp->sectorsize = dp->d_sectorsize; 106 } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) {
|
94 mtx_lock(&Giant);
| 107 g_disk_lock_giant(dp);
|
95 error = devsw(dev)->d_close(dev, 3, 0, NULL); 96 if (error != 0) 97 printf("Closed disk %s -> %d\n", pp->name, error);
| 108 error = devsw(dev)->d_close(dev, 3, 0, NULL); 109 if (error != 0) 110 printf("Closed disk %s -> %d\n", pp->name, error);
|
98 mtx_unlock(&Giant);
| 111 g_disk_unlock_giant(dp);
|
99 } else { 100 error = 0; 101 } 102 return (error); 103} 104 105static void 106g_disk_kerneldump(struct bio *bp, struct disk *dp) 107{ 108 int error; 109 struct g_kerneldump *gkd; 110 struct dumperinfo di; 111 struct g_geom *gp; 112 113 gkd = (struct g_kerneldump*)bp->bio_data; 114 gp = bp->bio_to->geom; 115 g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)", 116 gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length); 117 di.dumper = (dumper_t *)dp->d_devsw->d_dump; 118 di.priv = dp->d_dev; 119 di.blocksize = dp->d_sectorsize; 120 di.mediaoffset = gkd->offset; 121 di.mediasize = gkd->length; 122 error = set_dumper(&di); 123 g_io_deliver(bp, error); 124} 125 126static void 127g_disk_done(struct bio *bp) 128{
| 112 } else { 113 error = 0; 114 } 115 return (error); 116} 117 118static void 119g_disk_kerneldump(struct bio *bp, struct disk *dp) 120{ 121 int error; 122 struct g_kerneldump *gkd; 123 struct dumperinfo di; 124 struct g_geom *gp; 125 126 gkd = (struct g_kerneldump*)bp->bio_data; 127 gp = bp->bio_to->geom; 128 g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)", 129 gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length); 130 di.dumper = (dumper_t *)dp->d_devsw->d_dump; 131 di.priv = dp->d_dev; 132 di.blocksize = dp->d_sectorsize; 133 di.mediaoffset = gkd->offset; 134 di.mediasize = gkd->length; 135 error = set_dumper(&di); 136 g_io_deliver(bp, error); 137} 138 139static void 140g_disk_done(struct bio *bp) 141{
|
| 142 struct disk *dp;
|
129
| 143
|
130 mtx_unlock(&Giant);
| 144 dp = bp->bio_caller1;
|
131 bp->bio_completed = bp->bio_length - bp->bio_resid;
| 145 bp->bio_completed = bp->bio_length - bp->bio_resid;
|
132 g_std_done(bp); 133 mtx_lock(&Giant);
| 146 if (!(dp->d_devsw->d_flags & D_NOGIANT)) { 147 DROP_GIANT(); 148 g_std_done(bp); 149 PICKUP_GIANT(); 150 } else { 151 g_std_done(bp); 152 }
|
134} 135 136static void 137g_disk_start(struct bio *bp) 138{ 139 struct bio *bp2; 140 dev_t dev; 141 struct disk *dp; 142 struct g_ioctl *gio; 143 int error; 144 145 dp = bp->bio_to->geom->softc; 146 dev = dp->d_dev; 147 error = EJUSTRETURN; 148 switch(bp->bio_cmd) { 149 case BIO_DELETE: 150 if (!(devsw(dev)->d_flags & D_CANFREE)) { 151 error = 0; 152 break; 153 } 154 /* fall-through */ 155 case BIO_READ: 156 case BIO_WRITE: 157 bp2 = g_clone_bio(bp); 158 bp2->bio_done = g_disk_done; 159 bp2->bio_blkno = bp2->bio_offset >> DEV_BSHIFT; 160 bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize; 161 bp2->bio_bcount = bp2->bio_length; 162 bp2->bio_dev = dev;
| 153} 154 155static void 156g_disk_start(struct bio *bp) 157{ 158 struct bio *bp2; 159 dev_t dev; 160 struct disk *dp; 161 struct g_ioctl *gio; 162 int error; 163 164 dp = bp->bio_to->geom->softc; 165 dev = dp->d_dev; 166 error = EJUSTRETURN; 167 switch(bp->bio_cmd) { 168 case BIO_DELETE: 169 if (!(devsw(dev)->d_flags & D_CANFREE)) { 170 error = 0; 171 break; 172 } 173 /* fall-through */ 174 case BIO_READ: 175 case BIO_WRITE: 176 bp2 = g_clone_bio(bp); 177 bp2->bio_done = g_disk_done; 178 bp2->bio_blkno = bp2->bio_offset >> DEV_BSHIFT; 179 bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize; 180 bp2->bio_bcount = bp2->bio_length; 181 bp2->bio_dev = dev;
|
163 mtx_lock(&Giant);
| 182 bp2->bio_caller1 = dp; 183 g_disk_lock_giant(dp);
|
164 devsw(dev)->d_strategy(bp2);
| 184 devsw(dev)->d_strategy(bp2);
|
165 mtx_unlock(&Giant);
| 185 g_disk_unlock_giant(dp);
|
166 break; 167 case BIO_GETATTR: 168 if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors)) 169 break; 170 else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads)) 171 break; 172 else if (g_handleattr_off_t(bp, "GEOM::frontstuff", 0)) 173 break; 174 else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) 175 g_disk_kerneldump(bp, dp); 176 else if (!strcmp(bp->bio_attribute, "GEOM::ioctl") && 177 bp->bio_length == sizeof *gio) { 178 gio = (struct g_ioctl *)bp->bio_data; 179 gio->func = devsw(dp->d_dev)->d_ioctl; 180 gio->dev = dp->d_dev; 181 error = EDIRIOCTL; 182 } else 183 error = ENOIOCTL; 184 break; 185 case BIO_SETATTR: 186 if (!strcmp(bp->bio_attribute, "GEOM::ioctl") && 187 bp->bio_length == sizeof *gio) { 188 gio = (struct g_ioctl *)bp->bio_data; 189 gio->func = devsw(dp->d_dev)->d_ioctl; 190 gio->dev = dp->d_dev; 191 error = EDIRIOCTL; 192 } else 193 error = ENOIOCTL; 194 break; 195 default: 196 error = EOPNOTSUPP; 197 break; 198 } 199 if (error != EJUSTRETURN) 200 g_io_deliver(bp, error); 201 return; 202} 203 204static void 205g_disk_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp) 206{ 207 struct disk *dp; 208 209 dp = gp->softc; 210 if (indent == NULL) { 211 sbuf_printf(sb, " hd %u", dp->d_fwheads); 212 sbuf_printf(sb, " sc %u", dp->d_fwsectors); 213 return; 214 } 215 if (pp != NULL) { 216 sbuf_printf(sb, "%s<fwheads>%u</fwheads>\n", 217 indent, dp->d_fwheads); 218 sbuf_printf(sb, "%s<fwsectors>%u</fwsectors>\n", 219 indent, dp->d_fwsectors); 220 } 221} 222 223static void 224g_disk_create(void *arg) 225{ 226 struct g_geom *gp; 227 struct g_provider *pp; 228 dev_t dev; 229 230 g_topology_assert(); 231 dev = arg; 232 gp = g_new_geomf(&g_disk_class, dev->si_name); 233 gp->start = g_disk_start; 234 gp->access = g_disk_access; 235 gp->softc = dev->si_disk; 236 gp->dumpconf = g_disk_dumpconf; 237 dev->si_disk->d_softc = gp; 238 pp = g_new_providerf(gp, "%s", gp->name); 239 pp->mediasize = dev->si_disk->d_mediasize; 240 pp->sectorsize = dev->si_disk->d_sectorsize; 241 g_error_provider(pp, 0); 242 if (bootverbose) 243 printf("GEOM: new disk %s\n", gp->name); 244} 245 246 247 248dev_t 249disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, struct cdevsw *proto) 250{ 251 dev_t dev; 252 253 dev = g_malloc(sizeof *dev, M_ZERO); 254 dp->d_dev = dev; 255 dp->d_devsw = cdevsw; 256 dev->si_devsw = cdevsw; 257 dev->si_disk = dp; 258 dev->si_udev = dkmakeminor(unit, 1, RAW_PART); 259 sprintf(dev->si_name, "%s%d", cdevsw->d_name, unit); 260 g_call_me(g_disk_create, dev); 261 return (dev); 262} 263 264void 265disk_destroy(dev_t dev) 266{ 267 struct disk *dp; 268 struct g_geom *gp; 269 270 dp = dev->si_disk; 271 gp = dp->d_softc; 272 g_free(dev); 273 gp->flags |= G_GEOM_WITHER; 274 g_orphan_provider(LIST_FIRST(&gp->provider), ENXIO); 275} 276 277void 278disk_invalidate (struct disk *disk) 279{ 280} 281 282static void 283g_kern_disks(void *p) 284{ 285 struct sbuf *sb; 286 struct g_geom *gp; 287 char *sp; 288 289 sb = p; 290 sp = ""; 291 g_topology_assert(); 292 LIST_FOREACH(gp, &g_disk_class.geom, geom) { 293 sbuf_printf(sb, "%s%s", sp, gp->name); 294 sp = " "; 295 } 296 sbuf_finish(sb); 297 wakeup(sb); 298} 299 300static int 301sysctl_disks(SYSCTL_HANDLER_ARGS) 302{ 303 int error; 304 struct sbuf *sb; 305 306 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 307 sbuf_clear(sb); 308 g_call_me(g_kern_disks, sb); 309 do { 310 tsleep(sb, PZERO, "kern.disks", hz); 311 } while(!sbuf_done(sb)); 312 error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); 313 sbuf_delete(sb); 314 return error; 315} 316 317SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NOLOCK, 0, 0, 318 sysctl_disks, "A", "names of available disks"); 319
| 186 break; 187 case BIO_GETATTR: 188 if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors)) 189 break; 190 else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads)) 191 break; 192 else if (g_handleattr_off_t(bp, "GEOM::frontstuff", 0)) 193 break; 194 else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) 195 g_disk_kerneldump(bp, dp); 196 else if (!strcmp(bp->bio_attribute, "GEOM::ioctl") && 197 bp->bio_length == sizeof *gio) { 198 gio = (struct g_ioctl *)bp->bio_data; 199 gio->func = devsw(dp->d_dev)->d_ioctl; 200 gio->dev = dp->d_dev; 201 error = EDIRIOCTL; 202 } else 203 error = ENOIOCTL; 204 break; 205 case BIO_SETATTR: 206 if (!strcmp(bp->bio_attribute, "GEOM::ioctl") && 207 bp->bio_length == sizeof *gio) { 208 gio = (struct g_ioctl *)bp->bio_data; 209 gio->func = devsw(dp->d_dev)->d_ioctl; 210 gio->dev = dp->d_dev; 211 error = EDIRIOCTL; 212 } else 213 error = ENOIOCTL; 214 break; 215 default: 216 error = EOPNOTSUPP; 217 break; 218 } 219 if (error != EJUSTRETURN) 220 g_io_deliver(bp, error); 221 return; 222} 223 224static void 225g_disk_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp) 226{ 227 struct disk *dp; 228 229 dp = gp->softc; 230 if (indent == NULL) { 231 sbuf_printf(sb, " hd %u", dp->d_fwheads); 232 sbuf_printf(sb, " sc %u", dp->d_fwsectors); 233 return; 234 } 235 if (pp != NULL) { 236 sbuf_printf(sb, "%s<fwheads>%u</fwheads>\n", 237 indent, dp->d_fwheads); 238 sbuf_printf(sb, "%s<fwsectors>%u</fwsectors>\n", 239 indent, dp->d_fwsectors); 240 } 241} 242 243static void 244g_disk_create(void *arg) 245{ 246 struct g_geom *gp; 247 struct g_provider *pp; 248 dev_t dev; 249 250 g_topology_assert(); 251 dev = arg; 252 gp = g_new_geomf(&g_disk_class, dev->si_name); 253 gp->start = g_disk_start; 254 gp->access = g_disk_access; 255 gp->softc = dev->si_disk; 256 gp->dumpconf = g_disk_dumpconf; 257 dev->si_disk->d_softc = gp; 258 pp = g_new_providerf(gp, "%s", gp->name); 259 pp->mediasize = dev->si_disk->d_mediasize; 260 pp->sectorsize = dev->si_disk->d_sectorsize; 261 g_error_provider(pp, 0); 262 if (bootverbose) 263 printf("GEOM: new disk %s\n", gp->name); 264} 265 266 267 268dev_t 269disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, struct cdevsw *proto) 270{ 271 dev_t dev; 272 273 dev = g_malloc(sizeof *dev, M_ZERO); 274 dp->d_dev = dev; 275 dp->d_devsw = cdevsw; 276 dev->si_devsw = cdevsw; 277 dev->si_disk = dp; 278 dev->si_udev = dkmakeminor(unit, 1, RAW_PART); 279 sprintf(dev->si_name, "%s%d", cdevsw->d_name, unit); 280 g_call_me(g_disk_create, dev); 281 return (dev); 282} 283 284void 285disk_destroy(dev_t dev) 286{ 287 struct disk *dp; 288 struct g_geom *gp; 289 290 dp = dev->si_disk; 291 gp = dp->d_softc; 292 g_free(dev); 293 gp->flags |= G_GEOM_WITHER; 294 g_orphan_provider(LIST_FIRST(&gp->provider), ENXIO); 295} 296 297void 298disk_invalidate (struct disk *disk) 299{ 300} 301 302static void 303g_kern_disks(void *p) 304{ 305 struct sbuf *sb; 306 struct g_geom *gp; 307 char *sp; 308 309 sb = p; 310 sp = ""; 311 g_topology_assert(); 312 LIST_FOREACH(gp, &g_disk_class.geom, geom) { 313 sbuf_printf(sb, "%s%s", sp, gp->name); 314 sp = " "; 315 } 316 sbuf_finish(sb); 317 wakeup(sb); 318} 319 320static int 321sysctl_disks(SYSCTL_HANDLER_ARGS) 322{ 323 int error; 324 struct sbuf *sb; 325 326 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 327 sbuf_clear(sb); 328 g_call_me(g_kern_disks, sb); 329 do { 330 tsleep(sb, PZERO, "kern.disks", hz); 331 } while(!sbuf_done(sb)); 332 error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); 333 sbuf_delete(sb); 334 return error; 335} 336 337SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NOLOCK, 0, 0, 338 sysctl_disks, "A", "names of available disks"); 339
|
320#endif
| |
| |