openafs.git
13 years agoUse bigger I/O sizes for the memcache
Chas Williams (CONTRACTOR) [Thu, 7 Oct 2010 15:05:50 +0000]
Use bigger I/O sizes for the memcache

There doesn't seem to be a need to limit the rx message size when
using rx_WritevAlloc.  If there arent enough rx buffers to hold
the entire message at once, it will simply return less space.

Change-Id: Ic1e99432c8e4d21c71f831b8d6aeea9f12b1c99c
Reviewed-on: http://gerrit.openafs.org/2943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Tidy up some merge conflicts
Simon Wilkinson [Mon, 11 Oct 2010 19:18:06 +0000]
hcrypto: Tidy up some merge conflicts

There were some (harmless) merge conflicts in the hcrypto Makefile.
Get rid of them.

Change-Id: Iaf67d234d0f9ff24432479b2ae065adb73d5665b
Reviewed-on: http://gerrit.openafs.org/2963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoLINUX: Build fixes for older kernels
Andrew Deason [Thu, 7 Oct 2010 16:04:04 +0000]
LINUX: Build fixes for older kernels

Error and warning fixes for older kernels in osi_compat.h:

 - In afs_posix_test_lock, remove the assignment in the conditional to
   silence a warning

 - Call getsockopt for kernel_getsockopt, instead of setsockopt

 - Missing end brace in afs_try_to_freeze

 - Prototype find_exported_dentry, since Linux doesn't give us one

Change-Id: Iae56bb0b0405bfd23dfd68a22c1d7922663b1442
Reviewed-on: http://gerrit.openafs.org/2946
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Don't call gettimeofday for every packet ack
Simon Wilkinson [Tue, 5 Oct 2010 20:21:38 +0000]
rx: Don't call gettimeofday for every packet ack

Every time we receive an ACK packet, we call gettimeofday() for
every entry in the transmit queue that's permanently ack'd by that
packet. Instead, just make a note of the time when we start
processing the packet queue, and use it for every packet in the
queue.

This shaves around 5% off rxperf's runtime with a window size of 128.

Change-Id: I65c705c575c4a470b49390e7efca33c279a3133c
Reviewed-on: http://gerrit.openafs.org/2956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Build hcrypto shared library
Jeffrey Altman [Mon, 11 Oct 2010 19:11:52 +0000]
Windows: Build hcrypto shared library

Build a single afshcrypto.dll shared library on Windows.
There are no lwp vs pthread differences on Windows due to
the use of the Windows random data sources.

Change-Id: I02e4d7ee437440433a983f3eb361c78ac3cbbca6
Reviewed-on: http://gerrit.openafs.org/2964
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Cleanup build scripts; no include\afs or include\rx
Jeffrey Altman [Mon, 11 Oct 2010 19:00:08 +0000]
Windows: Cleanup build scripts; no include\afs or include\rx

As part of the build system cleanup, minimize the number of
directories in which include\afs and include\rx paths are included
by default.  To acheive this goal the windows openafs dirent.h is
moved from include\afs to include, references whenever possible to
openafs headers included in include\afs or include\rx are prefixed
with afs\ or rx\ as appropriate.

Some source files or directories have a broad range of interdependencies
that make separation quite challenging.  For those directories or files
the inclusion of the path is added at the smallest possible level.
At some point in the future the WINNT\afsd\ headers should be moved
from include\afs to include\WINNT and should be installed there first
and then referenced internally from that location instead of from the
WINNT\afsd directory.  That will permit further cleanup to be performed.

Change-Id: I5e3a9623071c71db2f4445dc43266fdb3dad2c91
Reviewed-on: http://gerrit.openafs.org/2961
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoFix rxperf includes
Simon Wilkinson [Mon, 11 Oct 2010 19:15:04 +0000]
Fix rxperf includes

Don't use raw includes for "rx.h" and friends - instead include them
from the appropriate place in our include tree.

Change-Id: Ic136b20b571bef3f476de02302404d64cc741171
Reviewed-on: http://gerrit.openafs.org/2962
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Indent dpf definition
Simon Wilkinson [Mon, 11 Oct 2010 17:40:41 +0000]
rx: Indent dpf definition

Indent the CPP macros that define dpf() so that it's a little bit
clearer what's going on.

Change-Id: If2ccd637ac063c8400a16725972418224e9c5140
Reviewed-on: http://gerrit.openafs.org/2955
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 11 Oct 2010 18:43:48 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
bf1f62b0a8cf72d32875656a7365f1e14d535dc5
which is described as switch-from-svn-to-git-1605-gbf1f62b

This is locally modified to include the earlier local fix
to sha512.c

Change-Id: I757e636654b713625f7d468da6aa37f1006aaa2a
Reviewed-on: http://gerrit.openafs.org/2954
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoHeimdal: Import rand-w32.c for hcrypto on Windows
Simon Wilkinson [Mon, 11 Oct 2010 18:42:03 +0000]
Heimdal: Import rand-w32.c for hcrypto on Windows

Windows has its own PRNG for hcrypto, so add the necessary file to
our import list.

Change-Id: Iea7a17fa9bfb90b9a9ebd5176936da21b3477bba
Reviewed-on: http://gerrit.openafs.org/2953
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Do not issue RXAFS change RPCs on known RO volumes
Jeffrey Altman [Sat, 9 Oct 2010 07:06:07 +0000]
Windows: Do not issue RXAFS change RPCs on known RO volumes

If the cm_scache_t is known to be on a RO volume, do not permit
RXAFS_xxx RPCs that would attempt to make a change to the volume
to be issued to the file server.  Instead, return CM_ERROR_READONLY
immediately.   This avoids triggering the abort threshold for
the current connection on the file server.

LICENSE MIT

Change-Id: I9c917e60277d281e32e4609d89b541803824251f
Reviewed-on: http://gerrit.openafs.org/2950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoUnix: Rework build system
Simon Wilkinson [Mon, 4 Oct 2010 12:49:16 +0000]
Unix: Rework build system

Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.

The standard Makefile.config  now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.

A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:

foo.o: foo.c
$(AFS_CCRULE) foo.c

foo: foo.o
$(AFS_LDRULE) foo.o

If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:

CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging

A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.

