Don't rely on DIRTY flag to be sure that consumer if open, because

DIRTY flag can be removed in idle process. Use consumer's acw field
instead to avoid opening consumer twice.
This commit is contained in:
Pawel Jakub Dawidek 2004-11-09 23:15:40 +00:00
parent 5e2ccaff7a
commit b36b4bfb55
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137487
2 changed files with 2 additions and 2 deletions

View File

@ -584,7 +584,7 @@ g_mirror_write_metadata(struct g_mirror_disk *disk,
/*
* Open consumer if it wasn't opened and remember to close it.
*/
if ((disk->d_flags & G_MIRROR_DISK_FLAG_DIRTY) == 0) {
if (cp->acw == 0) {
error = g_access(cp, 0, 1, 1);
G_MIRROR_DEBUG(2, "Access %s r%dw%de%d = %d",
cp->provider->name, 0, 1, 1, error);

View File

@ -618,7 +618,7 @@ g_raid3_write_metadata(struct g_raid3_disk *disk, struct g_raid3_metadata *md)
/*
* Open consumer if it wasn't opened and remember to close it.
*/
if ((disk->d_flags & G_RAID3_DISK_FLAG_DIRTY) == 0) {
if (cp->acw == 0) {
error = g_access(cp, 0, 1, 1);
G_RAID3_DEBUG(2, "Access %s r%dw%de%d = %d", cp->provider->name,
0, 1, 1, error);