- 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
This commit is contained in:
parent
0589353ac7
commit
d0c11f9eb7
@ -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
|
||||
|
@ -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");
|
||||
|
@ -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_ */
|
||||
|
Loading…
Reference in New Issue
Block a user