aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver/nfs_srvsubs.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-06-14 15:52:00 +0000
committerBruce Evans <bde@FreeBSD.org>1998-06-14 15:52:00 +0000
commit4c4918c9e4dad523790ec0f0d86e8f8286a5e085 (patch)
treeab37d20ebf984e68aab854406b0f8ba7af22cbb0 /sys/nfsserver/nfs_srvsubs.c
parenta525aa3424814c4027aa022de939d7ab0c967086 (diff)
downloadsrc-4c4918c9e4dad523790ec0f0d86e8f8286a5e085.tar.gz
src-4c4918c9e4dad523790ec0f0d86e8f8286a5e085.zip
Avoid an egcs pessimization for 64-bit signed division on i386's.
Pre-2.8 versions of gcc generate a call to __divdi3() for all 64-bit signed divisions, but egcs optimizes them to a shift and fixup when the divisor is a constant power of 2. Unfortunately, it generates a call to __cmpdi2() for the fixup, although all except possibly ancient versions of gcc and egcs do ordinary 64-bit comparisons inline.
Notes
Notes: svn path=/head/; revision=36979
Diffstat (limited to 'sys/nfsserver/nfs_srvsubs.c')
-rw-r--r--sys/nfsserver/nfs_srvsubs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index b53f59d594ab..f256959d695a 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
- * $Id: nfs_subs.c,v 1.60 1998/05/31 19:16:08 peter Exp $
+ * $Id: nfs_subs.c,v 1.61 1998/05/31 20:08:55 peter Exp $
*/
/*
@@ -2011,11 +2011,11 @@ nfs_getcookie(np, off, add)
register struct nfsdmap *dp, *dp2;
register int pos;
- pos = off / NFS_DIRBLKSIZ;
- if (pos == 0) {
+ pos = (uoff_t)off / NFS_DIRBLKSIZ;
+ if (pos == 0 || off < 0) {
#ifdef DIAGNOSTIC
if (add)
- panic("nfs getcookie add at 0");
+ panic("nfs getcookie add at <= 0");
#endif
return (&nfs_nullcookie);
}