From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754039Ab0IFTpA (ORCPT ); Mon, 6 Sep 2010 15:45:00 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:52190 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883Ab0IFTow (ORCPT ); Mon, 6 Sep 2010 15:44:52 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=k4sGfl3QHeBtT9Q1MAck11yEp8DMaefaoRLDwISoHyad/Vdcbgbbx1hjK3k19oZbhA pPBRNgfE5Cm+mwPdyYccjEIesDhmyLYaGcHnJfOKWDUqFxoFWBSVCldaAXHPB95p0ELW CEPdoduavm61uLNzkYT47/HVEc+a5p/8+qbJM= Date: Mon, 6 Sep 2010 12:44:46 -0700 From: Dmitry Torokhov To: Richard Sharpe Cc: "Nicholas A. Bellinger" , Greg KH , linux-scsi , linux-kernel , FUJITA Tomonori , Mike Christie , Christoph Hellwig , Hannes Reinecke , James Bottomley , Jens Axboe , Boaz Harrosh Subject: Re: [RFC 22/22] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module Message-ID: <20100906194446.GA31384@core.coreip.homeip.net> References: <1283160203-6981-1-git-send-email-nab@linux-iscsi.org> <20100905203006.GD18411@core.coreip.homeip.net> <1283723479.556.135.camel@haakon2.linux-iscsi.org> <20100906050816.GD17212@core.coreip.homeip.net> <20100906051703.GA2891@suse.de> <1283750480.556.196.camel@haakon2.linux-iscsi.org> <20100906053845.GG17212@core.coreip.homeip.net> <1283752861.556.200.camel@haakon2.linux-iscsi.org> <20100906062625.GI17212@core.coreip.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 06, 2010 at 07:48:20AM -0700, Richard Sharpe wrote: > On Sun, Sep 5, 2010 at 11:26 PM, Dmitry Torokhov > wrote: > > > > I think what you need is root_device_create() which will allocate a > > device structure and assign ->release() that is implemented outside of > > your module. This way your module may be unloaded even if there are > > outstanding references to tcm_loop_primary device. > > I am embarrassed to admit that scst_local (or whatever its new name > will be) probably has the same fault, as it too was based on > scsi_debug ... > > However, I did a search of the 2.6.24.1 source tree and could not find > any instances of root_device_create() being called nor defined. I just > double and triple checked the spelling. > > Ahhh, I see why. A slightly different search suggests that it is > root_device_register(const char *name). > > From include/linux/device.h: > > static inline struct device *root_device_register(const char *name) > { > return __root_device_register(name, THIS_MODULE); > } > > Was that the one you were thinking of? > Yes, that is the one. I'll blame Greg for inconsistent naming that caused this error :) - we usually have xxx_register() for objects that we already have on hand and xxx_create() (as in device_create) when we want the object to be allocated for us. Thanks. -- Dmitry