From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbZEUKGs (ORCPT ); Thu, 21 May 2009 06:06:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752116AbZEUKGk (ORCPT ); Thu, 21 May 2009 06:06:40 -0400 Received: from mail-fx0-f158.google.com ([209.85.220.158]:54016 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbZEUKGj convert rfc822-to-8bit (ORCPT ); Thu, 21 May 2009 06:06:39 -0400 MIME-Version: 1.0 In-Reply-To: <4A14E836.5090302@kernel.org> References: <1242865694-2100-1-git-send-email-ebiederm@xmission.com> <4A14E836.5090302@kernel.org> From: Kay Sievers Date: Thu, 21 May 2009 12:06:18 +0200 Message-ID: Subject: Re: [PATCH 01/20] sysfs: Implement sysfs_rename_link To: Tejun Heo Cc: "Eric W. Biederman" , Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Cornelia Huck , linux-fsdevel@vger.kernel.org, Benjamin Thery , Daniel Lezcano , "Eric W. Biederman" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Kay From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Subject: Re: [PATCH 01/20] sysfs: Implement sysfs_rename_link Date: Thu, 21 May 2009 12:06:18 +0200 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: "Eric W. Biederman" , 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: Tejun Heo Return-path: Received: from mail-fx0-f158.google.com ([209.85.220.158]:54016 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbZEUKGj convert rfc822-to-8bit (ORCPT ); Thu, 21 May 2009 06:06:39 -0400 In-Reply-To: <4A14E836.5090302@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 on= e > used in device rename. =C2=A0The important difference is that previou= sly > 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? Thanks, Kay -- 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