diff options
author | pjd <pjd@FreeBSD.org> | 2007-05-05 17:12:15 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-05-05 17:12:15 +0000 |
commit | 4e8b8cd34e540dbe8aaf82fa1d7f01cf051c0252 (patch) | |
tree | 7d22237201ddbee7705e00419726c8f2c8affff2 /sys/geom | |
parent | adc7ddd9913f83a3fe4cd2acab943466822f9927 (diff) | |
download | FreeBSD-src-4e8b8cd34e540dbe8aaf82fa1d7f01cf051c0252.zip FreeBSD-src-4e8b8cd34e540dbe8aaf82fa1d7f01cf051c0252.tar.gz |
- Extend disk structure to allow to store disk's serial number, which can be
retrieved via GEOM::ident attribute.
- Bump disk(9) ABI version.
OK'ed by: phk
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_disk.c | 4 | ||||
-rw-r--r-- | sys/geom/geom_disk.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 390cd8f..482226b 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -301,6 +301,8 @@ g_disk_start(struct bio *bp) break; else if (g_handleattr_off_t(bp, "GEOM::frontstuff", 0)) break; + else if (g_handleattr_str(bp, "GEOM::ident", dp->d_ident)) + break; else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_disk_kerneldump(bp, dp); else @@ -408,7 +410,7 @@ disk_alloc() void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_00) { + if (version != DISK_VERSION_00 && version != DISK_VERSION_01) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); diff --git a/sys/geom/geom_disk.h b/sys/geom/geom_disk.h index 9e8b1ef..5e9d1aa 100644 --- a/sys/geom/geom_disk.h +++ b/sys/geom/geom_disk.h @@ -42,6 +42,7 @@ #include <sys/queue.h> #include <sys/_lock.h> #include <sys/_mutex.h> +#include <sys/disk.h> struct disk; @@ -83,6 +84,7 @@ struct disk { u_int d_maxsize; u_int d_stripeoffset; u_int d_stripesize; + char d_ident[DISK_IDENT_SIZE]; /* Fields private to the driver */ void *d_drv1; @@ -99,7 +101,8 @@ void disk_destroy(struct disk *disk); void disk_gone(struct disk *disk); #define DISK_VERSION_00 0x58561059 -#define DISK_VERSION DISK_VERSION_00 +#define DISK_VERSION_01 0x5856105a +#define DISK_VERSION DISK_VERSION_01 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ |