svn commit: r241065 - head/sys/boot/common

Andrey V. Elsukov ae at FreeBSD.org
Sun Sep 30 07:52:41 UTC 2012


Author: ae
Date: Sun Sep 30 07:52:40 2012
New Revision: 241065
URL: http://svn.freebsd.org/changeset/base/241065

Log:
  Fix disk_cleanup() to work without DISK_DEBUG too.

Modified:
  head/sys/boot/common/disk.c

Modified: head/sys/boot/common/disk.c
==============================================================================
--- head/sys/boot/common/disk.c	Sun Sep 30 07:51:57 2012	(r241064)
+++ head/sys/boot/common/disk.c	Sun Sep 30 07:52:40 2012	(r241065)
@@ -373,7 +373,9 @@ disk_close(struct disk_devdesc *dev)
 void
 disk_cleanup(const struct devsw *d_dev)
 {
+#ifdef DISK_DEBUG
 	struct disk_devdesc dev;
+#endif
 	struct dentry *entry, *tmp;
 
 	STAILQ_FOREACH_SAFE(entry, &opened_disks, entry, tmp) {
@@ -385,10 +387,10 @@ disk_cleanup(const struct devsw *d_dev)
 		dev.d_unit = entry->d_unit;
 		dev.d_slice = entry->d_slice;
 		dev.d_partition = entry->d_partition;
-		STAILQ_REMOVE(&opened_disks, entry, dentry, entry);
 		DEBUG("%s was freed => %p [%d]", disk_fmtdev(&dev),
 		    entry->od, entry->od->rcnt);
 #endif
+		STAILQ_REMOVE(&opened_disks, entry, dentry, entry);
 		if (entry->od->rcnt < 1) {
 			if (entry->od->table != NULL)
 				ptable_close(entry->od->table);


More information about the svn-src-all mailing list