diff options
author | grog <grog@FreeBSD.org> | 2003-07-01 07:53:54 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 2003-07-01 07:53:54 +0000 |
commit | 080591fcba09ca7bbf7c0d6034cbee293ad1bf87 (patch) | |
tree | 7721710afc5c0cde7a652012cd10ab4000eff252 /sys/dev/vinum | |
parent | 7db05daaf96ec9df87ea27e193f72f6157da39dd (diff) | |
download | FreeBSD-src-080591fcba09ca7bbf7c0d6034cbee293ad1bf87.zip FreeBSD-src-080591fcba09ca7bbf7c0d6034cbee293ad1bf87.tar.gz |
free_drive: Free the drive even if it's referenced. I don't know what
I was smoking when I wrote this stuff, but another fix resulted in
every partition in the system being entered as a "referenced" drive.
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r-- | sys/dev/vinum/vinumconfig.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c index 2c00921..2d172e1 100644 --- a/sys/dev/vinum/vinumconfig.c +++ b/sys/dev/vinum/vinumconfig.c @@ -585,18 +585,13 @@ get_empty_sd(void) void free_drive(struct drive *drive) { - if ((drive->state > drive_referenced) /* real drive */ - ||(drive->flags & VF_OPEN)) { /* how can it be open without a state? */ - LOCKDRIVE(drive); - if (drive->flags & VF_OPEN) { /* it's open, */ - close_locked_drive(drive); /* close it */ - drive->state = drive_down; /* and note the fact */ - } - if (drive->freelist) - Free(drive->freelist); - bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */ - unlockdrive(drive); - } + LOCKDRIVE(drive); + if (drive->flags & VF_OPEN) /* it's open, */ + close_locked_drive(drive); /* close it */ + if (drive->freelist) + Free(drive->freelist); + bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */ + unlockdrive(drive); } /* |