linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH 3/3] sysfs: add explicit sysfs_cache object
Date: Tue, 09 Sep 2008 13:04:18 +0000	[thread overview]
Message-ID: <48C67452.5080408@tuffmail.co.uk> (raw)
In-Reply-To: <48BFEF3E.3070006@tuffmail.co.uk>

Alan Jenkins wrote:
> diff --git a/udev/test-udev.c b/udev/test-udev.c
> index 07628f7..878c477 100644
> --- a/udev/test-udev.c
> +++ b/udev/test-udev.c
> @@ -62,7 +62,6 @@ static void asmlinkage sig_handler(int signum)
>  
>  int main(int argc, char *argv[])
>  {
> -	struct sysfs_device *dev;
>  	struct udevice *udev;
>  	const char *maj, *min;
>  	struct udev_rules rules;
> @@ -133,18 +132,23 @@ int main(int argc, char *argv[])
>  	sysfs_init();
>  	udev_rules_init(&rules, 0);
>  
> -	dev = sysfs_device_get(devpath);
> -	if (dev = NULL) {
> -		info("unable to open '%s'\n", devpath);
> -		goto fail;
> -	}
> -
>  	udev = udev_device_init();
>  	if (udev = NULL)
>  		goto fail;
>  
> +	/* valgrind can only verify sysfs_device_cleanup() calls if cache is disabled */
> +#if 0
> +	udev->cache = sysfs_cache_init();
> +	if (udev->cache = NULL)
> +		goto fail;
> +#endif
>   

Sorry, I didn't test these patches properly for performance.  It's right
to disable the cache in udev-test, but then I forgot to enable the cache
in udevd :-(.

Here's the missing code:

diff --git a/udev/udevd.c b/udev/udevd.c
index 68cf264..b5e5810 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -129,6 +129,11 @@ static int udev_event_process(struct udevd_uevent_msg *msg)
 	udev = udev_device_init();
 	if (udev = NULL)
 		return -1;
+
+	udev->cache = sysfs_cache_init();
+	if (udev->cache = NULL)
+		return -1;
+
 	strlcpy(udev->action, msg->action, sizeof(udev->action));
 	sysfs_device_set_values(udev->dev, msg->devpath, msg->subsystem, msg->driver);
 	udev->devpath_old = msg->devpath_old;



      reply	other threads:[~2008-09-09 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 14:22 [PATCH 3/3] sysfs: add explicit sysfs_cache object Alan Jenkins
2008-09-09 13:04 ` Alan Jenkins [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C67452.5080408@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).