This functionality is now used throughout the tree:
    *) Suffix rules are used wherever possible, removing a number of
       unecessary build rules.
    *) All link steps are replaced with AFS_LDRULE
    *) All standard compile steps are replaced with AFS_CCRULE
    *) Unusal compile steps are defined, as far as possible, int
       terms of the LWP_ PTH_ and SHD_ variables.
    *) The use of $? has been removed entirely, as it makes it
       impossible to provide build rules with dependency information

Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2
Reviewed-on: http://gerrit.openafs.org/2896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agofssync-debug: exec DAFS version if DAFS detected
Andrew Deason [Thu, 29 Jul 2010 16:06:28 +0000]
fssync-debug: exec DAFS version if DAFS detected

If the user requests something that differs depending on whether the
server is DAFS or not, try to exec the DAFS-enabled fssync-debug
(dafssync-debug) for them.

Based on a conversation with Tom Keiser.

Change-Id: If914d63d2eb4605e4d9a9d00af62264ac484c206
Reviewed-on: http://gerrit.openafs.org/2480
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoExtract the .version file when building the srpm file
Phillip Moore [Thu, 7 Oct 2010 23:25:09 +0000]
Extract the .version file when building the srpm file

If you are building the source and binary rpms from a released
tarball, instead of a real git repo, the .version file is required by
build-tools/git-version.  With out this, the version defaults to
UNKNOWN, and although the source rpm will build, it won't compile.

Change-Id: I787b051d5150c65a0d71ac38b30f32e1c560c4b3
Reviewed-on: http://gerrit.openafs.org/2948
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRevert "FBSD: in lookup, when ISDOTDOT, unlock dvp"
Ben Kaduk [Fri, 8 Oct 2010 04:20:57 +0000]
Revert "FBSD: in lookup, when ISDOTDOT, unlock dvp"

This reverts commit 96e433aebdd5699f02c205df2cce38927cd19a88.

It was not properly tested, fails to compile on some systems,
and destabilizes the client.

Change-Id: I80b08013c9f2d060ab7ed5a18d57311701aa8b88
Reviewed-on: http://gerrit.openafs.org/2951
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdded missing CLI argument dropped during last commit.
Phillip Moore [Tue, 5 Oct 2010 20:10:19 +0000]
Added missing CLI argument dropped during last commit.

Oops -- when removing the -cell arguments to the bos commands, the
"admin" username argument to "bos adduser" was mistakenly removed as
well.

Change-Id: If5136869c7d2bff3340018a3110fd5408750e5a6
Reviewed-on: http://gerrit.openafs.org/2940
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFBSD: in lookup, when ISDOTDOT, unlock dvp
Ben Kaduk [Wed, 6 Oct 2010 03:30:35 +0000]
FBSD: in lookup, when ISDOTDOT, unlock dvp

Keeping dvp locked when vp is its parent can lead to deadlock.
Always unlock dvp, not just for 6 and earlier.

Change-Id: I26a60188d39ccd24b4db7479c57a525bb37618e9
Reviewed-on: http://gerrit.openafs.org/2942
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: do not leak cm_volume_t objects from LRU queue
Jeffrey Altman [Tue, 5 Oct 2010 15:32:05 +0000]
Windows: do not leak cm_volume_t objects from LRU queue

The LRU queue is where volume objects are recycled from.
Therefore if they are removed then they must be put back.

Remove extraneous operations from cm_AdjustVolumeLRU().

LICENSE MIT

Change-Id: I1f6aadd0ffb7aeafa013087e4825b3c8d8252a2d
Reviewed-on: http://gerrit.openafs.org/2913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoQuick Start Guide updated for RHEL rpms, and CLI syntax
Phillip Moore [Tue, 5 Oct 2010 16:46:35 +0000]
Quick Start Guide updated for RHEL rpms, and CLI syntax

The names of the RHEL rpms have been updated to reflect what is
actually published on openafs.org, and the CLI syntax of the commands
run using -noauth have had the unnecessary -cell options removed.

Change-Id: I5c03d371c822d1d064660a3b00fb3d1e64bff141
Reviewed-on: http://gerrit.openafs.org/2914
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovolserver: Do not return ENOMEM on AIX from XVolListPartitions
Christof Hanke [Tue, 5 Oct 2010 15:01:41 +0000]
volserver: Do not return ENOMEM on AIX from XVolListPartitions

When calling "vos partinfo" or "vos listpart" towards a server
 running AIX with no partitions attached, it would return a
ENOMEM, because unlike on linux, malloc(0) returns NULL on AIX.
Thus, just don't do any malloc, when we have no partitions anyway.

Change-Id: Id1900e2ab11850ada8b2e91667288576d408014b
Reviewed-on: http://gerrit.openafs.org/2912
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Reduce dependence on call->lock
Simon Wilkinson [Sat, 2 Oct 2010 03:17:56 +0000]
rx: Reduce dependence on call->lock

This patch reduces our dependence on call->lock, by allowing more
of the reader thread to run lock free.  Doing so requires that
call->mode only be set by the reader thread.  As a result, call->mode
can only be set to RX_CALL_ERROR by rxi_CallError().  The mode is
set to RX_CALL_ERROR by the reader thread immediately after regaining
the call->lock when it has been dropped.

Change-Id: Ie9541d8beac2d428526f8b2b4cc0004219e820be
Reviewed-on: http://gerrit.openafs.org/2880
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Fix builds on Irix
Simon Wilkinson [Tue, 5 Oct 2010 00:20:32 +0000]
hcrypto: Fix builds on Irix

The recent hcrypto pullup added a depedence on the errx() function,
which isn't present on Irix. Solve this by pulling in a load more
of libroken, in order to provide this function.

In the long term, libroken should get split out into its own
directory, and the ability to use a previously installed
libroken should be added. For now, this will hopefully get Irix on
its feet again.

Change-Id: I0642f80079e113403cbef6eca03ca652616ddc61
Reviewed-on: http://gerrit.openafs.org/2904
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoIrix: Make compiler less chatty
Simon Wilkinson [Tue, 5 Oct 2010 08:01:00 +0000]
Irix: Make compiler less chatty

Supress a few of our errors from the Irix compiler and linker, so its
output is a little less verbose.

This change suppresses the function declared but not used and
multiple declaration errors that we get due to our static_inline fudge
and the paramater declared but not used errors.

Other error suppression is possible - you just need the number
immediately after the 'cc-' in the build logs to say which number to
add to the -woff line.

