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 --- 20 unchanged lines hidden (view full) --- 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 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 133314 2004-08-08 06:49:07Z phk $"); |
38 39#include "opt_geom.h" 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> --- 10 unchanged lines hidden (view full) --- 56#include <geom/geom_disk.h> 57#include <geom/geom_int.h> 58 59static struct mtx g_disk_done_mtx; 60 61static g_access_t g_disk_access; 62static g_init_t g_disk_init; 63static g_fini_t g_disk_fini; |
64static g_start_t g_disk_start; 65static g_ioctl_t g_disk_ioctl; 66static g_dumpconf_t g_disk_dumpconf; |
67 68struct g_class g_disk_class = { 69 .name = "DISK", 70 .init = g_disk_init, 71 .fini = g_disk_fini, |
72 .start = g_disk_start, 73 .access = g_disk_access, 74 .ioctl = g_disk_ioctl, 75 .dumpconf = g_disk_dumpconf, |
76}; 77 78static void 79g_disk_init(struct g_class *mp __unused) 80{ 81 82 mtx_init(&g_disk_done_mtx, "g_disk_done", NULL, MTX_DEF); 83} --- 252 unchanged lines hidden (view full) --- 336 struct g_provider *pp; 337 struct disk *dp; 338 339 if (flag == EV_CANCEL) 340 return; 341 g_topology_assert(); 342 dp = arg; 343 gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); |
344 gp->softc = dp; |
345 pp = g_new_providerf(gp, "%s", gp->name); 346 pp->mediasize = dp->d_mediasize; 347 pp->sectorsize = dp->d_sectorsize; 348 if (dp->d_flags & DISKFLAG_CANDELETE) 349 pp->flags |= G_PF_CANDELETE; 350 pp->stripeoffset = dp->d_stripeoffset; 351 pp->stripesize = dp->d_stripesize; 352 if (bootverbose) --- 95 unchanged lines hidden --- |