Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934004Ab0KPNTL (ORCPT ); Tue, 16 Nov 2010 08:19:11 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:51584 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933934Ab0KPNTK (ORCPT ); Tue, 16 Nov 2010 08:19:10 -0500 Message-ID: <4CE2849C.2060101@vlnb.net> Date: Tue, 16 Nov 2010 16:18:20 +0300 From: Vladislav Bolkhovitin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5 MIME-Version: 1.0 To: Joe Eykholt CC: Greg KH , Bart Van Assche , Dmitry Torokhov , Boaz Harrosh , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, scst-devel , James Bottomley , Andrew Morton , FUJITA Tomonori , Mike Christie , Vu Pham , James Smart , Andy Yan , Chetan Loke , Hannes Reinecke , Richard Sharpe , Daniel Henrique Debonzi , Linus Torvalds Subject: Re: [PATCH 8/19]: SCST SYSFS interface implementation References: <4CDA6CD4.3010308@panasas.com> <4CDAFE6E.7050200@vlnb.net> <4CDBBE80.40908@panasas.com> <4CDC56F9.9040601@vlnb.net> <20101112012315.GE17097@core.coreip.homeip.net> <4CDEC8D2.8080101@vlnb.net> <20101113235938.GA1827@kroah.com> <20101115184422.GA9566@kroah.com> <4CE19A94.8080504@vlnb.net> <20101115221359.GA9530@kroah.com> <4CE210D3.5060703@cisco.com> In-Reply-To: <4CE210D3.5060703@cisco.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:5ABwKdnV7Up8EPeR8Y0TFmvf7irjAceIUhVuOUzAENB xRZRSk0BHTD1VUB16jPcANfgpzNMu37+QmlCU2yRC5dDv/GwGc 3od866EYPrlJTWMLI7mYU/RP7A0NbRJYQHxZlkOcQwjoc/tY0j RRk5smGVNiiBAwNzJ7SUECYeX9wY7e+PkGAt4zoInybp53Jim2 s5q14dZpw6n8fnIejBNzA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4069 Lines: 94 Joe Eykholt, on 11/16/2010 08:04 AM wrote: >> On Mon, Nov 15, 2010 at 11:39:48PM +0300, Vladislav Bolkhovitin wrote: >>> Greg KH, on 11/15/2010 09:44 PM wrote: >>>> On Mon, Nov 15, 2010 at 06:45:24PM +0100, Bart Van Assche wrote: >>>>> On Sun, Nov 14, 2010 at 12:59 AM, Greg KH wrote: >>>>>> >>>>>> On Sat, Nov 13, 2010 at 08:20:18PM +0300, Vladislav Bolkhovitin wrote: >>>>>>> So, I decided to reimplement it to be completely synchronous. SYSFS >>>>>>> authors did really great job and thanks to the excellent internal SYSFS >>>>>>> design and implementation it is absolutely safe. See: >>>>>>> >>>>>>> [root@tgt ~]# modprobe scst >>>>>>> [root@tgt ~]# cd /sys/kernel/scst_tgt/ >>>>>> >>>>>> Sorry, but no, you can't put this in /sys/kernel/ without getting the >>>>>> approval of the sysfs maintainer. >>>>>> >>>>>> I really don't understand why you are using kobjects in the first place, >>>>>> why isn't this in the main device tree in the kernel, using 'struct >>>>>> device'? >>>>> >>>>> We might have missed something, but as far as we know it has not yet >>>>> been explained in this thread why using 'struct device' would be an >>>>> advantage over using 'struct kobject'. >>>> >>>> It's very simple. >>>> >>>> You want your device to show up in the global device tree in the kernel, >>>> not off to one side, unconnected to anything else. >>>> >>>> Please use 'struct device', it is what you want to do here. >>> >>> But we don't have any device to show up in the global device tree! >> >> Not true at all. >> >>> We don't have any devices in the struct device's understanding at all! >> >> Then create them just like you are doing so for your kobject use. >> >> The first device would be the root one, and then everything trickles >> down from there. >> >> And use configfs for your configuration stuff, that's what it is there >> for, and if it doesn't somehow work properly for you, please work with >> the configfs developers to fix that up. >> >> thanks, >> >> greg k-h > > I don't have any opinion on the above, but I don't see why sysfs can't be > used for configuration as well as its other roles. It seems to me wasteful > to require configfs to be used in order to change configuration when > sysfs works fine for this. > > Here are a couple of existing examples where sysfs is used in a role that > would seem similar to SCST's usage: > > 1) scsi_transport_fc already has an sysfs file, fc_host/vport_create, which > can be written to create new fc_host and scsi_host instances. > > 2) fcoe.ko uses a write to the sysfs file /sys/module/fcoe/parameters/create > to start the protocol on a particular ethernet interface. There's another > file for destroy. > > I'll bet there are other examples in other subsystems, and I don't think > there is anything wrong with the above usages of sysfs. > > I agree with Vladislav's point that configfs doesn't work instead of sysfs > because configs doesn't make it easy for the kernel side to create nodes for > dynamic information like connected initiators and statistics. > So, if the above examples are considered a misuse of sysfs, > SCST would need to use both sysfs and configfs. It would use configfs to > do configuration, and sysfs to display and access the dynamic information > like connected initiators. That seems a minor role for configfs, > which is easily handled in sysfs as SCST currently does. > > Just my two cents. Thank you, Joe, for those good examples. I may not know for what SYSFS was _originally_ designed, but the current reality is that SYSFS is _widely_ used to both represent the kernel internal configuration as well as to change it. And SCST is just following that. After all, if SYSFS supposed to only represent the kernel internal configuration, why wasn't it from the beginning made read-only? Vlad -- 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/