Change-Id: I55485ff422feeecbb922e8fd63321605d6a8575c
Reviewed-on: http://gerrit.openafs.org/2908
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoImport of code from heimdal
Heimdal Developers [Tue, 5 Oct 2010 07:20:03 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

Change-Id: I0fda4dcf7c7e06de70636969c2f3242b9de714be
Reviewed-on: http://gerrit.openafs.org/2907
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoYet more imports from libroken
Simon Wilkinson [Tue, 5 Oct 2010 07:19:11 +0000]
Yet more imports from libroken

Even more symbols to keep Irix content

Change-Id: I6af4f0b9af0874a334ec8e5a19ea0650de295d4f
Reviewed-on: http://gerrit.openafs.org/2906
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Kill AFS_LARGEFILES preprocessor symbol
Jeffrey Altman [Tue, 5 Oct 2010 12:31:22 +0000]
Windows: Kill AFS_LARGEFILES preprocessor symbol

All builds define AFS_LARGEFILES so kill the symbol and
discard the !AFS_LARGEFILES source code.

Change-Id: I36a2131e30b24d3d1a8f37f5629795bdd92c6b27
Reviewed-on: http://gerrit.openafs.org/2910
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoKill AFS_64BIT_ENV
Simon Wilkinson [Thu, 30 Sep 2010 12:58:26 +0000]
Kill AFS_64BIT_ENV

The AFS_64BIT_ENV was being pretty much universally defined. So,
remove the definition, and the conditional code that it controlled.
From this point on, all platforms are assumed to be capable of
handling 64bit values.

Change-Id: I3e4bde502af9f33f6998637c288e8fd0898ffa81
Reviewed-on: http://gerrit.openafs.org/2870
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoRevert "util: Add base64 from Heimdal's roken"
Simon Wilkinson [Tue, 5 Oct 2010 12:15:49 +0000]
Revert "util: Add base64 from Heimdal's roken"

This reverts commit d552426b14d5f5befe74958a21bc9375d5312287.

util already has a base64.c, the Windows bits of this are half-baked,
and we need to find a config.h from somewhere so that this builds
cleanly.

Just back it out, until I can do it properly.

Change-Id: Iec3ef4579c8f83c7c00e03ad777489e287bbd2f3
Reviewed-on: http://gerrit.openafs.org/2909
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoImport of code from heimdal
Heimdal Developers [Tue, 5 Oct 2010 00:01:34 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

This import was manually modified to preserve our current local
fix for sha512.c

Change-Id: Ie020beb7324469d33b85ac4c559cc473f2728d19
Reviewed-on: http://gerrit.openafs.org/2903
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoImport yet more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 23:59:43 +0000]
Import yet more files from Heimdal

Import still more files from Heimdal, so that we can try to make
Irix happy once more. Mutter, mutter, mutter.

Change-Id: Ic8f20885fd324ab3698109f75ba41cdf6d0975dd
Reviewed-on: http://gerrit.openafs.org/2902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoHeimdal: Fix 32bit build problems
Simon Wilkinson [Mon, 4 Oct 2010 19:22:50 +0000]
Heimdal: Fix 32bit build problems

The earlier inclusion of sha512 from Heimdal broke the build on
32bit platforms, because this file doesn't flag 64bit constants as
being such.

The correct place for this fix is in Heimdal, and it will be replaced
with a fix from Heimdal as soon as one is available. For now though,
this gets our build going again.

Change-Id: I0de822a933184078c491a16aafef45519fa2bbd2
Reviewed-on: http://gerrit.openafs.org/2901
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agovol: Log ignored dirs that look like partitions
Andrew Deason [Sun, 3 Oct 2010 23:27:19 +0000]
vol: Log ignored dirs that look like partitions

If we see a /vicep*-like directory when we VAttachPartitions, and we
ignore it because it lacks an AlwaysAttach, log that we ignored it.
This may make things less confusing to admins that just try to create
a /vicep* directory and don't know why it doesn't work.

Feature suggested by Jason Edgecombe.

FIXES 128221

Change-Id: I0802f914658c7df413b22b3726a5085f1b646266
Reviewed-on: http://gerrit.openafs.org/2893
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoutil: Add base64 from Heimdal's roken
Simon Wilkinson [Mon, 4 Oct 2010 14:24:15 +0000]
util: Add base64 from Heimdal's roken

Add the base64 code from libroken into libutil, using the src/external
framework.

Create a new, non-installed directory, to hold util headers, rather than
continuing to stuff everything into afs/

Change-Id: I6b743a3702c3bb07ac798392475e7e067765f238
Reviewed-on: http://gerrit.openafs.org/2900
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Build fixes
Simon Wilkinson [Mon, 4 Oct 2010 15:01:55 +0000]
hcrypto: Build fixes

Fix the hcrypto build to deal with the changes introduced by the
latest import from Heimdal

Change-Id: I2effebffb6df2fdb351d070f8ea06ecf01aab46e
Reviewed-on: http://gerrit.openafs.org/2899
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 4 Oct 2010 13:25:11 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

Change-Id: I90eb6752000d6794e830a704adcf367928b05a98
Reviewed-on: http://gerrit.openafs.org/2898
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 14:18:02 +0000]
Add more files from Heimdal

Add the base64 implementation from libroken, and the n-fold.c file
from libkrb5 to the list of source files that we import from Heimdal.

It also pulls in the new sha512.c and validate.c files which are now
necessary to complete a userspace hcrypto build.

This patch will fail to build until the build fixes from the subsequent
change are applied.

Change-Id: I60a691d0ccebd6d6bfb823856f79b59670eb86ec
Reviewed-on: http://gerrit.openafs.org/2897
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: Restore saved CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 11:33:24 +0000]
configure: Restore saved CFLAGS

When we test for whether the C compiler can take the
-fno-strength-reduce flag, we add the flag to CFLAGS to do so.
However, we were not restoring the old value of this flag when we
completed the test, and so we were always setting -fno-strength-reduce
in the userspace compile.

Previously, this was harmless, as we always overwrote CFLAGS, but if
we're moving to a world where we honour the user's setting of CFLAGS,
we need to not leak changes in this way.

Change-Id: I029c9fe91132ced34867445afe673761a597ccbe
Reviewed-on: http://gerrit.openafs.org/2894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: Don't let autoconf pick our CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 12:45:53 +0000]
configure: Don't let autoconf pick our CFLAGS

