Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Sep 2012 07:52:40 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241065 - head/sys/boot/common
Message-ID:  <201209300752.q8U7qex3089727@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209300752.q8U7qex3089727>