Fix disk utilization for md/dm slaves
authorJens Axboe <jens.axboe@oracle.com>
Thu, 1 Oct 2009 09:20:03 +0000 (11:20 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 1 Oct 2009 09:20:03 +0000 (11:20 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diskutil.c

index e90096b..ac2f006 100644 (file)
@@ -236,8 +236,10 @@ static void find_add_disk_slaves(struct thread_data *td, char *path,
 
                /* Should probably use an assert here. slavedu should
                 * always be present at this point. */
-               if (slavedu)
+               if (slavedu) {
+                       slavedu->users++;
                        flist_add_tail(&slavedu->slavelist, &masterdu->slaves);
+               }
        }
 
        closedir(dirhandle);
@@ -543,6 +545,7 @@ void show_disk_util(void)
        flist_for_each_safe(entry, next, &disk_list) {
                flist_del(entry);
                du = flist_entry(entry, struct disk_util, list);
+               du->users--;
                disk_util_free(du);
        }
 }