From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760095AbYENJvI (ORCPT ); Wed, 14 May 2008 05:51:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753059AbYENJu4 (ORCPT ); Wed, 14 May 2008 05:50:56 -0400 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:38066 "EHLO ecfrec.frec.bull.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752363AbYENJuz (ORCPT ); Wed, 14 May 2008 05:50:55 -0400 Message-ID: <482AB615.5030000@bull.net> Date: Wed, 14 May 2008 11:51:17 +0200 From: Benjamin Thery User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Andrew Morton Cc: "Eric W. Biederman" , Randy Dunlap , Greg KH , Al Viro , Greg KH , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Daniel Lezcano , Pavel Emelyanov , "Serge E. Hallyn" , Tejun Heo Subject: Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4 References: <20080512220232.GA16914@kroah.com> <4829A4BD.3020007@bull.net> <20080513164438.GA31563@kroah.com> <20080513201602.GA31578@kroah.com> <24291087.1210713535895.JavaMail.oracle@acsmt301.oracle.com> <20080513220304.b2f5a588.akpm@linux-foundation.org> <20080514022059.2fc883b1.akpm@linux-foundation.org> In-Reply-To: <20080514022059.2fc883b1.akpm@linux-foundation.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Morton wrote: > On Wed, 14 May 2008 02:01:37 -0700 ebiederm@xmission.com (Eric W. Biederman) wrote: > >> Andrew Morton writes: >> >>>> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h >>>> index 7858eac..6e61033 100644 >>>> --- a/include/linux/sysfs.h >>>> +++ b/include/linux/sysfs.h >>>> @@ -20,6 +20,8 @@ >>>> struct kobject; >>>> struct module; >>>> >>>> +extern int kobject_set_name(struct kobject *kobj, const char *name, ...) >>>> + __attribute__((format(printf, 2, 3))); >>> Duplicating the kobject_set_name() declaration in sysfs.h is rather a hack. >> A bit. It really isn't worse then a struct declaration like struct kobject; >> >>> It'd be better to move it into a new header file, included by both >>> sysfs.h and kobject.h. Perhaps there are other declarations which can >>> be moved with it. >> My gut feel says that sysfs.h should include kobject.h instead of the >> other way around. This is also my feeling. To do this, we need to move "struct attributes" related definitions to kboject.h, and fix some .c files that don't include sysfs.h as they should (sysfs.h was included indirectly via kojbect.h in these files: eg kernel/sched.c, fs/partitions/check.c). >> >> However it gets reorganized, it is an entirely separate problem >> from the one this patch sets out to solve and so should go in >> a different patch. >> > > umm, well, actually, it's a problem which your patch introduces, by adding a > new dependency. > > uninlining sysfs_rename_dir() would be a sensible solution. It is inlined only when CONFIG_SYSFS=n. When sysfs is enabled sysfs_rename_dir() is compiled from fs/sysfs/dir.c Uninlining it will require us to find an appropriate .c file to put it in: we can't put it in fs/sysfs/dir.c. It is not built if CONFIG_SYSFS is disabled. -Benjamin -- B e n j a m i n T h e r y - BULL/DT/Open Software R&D http://www.bull.com