mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Keith Owens <kaos@ocs.com.au>, neilb@cse.unsw.edu.au
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] 2.4.19 Generate better code for nfs_sillyrename
Date: Sat, 31 Aug 2002 16:58:20 +0200	[thread overview]
Message-ID: <E17l9hd-0004Ow-00@starship> (raw)
In-Reply-To: <5810.1030518440@kao2.melbourne.sgi.com>

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

      reply	other threads:[~2002-08-31 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28  7:07 Keith Owens
2002-08-31 14:58 ` Daniel Phillips [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17l9hd-0004Ow-00@starship \
    --to=phillips@arcor.de \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®