If the user hasn't specified CFLAGS on the command line to
./configure, then autoconf will set them to -g -O2 if the compiler
supports those options.

For compatibility with what OpenAFS has always done, and to let us
manually set optimisation and debugging flags later, disable this
behaviour.

Change-Id: Ic78d5f824433d94d76f16c107af3488132d57155
Reviewed-on: http://gerrit.openafs.org/2895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agovos release: Force full dump on RO_DONTUSE sites
Andrew Deason [Fri, 10 Sep 2010 20:52:34 +0000]
vos release: Force full dump on RO_DONTUSE sites

When releasing a volume, currently we perform an incremental dump on
RO_DONTUSE sites if the volume exists on the remote site. Since
RO_DONTUSE implies that we do not expect a site to exist there, delete
the extant volume if we find one and force a full dump.

If we perform an incremental dump, we run the risk of incrementally
dumping to a temporary volume that the administrator is not aware of,
and doesn't have any actual data but has a last update time late
enough that it may be missing some data after the incremental dump. So
to avoid that, force a full dump every time.

Change-Id: If751a66d6e1499b5d6f67457ae28277a6200c53a
Reviewed-on: http://gerrit.openafs.org/2731
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agosin_family is not network order
Chas Williams (CONTRACTOR) [Sun, 3 Oct 2010 18:35:46 +0000]
sin_family is not network order

sin_family isnt sent over the network and therefore doesnt need
htons().  sin_family is essential the same as domain, and no one
does socket(htons(AF_INET), ...)

Change-Id: Ie0e2396f78e0934d49aeeacfc9c5ffe98df211b6
Reviewed-on: http://gerrit.openafs.org/2891
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRemove duplicate rx_stats targets in libuafs Makefile
Marc Dionne [Sun, 3 Oct 2010 18:35:20 +0000]
Remove duplicate rx_stats targets in libuafs Makefile

The libuafs part of commit 4346144b was not needed, rx_stats was
already in the Makefile.  Harmless, but generates warnings.

Revert the libuafs portion of that commit.

Change-Id: I14d64445c9690bc6d69881c6bd6c00c4670895f3
Reviewed-on: http://gerrit.openafs.org/2892
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx stats atomic inclusion needs kmutexes for emulation
Derrick Brashear [Sun, 3 Oct 2010 06:02:22 +0000]
rx stats atomic inclusion needs kmutexes for emulation

for platforms with no native atomics we use a mutex. well,
fine, but without defining kernel mutexes, that doesn't work so
well.

Change-Id: Ia85e24aad8684a3855511de9548acee4ab86e83e
Reviewed-on: http://gerrit.openafs.org/2890
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Ensure that cm_NameI errors are acted upon promptly
Jeffrey Altman [Wed, 15 Sep 2010 23:06:22 +0000]
Windows: Ensure that cm_NameI errors are acted upon promptly

There are many cases in the SMB server where an error from cm_NameI()
was either ignored or not acted upon until several other operations
are performed that could result in the same error being repeated.
This is a mistake which did not have negative side effects until
additional checks for callback status were added recently.

At present, if a CM_ERROR_ACCESS error is returned and ignored,
subsequent attempts to operate on the same cm_scache_t will result
in additional queries to the file server that will also end in an
abort response.  This can trigger the file server to delay responses
to the client.

This patchset ensures that all cm_NameI() errors are acted upon
promptly.

LICENSE MIT

Change-Id: Ie334b624cc2b28f2c2a37787b5edef9d37cdb041
Reviewed-on: http://gerrit.openafs.org/2887
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Fix Parent(path) computation to permit mp and symlink creation
Jeffrey Altman [Wed, 15 Sep 2010 23:01:06 +0000]
Windows: Fix Parent(path) computation to permit mp and symlink creation

The parent path computation was leaving trailing slashes on the
path names which prevented the creation of mount points and symlinks
when UNC paths were used that contained mount points.

LICENSE MIT

Change-Id: I50cba9cb8a2b0ad45f84995d05f368052be683cc
Reviewed-on: http://gerrit.openafs.org/2886
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoConditionalize include of string.h in rx_stats.c
Marc Dionne [Sun, 3 Oct 2010 00:32:05 +0000]
Conditionalize include of string.h in rx_stats.c

Linux doesn't have <string.h>, it's in the linux subdirectory.  But
it is already included by sysincludes.h, so it should not be needed
here.

Change-Id: I017c374e7b6d47e900ec73b40a36183a3f23f35c
Reviewed-on: http://gerrit.openafs.org/2888
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoLinux: correct use of atomic_add and atomic_sub functions
Marc Dionne [Sun, 3 Oct 2010 01:02:23 +0000]
Linux: correct use of atomic_add and atomic_sub functions

The rx_atomic_add and rx_atomic_sub functions have arguments
reversed compared to the linux atomic_add and atomic_sub.

Adjust the macros to flip the arguments when calling them

Change-Id: I6d58c8f0ac8ccf09e62c9d3921b9f3ae50ca94c9
Reviewed-on: http://gerrit.openafs.org/2889
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Fix RXDEBUG_PACKET builds
Jeffrey Altman [Sat, 2 Oct 2010 15:43:03 +0000]
Rx: Fix RXDEBUG_PACKET builds

Commit 37946ee1739aa22cb2f7330a37504d33a7733c9a unintentionally
broke RXDEBUG_PACKET builds.  Fix it.

Change-Id: I833109b8e35f2f3487fe2865856c7f37cd31e0c2
Reviewed-on: http://gerrit.openafs.org/2882
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: raise rx_minPeerTimeout to 20ms
Jeffrey Altman [Sat, 2 Oct 2010 03:47:11 +0000]
Rx: raise rx_minPeerTimeout to 20ms

At 2ms it is possible for the packet we are sending to be resent
just about immediately as the retryTime computation occurs before
the send takes place and not afterwards.  If the network send blocks,
the retryTime may have already expired.

We do not want rx_minPeerTimeout to be too large though because the
value will end up being used as the backoff time period when the
actual RTT for the connection is less than the rx_minPeerTimeout
value.  Extensive testing shows 20ms to be an adequate compromise
that avoids the vast majority of unnecessary resends without
unnecessarily slowing down the connection if a packet is in fact
lost.

Change-Id: I87248ec1cff6a4d0862da0239d4c203024a783b6
Reviewed-on: http://gerrit.openafs.org/2881
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: When call receive is done, send ack all packet
Jeffrey Altman [Thu, 30 Sep 2010 14:48:58 +0000]
Rx: When call receive is done, send ack all packet

