Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 31 Aug 2002 10:52:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 31 Aug 2002 10:52:10 -0400 Received: from dsl-213-023-039-014.arcor-ip.net ([213.23.39.14]:8679 "EHLO starship") by vger.kernel.org with ESMTP id ; Sat, 31 Aug 2002 10:52:09 -0400 Content-Type: text/plain; charset=US-ASCII From: Daniel Phillips To: Keith Owens , neilb@cse.unsw.edu.au Subject: Re: [patch] 2.4.19 Generate better code for nfs_sillyrename Date: Sat, 31 Aug 2002 16:58:20 +0200 X-Mailer: KMail [version 1.3.2] Cc: linux-kernel@vger.kernel.org References: <5810.1030518440@kao2.melbourne.sgi.com> In-Reply-To: <5810.1030518440@kao2.melbourne.sgi.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 27 On Wednesday 28 August 2002 09:07, Keith Owens wrote: > Using strlen() generates an unnecessary inline function expansion plus > dynamic stack adjustment. For constant strings, strlen() == sizeof()-1 > and the object code is better. Patch against 2.4.19. But now the source code is worse. Macro? > diff -urp 2.4.x-xfs-linux/fs/nfs/dir.c 2.4.x-xfs-linux-kdb/fs/nfs/dir.c > --- 2.4.x-xfs-linux/fs/nfs/dir.c Fri Aug 9 16:03:57 2002 > +++ 2.4.x-xfs-linux-kdb/fs/nfs/dir.c Wed Aug 28 16:54:44 2002 > @@ -741,7 +741,7 @@ static int nfs_sillyrename(struct inode > static unsigned int sillycounter; > const int i_inosize = sizeof(dir->i_ino)*2; > const int countersize = sizeof(sillycounter)*2; > - const int slen = strlen(".nfs") + i_inosize + countersize; > + const int slen = sizeof(".nfs")-1 + i_inosize + countersize; > char silly[slen+1]; > struct qstr qsilly; > struct dentry *sdentry; -- Daniel - 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/