From: Keith Owens <kaos@ocs.com.au>
To: neilb@cse.unsw.edu.au
Cc: linux-kernel@vger.kernel.org
Subject: [patch] 2.4.19 Generate better code for nfs_sillyrename
Date: Wed, 28 Aug 2002 17:07:20 +1000 [thread overview]
Message-ID: <5810.1030518440@kao2.melbourne.sgi.com> (raw)
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.
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;
next reply other threads:[~2002-08-28 7:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-28 7:07 Keith Owens [this message]
2002-08-31 14:58 ` [patch] 2.4.19 Generate better code for nfs_sillyrename Daniel Phillips
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=5810.1030518440@kao2.melbourne.sgi.com \
--to=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;
as well as URLs for NNTP newsgroup(s).