From: "Dan Williams" <dan.j.williams@intel.com>
To: "Timur Tabi" <timur@freescale.com>
Cc: linux-kernel@vger.kernel.org, "Kumar Gala" <kumar.gala@freescale.com>
Subject: Re: Best method for sending messages to user space?
Date: Tue, 21 Oct 2008 13:42:42 -0700 [thread overview]
Message-ID: <e9c3a7c20810211342n6367e7b3q67394506fe0dfc29@mail.gmail.com> (raw)
In-Reply-To: <48FE3A34.5040105@freescale.com>
On Tue, Oct 21, 2008 at 1:23 PM, Timur Tabi <timur@freescale.com> wrote:
> Dan Williams wrote:
>
>> fd = open("/sys/block/md0/md/array_state");
>> do {
>> read(buf, fd, len);
>> act_on_message(buf);
>> select(...); /* wait for next sysfs_notify event */
>> lseek(fd, 0, SEEK_SET); /* seek back so we can read the new state */
>> } while (1);
>
> I meant from the kernel side. I added a call to sysfs_notify(), and I didn't
> see any sysfs entries being created, so I presume I need to set up sysfs before
> I call sysfs_notify(), but I can't figure out what that setup is.
>
sysfs_notify() will not create any files it only operates on
pre-existing attributes created via kobject_{init_and_}add(). See:
http://lxr.linux.no/linux+v2.6.27/drivers/md/md.c#L3473
http://lxr.linux.no/linux+v2.6.27/drivers/md/md.c#L3761
prev parent reply other threads:[~2008-10-21 20:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-21 17:54 Timur Tabi
2008-10-21 18:14 ` Dan Williams
2008-10-21 19:43 ` Timur Tabi
2008-10-21 20:16 ` Dan Williams
2008-10-21 20:23 ` Timur Tabi
2008-10-21 20:42 ` Dan Williams [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=e9c3a7c20810211342n6367e7b3q67394506fe0dfc29@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=kumar.gala@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=timur@freescale.com \
/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
all inboxes | Powered by JetHome®