Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756148AbYJUUmz (ORCPT ); Tue, 21 Oct 2008 16:42:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751896AbYJUUmq (ORCPT ); Tue, 21 Oct 2008 16:42:46 -0400 Received: from hs-out-0708.google.com ([64.233.178.249]:38697 "EHLO hs-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbYJUUmp (ORCPT ); Tue, 21 Oct 2008 16:42:45 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=f+ikkABK3udaipeAtgwIQ5xQpe10/y0dJ3t51WZeZJ1B4wEmVbm4L/txV8quU519et U31akHW3rwaxlgknlsXwPYoRrW8nRyHaVXGgGZvuQJihqdJhtENQ+LuIC42R1ZQsYl7B IPPDZieagx++th8zOasShw/g+BwV3A0icBa5k= Message-ID: Date: Tue, 21 Oct 2008 13:42:42 -0700 From: "Dan Williams" To: "Timur Tabi" Subject: Re: Best method for sending messages to user space? Cc: linux-kernel@vger.kernel.org, "Kumar Gala" In-Reply-To: <48FE3A34.5040105@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48FE1741.1000502@freescale.com> <48FE30D8.6050705@freescale.com> <48FE3A34.5040105@freescale.com> X-Google-Sender-Auth: 14e0d2f4e8bc65e0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 25 On Tue, Oct 21, 2008 at 1:23 PM, Timur Tabi 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/