When all of the packets for a call have been received,
immediately send an ack all packet to the peer.  This permits
the peer to free the contents of the transmit queue and cancel
all pending resend events.

Change-Id: Ic06ccaca6f0c5e2f770c5c45c84f7fc155207bcf
Reviewed-on: http://gerrit.openafs.org/2871
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
Jeffrey Altman [Wed, 22 Sep 2010 23:36:03 +0000]
Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex

Add a new global mutex rx_refcnt_mutex to protect the conn->refCount
and call->refCount in place of relying upon the conn->conn_data_lock
and the call->lock.

This will relieve some lock contention with rx_ReceivePacket().

Change-Id: Iebc04a87149a9fe69a7e312e8968b08c2e94148d
Reviewed-on: http://gerrit.openafs.org/2837
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agodarwin kernel atomics
Derrick Brashear [Sat, 2 Oct 2010 16:43:36 +0000]
darwin kernel atomics

actually enable atomics for the darwin kernel, whose API is
just slightly different

Change-Id: I566149428d253806c4546fa0c5a3f96e8098c4eb
Reviewed-on: http://gerrit.openafs.org/2884
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoadd rxstats to kernel
Derrick Brashear [Sat, 2 Oct 2010 16:59:46 +0000]
add rxstats to kernel

add split out rxstats module to kernel

Change-Id: Ibdc721f19a63c58604a56b0099d0c52161d3b00c
Reviewed-on: http://gerrit.openafs.org/2885
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoadd option to rxperf to use rx_Readv() instead of rx_Read()
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:40:16 +0000]
add option to rxperf to use rx_Readv() instead of rx_Read()

rx_Readv() is a bit "faster" than rx_Read() and typically used by most
afs transaction.

server% rxperf server
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:            2073 msec

server% rxperf server -v
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:             983 msec

Change-Id: I27b06dbbb61f2bc34fa91bcda3c6e046c787ff62
Reviewed-on: http://gerrit.openafs.org/2877
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus
Jeffrey Altman [Sat, 2 Oct 2010 04:49:38 +0000]
Windows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus

RXAFS_GetVolumeStatus can return VNOVOL, VMOVED, etc.  In order to
process them and update volume state a fid must be passed to cm_Analyze().
Use the volume root fid.

LICENSE MIT

Change-Id: Ia6115a17aae06144277271048e8287e5ad52ff2a
Reviewed-on: http://gerrit.openafs.org/2883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoProvide an abstract thread pool object
Andrew Deason [Thu, 11 Mar 2010 16:43:54 +0000]
Provide an abstract thread pool object

Add some routines to maintain a pool of threads, for working through a
Vwork_queue.

This adds the afs_tp* series of functions. Originally written by
Tom Keiser.

Change-Id: I8735aa14ca6622ae0eca7a7589e69b0f3b3daf08
Reviewed-on: http://gerrit.openafs.org/1863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoProvide an abstract work queue object
Andrew Deason [Thu, 11 Mar 2010 16:39:56 +0000]
Provide an abstract work queue object

Add some routines for specifying chunks of work to be done. The idea
is to be able to pass these to different threads, and specify
dependencies between them, wait on them completing, etc.

This adds the afs_wq* family of functions. Originally written by Tom
Keiser.

Change-Id: If556cf4da12de8c4be1e53376d85d791584ae177
Reviewed-on: http://gerrit.openafs.org/1862
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoexempt instant timeouts from mtu discovery
Derrick Brashear [Fri, 1 Oct 2010 03:57:11 +0000]
exempt instant timeouts from mtu discovery

if we set lastReceiveTime to 0 to hint that no net, honor that here as
"just time out"

Change-Id: Ifb06fad782669649027841e3930ff94600b6c900
Reviewed-on: http://gerrit.openafs.org/2875
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoDAFS: Raise LogLevel for per-chain vol stats
Andrew Deason [Tue, 14 Sep 2010 14:45:10 +0000]
DAFS: Raise LogLevel for per-chain vol stats

Only report detailed per-chain volume statistics on shutdown/SIGXCPU
if LogLevel is 125 (or 25 for smaller per-chain stats). If a
fileserver is configured with a large -vhashsize, printing out stats
for each chain can take awhile and use up a nontrivial amount of disk
space for logging, so only print out these stats if we're asked for
them.

Change-Id: Iceb38e29ab40958e05f3cf146687f679bd0f061c
Reviewed-on: http://gerrit.openafs.org/2759
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agorename some variables in rxperf
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:58:52 +0000]
rename some variables in rxperf

sendtimes and recvtimes are actually the data byte counts to be
exchanged during an rpc test not an iteration count as implied
by their names

Change-Id: I3d567aacf1ab1d25fda20e48a6bbb68a63330230
Reviewed-on: http://gerrit.openafs.org/2876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: --with-linux-kernel-packaging should default to disabled
Chas Williams (CONTRACTOR) [Wed, 29 Sep 2010 22:21:25 +0000]
configure: --with-linux-kernel-packaging should default to disabled

the test for this build feature is reversed.  by default, the value for
with_linux_kernel_packaging will not be defined which makes the existing
test pick MPS='SP' instead of LINUX_WHICH_MODULES.  based on the configure
help messages, this would appear to be an opt-in not an opt-out.

...
Optional Packages:
...
  --with-linux-kernel-packaging
                          use standard naming conventions to aid Linux kernel
                          build packaging (disables MPS, sets the kernel
                          module name to openafs.ko, and installs kernel
                          modules into the standard Linux location)
...

Change-Id: Ie16fba165e6c85b7ecbce887badb9ffc06a3a7a8
Reviewed-on: http://gerrit.openafs.org/2869
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoafsd's -mem_alloc_sleep is obselete -- update documentation
Chas Williams (CONTRACTOR) [Thu, 30 Sep 2010 18:27:35 +0000]
afsd's -mem_alloc_sleep is obselete -- update documentation
to reflect this.

Change-Id: Ife0f4a2582fe535d7c977d0ca24f92e314459386
Reviewed-on: http://gerrit.openafs.org/2874
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: document the limits of -vhashsize
Andrew Deason [Thu, 2 Sep 2010 18:11:32 +0000]
DAFS: document the limits of -vhashsize

