Deleted Added
full compact
geom_vinum_drive.c (133983) geom_vinum_drive.c (134407)
1/*-
2 * Copyright (c) 2004 Lukas Ertl
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Lukas Ertl
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/vinum/geom_vinum_drive.c 133983 2004-08-18 20:34:45Z le $");
28__FBSDID("$FreeBSD: head/sys/geom/vinum/geom_vinum_drive.c 134407 2004-08-27 21:32:18Z le $");
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/errno.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/kthread.h>
36#include <sys/libkern.h>

--- 8 unchanged lines hidden (view full) ---

45#include <geom/geom.h>
46#include <geom/vinum/geom_vinum_var.h>
47#include <geom/vinum/geom_vinum.h>
48#include <geom/vinum/geom_vinum_share.h>
49
50void gv_drive_modify(struct gv_drive *);
51
52void
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/errno.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/kthread.h>
36#include <sys/libkern.h>

--- 8 unchanged lines hidden (view full) ---

45#include <geom/geom.h>
46#include <geom/vinum/geom_vinum_var.h>
47#include <geom/vinum/geom_vinum.h>
48#include <geom/vinum/geom_vinum_share.h>
49
50void gv_drive_modify(struct gv_drive *);
51
52void
53gv_config_new_drive(struct gv_drive *d)
54{
55 struct gv_hdr *vhdr;
56 struct gv_freelist *fl;
57
58 KASSERT(d != NULL, ("config_new_drive: NULL d"));
59
60 vhdr = g_malloc(sizeof(*vhdr), M_WAITOK | M_ZERO);
61 vhdr->magic = GV_MAGIC;
62 vhdr->config_length = GV_CFG_LEN;
63
64 bcopy(hostname, vhdr->label.sysname, GV_HOSTNAME_LEN);
65 strncpy(vhdr->label.name, d->name, GV_MAXDRIVENAME);
66 microtime(&vhdr->label.date_of_birth);
67
68 d->hdr = vhdr;
69
70 LIST_INIT(&d->subdisks);
71 LIST_INIT(&d->freelist);
72
73 fl = g_malloc(sizeof(struct gv_freelist), M_WAITOK | M_ZERO);
74 fl->offset = GV_DATA_START;
75 fl->size = d->avail;
76 LIST_INSERT_HEAD(&d->freelist, fl, freelist);
77 d->freelist_entries = 1;
78}
79
80void
53gv_save_config_all(struct gv_softc *sc)
54{
55 struct gv_drive *d;
56
57 g_topology_assert();
58
59 LIST_FOREACH(d, &sc->drives, drive) {
60 if (d->geom == NULL)

--- 442 unchanged lines hidden ---
81gv_save_config_all(struct gv_softc *sc)
82{
83 struct gv_drive *d;
84
85 g_topology_assert();
86
87 LIST_FOREACH(d, &sc->drives, drive) {
88 if (d->geom == NULL)

--- 442 unchanged lines hidden ---