diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-05-05 17:12:15 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-05-05 17:12:15 +0000 |
commit | d0c11f9eb79e05cff1d2e89b6a65c2c1f54ee78f (patch) | |
tree | 7d22237201ddbee7705e00419726c8f2c8affff2 | |
parent | 0589353ac75537f16a33cd1aad2ea93e7111afb7 (diff) | |
download | src-test2-d0c11f9eb79e05cff1d2e89b6a65c2c1f54ee78f.tar.gz src-test2-d0c11f9eb79e05cff1d2e89b6a65c2c1f54ee78f.zip |
Notes
-rw-r--r-- | share/man/man9/disk.9 | 2 | ||||
-rw-r--r-- | sys/geom/geom_disk.c | 4 | ||||
-rw-r--r-- | sys/geom/geom_disk.h | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/share/man/man9/disk.9 b/share/man/man9/disk.9 index b89773256836..a25134fc0b9c 100644 --- a/share/man/man9/disk.9 +++ b/share/man/man9/disk.9 @@ -172,6 +172,8 @@ natural performance boundaries for most disk technologies. Please see .Pa src/sys/geom/notes for details. +.It Vt char Va d_ident[DISK_IDENT_SIZE] +This field can and should be used to store disk's serial number. .El .Ss Driver Private Data This field may be used by the device driver to store a pointer to diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 390cd8ff37ec..482226b36833 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 9e8b1eff6967..5e9d1aae6c2f 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_ */ |