You can only specify a -vhashsize between 6 and 28 (inclusive).
Document that in the dafileserver man page.

Change-Id: I44d1c71f4ff303174e8aebf74b0b9075c07bc8b4
Reviewed-on: http://gerrit.openafs.org/2650
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolinux define ucontext properly
Derrick Brashear [Wed, 29 Sep 2010 18:15:24 +0000]
linux define ucontext properly

ucontext requires glibc version info to engage.
glibc info comes from features.h, which if we include afs_sysnames.h,
we get... so, let's swap these.

Change-Id: I26e5554f2c5c5f9f8a74fb591efdfdc1f6ae7257
Reviewed-on: http://gerrit.openafs.org/2868
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Don't have different args for rxi_FreeCall
Simon Wilkinson [Tue, 28 Sep 2010 23:21:43 +0000]
rx: Don't have different args for rxi_FreeCall

rxi_FreeCall changes its number of arguments depending on whether
locks are enabled or not. That's a little bit nasty to read, so just
change it so that it always takes two arguments, and ignores the
second when it doesn't need it.

Change-Id: I5f869bea9bcf01bac16d8c5eec93373788d17978
Reviewed-on: http://gerrit.openafs.org/2863
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Make statistics interface use Atomics
Simon Wilkinson [Tue, 28 Sep 2010 23:11:53 +0000]
rx: Make statistics interface use Atomics

Make the rx_statistics statistics gathering infrastructure use
atomics for all of its counters. This significantly reduces
lock contention. However, it also (potentially) changes the format
of the rx_stats variable which has been used by callers in the past.

To simplify this process, and to aid with future changes, we remove
direct access to rx_stats. Instead, two additional API functions
rx_GetStatistics and rx_FreeStatistics are provided. These give the
caller access to an 'normal' rx_statistics structure.

Tom Keiser has suggested that we should explore using thread-local
statistics structures, and just aggregating them when we are asked
to report. This is a fine idea, and is equally possible with the
new interface that this patch introduces.

Change-Id: I859cea8f7354a655be007b95fa8a61f995308b35
Reviewed-on: http://gerrit.openafs.org/2862
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Use atomics for rxi_AllocSize and rxi_AllocCnt
Simon Wilkinson [Tue, 28 Sep 2010 23:15:37 +0000]
rx: Use atomics for rxi_AllocSize and rxi_AllocCnt

More atomics for RX statistics counters. Less lock contention.

Change-Id: I55202d2d54323448f7bc191aab03ace976fac962
Reviewed-on: http://gerrit.openafs.org/2861
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Make nWaiting and nWaited atomic
Simon Wilkinson [Tue, 28 Sep 2010 23:06:45 +0000]
rx: Make nWaiting and nWaited atomic

Make the nWaiting and nWaited counters atomic, and get rid of the
mutex which used to protect them.

Change-Id: I0c4d8f1df1860baa2bb189ea77bf20ee9f2066f7
Reviewed-on: http://gerrit.openafs.org/2860
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Add rx_NewThreadId function
Simon Wilkinson [Tue, 28 Sep 2010 22:48:50 +0000]
rx: Add rx_NewThreadId function

The fileserver and the fsync server were locking an internal RX
mutex, and incrementing an internal counter in order to obtain fake
pthread thread IDs. Instead of letting them muck around in the
internals of RX, provide an API that can be called to obtain a
ThreadId counter, and use that API throughout the code.

Change-Id: I68f41d1486cdafeb757da2c0df899ae1ca2b2bfc
Reviewed-on: http://gerrit.openafs.org/2859
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Add atomic operations code
Simon Wilkinson [Tue, 28 Sep 2010 22:37:54 +0000]
rx: Add atomic operations code

Add support for an atomic type, and atomic operators for RX. This
builds on work which has already been done for Windows, where
InterlockedOperations are used for statistics gathering.

A new opaque type, rx_atomic_t is introduced so that normal arithmetic
operations will fail on atomic data.

An implementation using native atomic methods is provided for Darwin,
Solaris and Windows. A native kernel implementation is used for Linux.
Where OpenAFS is built with a sufficiently modern gcc, gcc's atomic
primitives will be used. Sadly, gcc's builtin operations are not
available for i386, they will only be used with builds the set
-march=i486 (or later).

Otherwise, we fall back to a single mutex which protects all atomic
operations.

Change-Id: I5f69677a80617e3936f82b177cd58250a6dbf31f
Reviewed-on: http://gerrit.openafs.org/2858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Set NTDDI_VERSION when setting _WIN32_WINNT
Asanka Herath [Mon, 30 Aug 2010 19:36:50 +0000]
Windows: Set NTDDI_VERSION when setting _WIN32_WINNT

Change-Id: I65312c35b40dbbb4ea8f0170ea8e961bd93359aa
Reviewed-on: http://gerrit.openafs.org/2866
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoRX: Tidy reader data locking
Simon Wilkinson [Sun, 26 Sep 2010 14:48:54 +0000]
RX: Tidy reader data locking

Data which is accessed only by the reader thread doesn't need to be
protected by call->lock

Remove the call->lock protection where it isn't required, which makes
certain read/write calls lock free.

Stop rx_ResetCall from manipulating reader thread data. This data will
be zero'd and cleared when the reader thread calls rx_EndCall, and
doesn't need to be reset by the Listener thread.

The change which made rx_ResetCall reset reader thread information
was originally part of 559ea99b. It caused race conditions that were
fixed by adding additional lock protection in d0cc6e, 4dadd2 and
423ab97e. This commit reverts portions of all of those changes. It
is safe to not clear the iovc in ResetCall because any NewCall must
be balanced by a corresponding EndCall in the reader thread, and
EndCall does the appropriate freeing of reader elements.

Change-Id: I450469a4591fbe4af34482a2b219708795c57e8e
Reviewed-on: http://gerrit.openafs.org/2856
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoMore FBSD syscall tweaking
Ben Kaduk [Wed, 29 Sep 2010 00:03:25 +0000]
More FBSD syscall tweaking

We're now properly registered in syscalls.master for HEAD
(i.e. proto-9.0) and RELENG_8 (proto-8.2), which means that
afs3_syscall is prototyped in sys/sysproto.h .  Accordingly,
don't declare it in afs_prototypes.h for those cases.

Also add FBSD82_ENV checks for the new syscall-registration code,
and cast afs3_syscall to sy_call_t* for the sysent structure.

