Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 13:21:26 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209105 - head/sys/kern
Message-ID:  <201006121321.o5CDLQd5010402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Jun 12 13:21:25 2010
New Revision: 209105
URL: http://svn.freebsd.org/changeset/base/209105

Log:
  When make_dev_credf(MAKEDEV_WAITOK) is called, use
  devctl_notify_f(M_WAITOK) for devfs notifications.
  
  Suggested by:	jh
  Reviewed by:	imp, jh
  MFC after:	3 weeks

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Sat Jun 12 13:20:38 2010	(r209104)
+++ head/sys/kern/kern_conf.c	Sat Jun 12 13:21:25 2010	(r209105)
@@ -509,18 +509,18 @@ notify(struct cdev *dev, const char *ev,
 {
 	static const char prefix[] = "cdev=";
 	char *data;
-	int namelen;
+	int namelen, mflags;
 
 	if (cold)
 		return;
+	mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK;
 	namelen = strlen(dev->si_name);
-	data = malloc(namelen + sizeof(prefix), M_TEMP,
-	     (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK);
+	data = malloc(namelen + sizeof(prefix), M_TEMP, mflags);
 	if (data == NULL)
 		return;
 	memcpy(data, prefix, sizeof(prefix) - 1);
 	memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1);
-	devctl_notify("DEVFS", "CDEV", ev, data);
+	devctl_notify_f("DEVFS", "CDEV", ev, data, mflags);
 	free(data, M_TEMP);
 }
 



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