summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum/geom_vinum_drive.c
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-08-27 21:32:18 +0000
committerle <le@FreeBSD.org>2004-08-27 21:32:18 +0000
commit440914a8bbf4c64c1720b566ce5b3305d19e305d (patch)
tree3bb475733d4e0addb875ef688b8764386ef27623 /sys/geom/vinum/geom_vinum_drive.c
parent78d5f4b4e2f2d5940eb160941d3ab962b121efca (diff)
downloadFreeBSD-src-440914a8bbf4c64c1720b566ce5b3305d19e305d.zip
FreeBSD-src-440914a8bbf4c64c1720b566ce5b3305d19e305d.tar.gz
Move config_new_drive() to the correct place and rename it to
gv_config_new_drive().
Diffstat (limited to 'sys/geom/vinum/geom_vinum_drive.c')
-rw-r--r--sys/geom/vinum/geom_vinum_drive.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum_drive.c b/sys/geom/vinum/geom_vinum_drive.c
index 12929fb..62bb6f1 100644
--- a/sys/geom/vinum/geom_vinum_drive.c
+++ b/sys/geom/vinum/geom_vinum_drive.c
@@ -50,6 +50,34 @@ __FBSDID("$FreeBSD$");
void gv_drive_modify(struct gv_drive *);
void
+gv_config_new_drive(struct gv_drive *d)
+{
+ struct gv_hdr *vhdr;
+ struct gv_freelist *fl;
+
+ KASSERT(d != NULL, ("config_new_drive: NULL d"));
+
+ vhdr = g_malloc(sizeof(*vhdr), M_WAITOK | M_ZERO);
+ vhdr->magic = GV_MAGIC;
+ vhdr->config_length = GV_CFG_LEN;
+
+ bcopy(hostname, vhdr->label.sysname, GV_HOSTNAME_LEN);
+ strncpy(vhdr->label.name, d->name, GV_MAXDRIVENAME);
+ microtime(&vhdr->label.date_of_birth);
+
+ d->hdr = vhdr;
+
+ LIST_INIT(&d->subdisks);
+ LIST_INIT(&d->freelist);
+
+ fl = g_malloc(sizeof(struct gv_freelist), M_WAITOK | M_ZERO);
+ fl->offset = GV_DATA_START;
+ fl->size = d->avail;
+ LIST_INSERT_HEAD(&d->freelist, fl, freelist);
+ d->freelist_entries = 1;
+}
+
+void
gv_save_config_all(struct gv_softc *sc)
{
struct gv_drive *d;
OpenPOWER on IntegriCloud