Change-Id: I0e7427274b018043c3a6a8ca6181a78a385d9aa2
Reviewed-on: http://gerrit.openafs.org/2864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Limit window size to max acks
Simon Wilkinson [Mon, 27 Sep 2010 22:50:23 +0000]
rx: Limit window size to max acks

The RX ack packet can only acknowledge 255 packets at once. In the
current implementation, this limits our maximum window size to 255,
as we can't acknowledge any packets we receive outside of that window
size.

Change-Id: If12eeb4a71cdf0bcd2a82f86b416e387543b7ea8
Reviewed-on: http://gerrit.openafs.org/2857
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agovolser: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 15:11:18 +0000]
volser: Set but not used variables

Fix instances of variables defined and set but never used in the
volser directory.

Spotted by gcc 4.6

Change-Id: Ibb1896cdde51985d1c14b563f8a6de6cec90403f
Reviewed-on: http://gerrit.openafs.org/2852
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agopam test should return an int in main
Derrick Brashear [Sun, 26 Sep 2010 11:28:46 +0000]
pam test should return an int in main

change things so we conform with the usual prototype for main()

Change-Id: Ia3bfe6bb1b135fdba53ccca1650b0b7223108a27
Reviewed-on: http://gerrit.openafs.org/2850
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoviced, tviced: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 00:40:56 +0000]
viced, tviced: Set but not used variables

Remove or ifdef out some variables that are set but never used.

Spotted by gcc 4.6

Change-Id: I895740680997cff29d96ee5257830531c71711af
Reviewed-on: http://gerrit.openafs.org/2853
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agotubik: minor Makefile cleanups
Marc Dionne [Sat, 25 Sep 2010 19:28:37 +0000]
tubik: minor Makefile cleanups

Rework the install targets for udebug to avoid warnings in the case
where afssrvbindir = bindir

Remove commented out compile line for udebug

Change-Id: I500ba2575e7d71114dbdec704d6b3d22585cfdd3
Reviewed-on: http://gerrit.openafs.org/2851
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Really set UDP buffer size
Simon Wilkinson [Mon, 27 Sep 2010 10:47:51 +0000]
rxperf: Really set UDP buffer size

On Unix, the UDP buffer size has to be set before we open any sockets.
Otherwise, the default (64k) buffer size is used and never changed.

Move the calls to SetUdpBufSize in rxperf.c so that the -u command
line option actually has an effect.

Change-Id: Ic925faabca8264c0359693e97c2ab5b637902797
Reviewed-on: http://gerrit.openafs.org/2855
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoFix rxperf so that it works with pthreads
Simon Wilkinson [Sun, 26 Sep 2010 14:20:22 +0000]
Fix rxperf so that it works with pthreads

*) Don't allocate 512K on the stack
*) Don't pass stack allocated data into pthread_create()

Change-Id: I6a4f70121871bf3b7a62d9ed893a2d15bffc7a21
Reviewed-on: http://gerrit.openafs.org/2854
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoUpdate Debian packaging to 1.5.77-2 release
Russ Allbery [Sat, 25 Sep 2010 23:42:57 +0000]
Update Debian packaging to 1.5.77-2 release

Contains DKMS robustness fixes, improvements to the defaults for the
module build, and cleanup of the openafs-client init script.  Updates
the build system for the new demand-attach binary naming and for the
changes to supported configure options.  Fixes some issues with
afs-newcell.  Forces disabling of the Linux syscall probing in kernel
module builds, since no supported Debian kernel allows this and it
causes problems.  Update debhelper to V8, which allows simplification
of debian/rules and debian/module/rules.

Change-Id: I4db4df873607129548557389f08c7ec1480e7204
Reviewed-on: http://gerrit.openafs.org/2849
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoscout: display fetch and store counts as unsigned
Michael Meffie [Thu, 23 Sep 2010 14:15:57 +0000]
scout: display fetch and store counts as unsigned

Fetches and stores are already defined as unsigned, so format
them as unsigned values when displaying in scout. This fixes
the bug where scout shows those counts as negative values on
busy servers which have been running for a while.

Change-Id: I460172720d76e081ede4381b2718f75386af4285
Reviewed-on: http://gerrit.openafs.org/2843
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Big windows make us sad
Simon Wilkinson [Thu, 23 Sep 2010 16:41:47 +0000]
rx: Big windows make us sad

The commit which took our Window size to 128 caused rxperf to run
40 times slower than before. All of the recent rx improvements have
reduced this to being around 2x slower than before, but we're still
not ready for large window sizes.

As 1.6 is nearing release, reset back to the old, fast, window size
of 32. We can revist this as further performance improvements and
restructuring happen on master.

Change-Id: Ic1de2cf33f42edaf1455b72580110d56fe968a7b
Reviewed-on: http://gerrit.openafs.org/2844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agolibafsrpc depends on rxstat and fsint
Simon Wilkinson [Thu, 23 Sep 2010 14:01:58 +0000]
libafsrpc depends on rxstat and fsint

... in the same way as shlibafsrpc

Change-Id: I02d8c35efadd9c9b865bb91eabd0e5b3c10a115e
Reviewed-on: http://gerrit.openafs.org/2842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoUpdates to the Cache Manager to include NetBSD5 support
Matt Smith [Thu, 16 Sep 2010 20:44:04 +0000]
Updates to the Cache Manager to include NetBSD5 support

LKM currently builds and will mount when forced with the entry point
manually defined. Contents of /afs can be discovered, but when listing
the directory, the system call will not return.

Change-Id: I68ba1897b56613bd4ebbe331eea3140c6a963a7d
Reviewed-on: http://gerrit.openafs.org/2767
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Add build rules to build a pthreaded version
Simon Wilkinson [Thu, 23 Sep 2010 09:42:25 +0000]
rxperf: Add build rules to build a pthreaded version

The pthreaded version of rxperf is much more interesting than the
LWP one now, so add some rules so that Unix can play with it too.

Change-Id: Ia76dd89482c8d62805ed8dfd58a1963e4bf8cc65
Reviewed-on: http://gerrit.openafs.org/2841
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Fix the Unix build again
Simon Wilkinson [Thu, 23 Sep 2010 09:40:02 +0000]
rxperf: Fix the Unix build again

Fix the Unix build of rxperf again

