From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753548AbZEUK3k (ORCPT ); Thu, 21 May 2009 06:29:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752802AbZEUK3a (ORCPT ); Thu, 21 May 2009 06:29:30 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:48533 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbZEUK32 convert rfc822-to-8bit (ORCPT ); Thu, 21 May 2009 06:29:28 -0400 To: Kay Sievers Cc: Tejun Heo , Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Cornelia Huck , linux-fsdevel@vger.kernel.org, Benjamin Thery , Daniel Lezcano , "Eric W. Biederman" References: <1242865694-2100-1-git-send-email-ebiederm@xmission.com> <4A14E836.5090302@kernel.org> From: ebiederm@xmission.com (Eric W. Biederman) Date: Thu, 21 May 2009 03:29:20 -0700 In-Reply-To: (Kay Sievers's message of "Thu\, 21 May 2009 12\:06\:18 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=;;;mid=;;;hst=in01.mta.xmission.com;;;ip=76.21.114.89;;;frm=ebiederm@xmission.com;;;spf=neutral X-SA-Exim-Connect-IP: 76.21.114.89 X-SA-Exim-Rcpt-To: kay.sievers@vrfy.org, ebiederm@aristanetworks.com, dlezcano@fr.ibm.com, benjamin.thery@bull.net, linux-fsdevel@vger.kernel.org, cornelia.huck@de.ibm.com, linux-kernel@vger.kernel.org, gregkh@suse.de, akpm@linux-foundation.org, tj@kernel.org X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Kay Sievers X-Spam-Relay-Country: X-Spam-Report: * -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: T_TM2_M_HEADER_IN_MSG * 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% * [score: 0.4899] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 XM_SPF_Neutral SPF-Neutral * 0.4 UNTRUSTED_Relay Comes from a non-trusted relay Subject: Re: [PATCH 01/20] sysfs: Implement sysfs_rename_link X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kay Sievers writes: > On Thu, May 21, 2009 at 07:35, Tejun Heo wrote: >> Eric W. Biederman wrote: >>> +int sysfs_rename_link(struct kobject *kobj, struct kobject *targ, >>> +                     const char *old, const char *new) >>> +{ >>> +     sysfs_remove_link(kobj, old); >>> +     return sysfs_create_link(kobj, targ, new); >>> +} >>> + >> >> Removal and creation are done in the reverse order compared to the one >> used in device rename.  The important difference is that previously >> failed operation was noop whereas it now would remove the current >> link.  I think the old order is correct. > > The target string is composed on-demand, and it always points to the > same kobject and *targ is not needed, right? > > Can't we just change the name of the link, instead of removing and > re-creating the entire thing, and all these issues go away? Good point. It looks like I can generalize sysfs_mv_dir into simply being sysfs_rename. All of the existing logic looks like it can handle that. I will look at doing an incremental patch for that. Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH 01/20] sysfs: Implement sysfs_rename_link Date: Thu, 21 May 2009 03:29:20 -0700 Message-ID: References: <1242865694-2100-1-git-send-email-ebiederm@xmission.com> <4A14E836.5090302@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Tejun Heo , Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Cornelia Huck , linux-fsdevel@vger.kernel.org, Benjamin Thery , Daniel Lezcano , "Eric W. Biederman" To: Kay Sievers Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:48533 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbZEUK32 convert rfc822-to-8bit (ORCPT ); Thu, 21 May 2009 06:29:28 -0400 In-Reply-To: (Kay Sievers's message of "Thu\, 21 May 2009 12\:06\:18 +0200") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Kay Sievers writes: > On Thu, May 21, 2009 at 07:35, Tejun Heo wrote: >> Eric W. Biederman wrote: >>> +int sysfs_rename_link(struct kobject *kobj, struct kobject *targ, >>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 const char *old, const char *new) >>> +{ >>> + =C2=A0 =C2=A0 sysfs_remove_link(kobj, old); >>> + =C2=A0 =C2=A0 return sysfs_create_link(kobj, targ, new); >>> +} >>> + >> >> Removal and creation are done in the reverse order compared to the o= ne >> used in device rename. =C2=A0The important difference is that previo= usly >> failed operation was noop whereas it now would remove the current >> link. =C2=A0I think the old order is correct. > > The target string is composed on-demand, and it always points to the > same kobject and *targ is not needed, right? > > Can't we just change the name of the link, instead of removing and > re-creating the entire thing, and all these issues go away? Good point. It looks like I can generalize sysfs_mv_dir into simply being sysfs_rename. All of the existing logic looks like it can handle that. I will look at doing an incremental patch for that. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html