Change-Id: I2c5d43f6f69ef36d703bd73154a1f5ec080a47cd
Reviewed-on: http://gerrit.openafs.org/2840
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd an LWP version of the hcrypto library
Simon Wilkinson [Wed, 22 Sep 2010 08:03:27 +0000]
Add an LWP version of the hcrypto library

hcrypto uses a single pthread mutex, which is only required when
we're running in a pthreaded world (in a cooperative threading world
such as LWP, there's no way that two processes can both access the
Fortuna PRNG at the same time)

So, build an LWP version of hcrypto which just disables the mutexes.

Change-Id: I0b894cfa0d16ba6d16544a4d725191c965ac6e50
Reviewed-on: http://gerrit.openafs.org/2833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoMove des/stats.h to rxkad directory
Simon Wilkinson [Thu, 15 Apr 2010 16:35:37 +0000]
Move des/stats.h to rxkad directory

The structures defined in des/stats.h are rxkad specific, and so
should be handled by an rxkad header file, rather than by something
in the eventually-to-be-removed DES directory.

The structure shouldn't be initialised in libutil. Move initialisation
to rxkad_common, where it is already initialised in the pthread case.

Change-Id: I3de49cfe1752eaa5f273796516e2ff6c289d9533
Reviewed-on: http://gerrit.openafs.org/2576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agotests: Fix objdir builds
Simon Wilkinson [Fri, 17 Sep 2010 21:03:20 +0000]
tests: Fix objdir builds

Fix the tests so that they work when we have a separate build
directory.

Change-Id: I1329a4186b126c84f611c9751fd228b80c80c82c
Reviewed-on: http://gerrit.openafs.org/2828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Add struct rx_identity
Simon Wilkinson [Wed, 15 Sep 2010 10:16:15 +0000]
rx: Add struct rx_identity

Add the rx_identity structure which can be used by rx security
layers to store and return identity information to applications.

A number of helper functions for manipulating rx_identity structures
are also provided.

Change-Id: I64ae2b62a4bc8a401c1ac877f4662c66a39247f8
Reviewed-on: http://gerrit.openafs.org/2827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Add an opaque type
Simon Wilkinson [Thu, 16 Sep 2010 11:48:41 +0000]
rx: Add an opaque type

Add a type to RX to hold counted data chunks, and some helper
functions to assist callers with using that type.

Change-Id: Ia81ceea50e43f6fba101122a085f84776dbf3807
Reviewed-on: http://gerrit.openafs.org/2826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoLink dafssync-debug(8) to fssync-debug(8)
Russ Allbery [Wed, 22 Sep 2010 23:34:42 +0000]
Link dafssync-debug(8) to fssync-debug(8)

The two commands are documented identically for right now, so just link
the dafssync-debug man page to the fssync-debug man page.  Remove the
incorrect statement in the man page that fssync-debug only works with
demand-attach.

FIXES 128166

Change-Id: I812641ad7a345c7f5412c3c97ed1ba393e981639
Reviewed-on: http://gerrit.openafs.org/2836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFix POD errors in fileserver and dasalvager
Russ Allbery [Tue, 21 Sep 2010 23:45:53 +0000]
Fix POD errors in fileserver and dasalvager

Fix missing newlines before =back commands.

Change-Id: If8e65c94f48c271c37c1b4bbec1b17d383c8375d
Reviewed-on: http://gerrit.openafs.org/2831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoUpdate bos create man page for new naming of demand-attach binaries
Russ Allbery [Tue, 21 Sep 2010 21:11:53 +0000]
Update bos create man page for new naming of demand-attach binaries

The demand-attach fileserver binaries now have a "da" prefix.  Adjust
the documentation in the man page for bos create accordingly, and add
the new binaries to SEE ALSO.

Change-Id: Ib70bad87aaf8bfc483ffbfe402db01c178e6c4e4
Reviewed-on: http://gerrit.openafs.org/2830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Add documentation for ktc_ListTokensEx
Simon Wilkinson [Sat, 11 Sep 2010 09:11:57 +0000]
auth: Add documentation for ktc_ListTokensEx

Document ktc_ListTokensEx, and add a stub implementation of the
function for Windows.

Change-Id: Ie168081f1a991fcf13358a5a1eeb8d0b96f5800a
Reviewed-on: http://gerrit.openafs.org/2825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Add dirfd definition for solaris
Simon Wilkinson [Thu, 19 Aug 2010 23:14:49 +0000]
hcrypto: Add dirfd definition for solaris

Add an implementation of dirfd to our local roken implementation for
platforms that don't have one.

Code taken from Heimdal.

Change-Id: I4284c18430b6f49200886f5340191a14dcf34b57
Reviewed-on: http://gerrit.openafs.org/2608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdditional functionality for rxperf
Jeffrey Altman [Wed, 22 Sep 2010 23:28:48 +0000]
Additional functionality for rxperf

Add the ability to initiate multiple pthread threads issuing
calls on the same connection to the server.

Add ability to set max window size.

Add ability to adjust min peer timeout.

Change-Id: I896650b033ae0adfa42d3e5831ff799ca1331bd5
Reviewed-on: http://gerrit.openafs.org/2835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolibuafs: Don't #define user
Simon Wilkinson [Thu, 23 Sep 2010 07:58:21 +0000]
libuafs: Don't #define user

libuafs used to #define user to usr_user, so that any references to
'struct user' would become 'struct usr_user'. However, none of the
kernel code uses struct user, and this #define conflicts with the
definitions in sys/user.h on Linux.

So, just remove it.

Thanks to Russ Allbery for the original problem report.

Change-Id: I7868c8ddade2df626f5ecae597144641dfc551b7
Reviewed-on: http://gerrit.openafs.org/2838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxkad: Make the test suite build again
Simon Wilkinson [Wed, 22 Sep 2010 16:33:26 +0000]
rxkad: Make the test suite build again

Make the rxkad stress test suite build again.

Change-Id: I8ff7aecb768f0f46129f612e8bcbef20d59c8886
Reviewed-on: http://gerrit.openafs.org/2832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Fix so it builds on Unix
Simon Wilkinson [Wed, 22 Sep 2010 18:50:47 +0000]
rxperf: Fix so it builds on Unix

Fix assorted errors in the rxperf utility so that it will build
on Unix.

Change-Id: I8ba4e5e6bc2bab38b38f27f5fae3138a0924caa6
Reviewed-on: http://gerrit.openafs.org/2834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>