openafs.git
11 years agolibafscp: Windows TellMeAboutYourSelf response
Jeffrey Altman [Mon, 12 Nov 2012 02:53:13 +0000]
libafscp: Windows TellMeAboutYourSelf response

The address list and uuid are computed in init_afs_cb().  There
is no need for special Windows processing within TellMeAboutYourSelf.

Change-Id: Ica4d2edb69ac9000713b016996a2c58e8b65ee9c
Reviewed-on: http://gerrit.openafs.org/8429
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibafscp: build as pthreaded for windows
Jeffrey Altman [Mon, 12 Nov 2012 02:52:27 +0000]
libafscp: build as pthreaded for windows

Change-Id: Iaa9515e572178f44deb670a83daba358c2d4dc74
Reviewed-on: http://gerrit.openafs.org/8428
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: afsrpc.dll MAKEDEBUGCALL
Jeffrey Altman [Sun, 11 Nov 2012 04:41:21 +0000]
Windows: afsrpc.dll MAKEDEBUGCALL

Enable debug calls from the pthreaded RX library.

Change-Id: Ie5e98d4408a3eb259e7f5f298f0776931f0d488a
Reviewed-on: http://gerrit.openafs.org/8427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoafs: Pass rx connection to print_internet_address
Andrew Deason [Tue, 30 Oct 2012 18:30:27 +0000]
afs: Pass rx connection to print_internet_address

Make print_internet_address take an rx_connection, so it can print out
more information based on rx info. Currently it does not use the
connection; this commit is just for adding the connection to the
interface, and adjusting all of the callers to cope. There should be
no behavior change.

Change-Id: I410ffe43b7b6fc4d5c82666529c9263969820185
Reviewed-on: http://gerrit.openafs.org/8409
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agofix stale volume info from vos examine (non-dafs)
Michael Meffie [Tue, 30 Oct 2012 14:41:12 +0000]
fix stale volume info from vos examine (non-dafs)

A volume examine on a non-dafs volume server/fileserver can show old
information, including old volume update time, for up to about 20
minutes. The non-dafs volume server reads the volume information
from the volume headers, which are updated by the fileserver only
periodically to avoid excessive i/o.

Before dafs, when the volume server performed a volume examine, the
volume server would send a fssync command to the fileserver with the
request FSYNC_NEEDVOLUME and mode V_READONLY. The fileserver writes
the current memory contents to disk on this fssync command. The
volume server would then attach the volume, reading the current
volume data.

The dafs volume/fileserver avoids this extra i/o by using a new set
of fssync commands to retrieve the volume information from the
fileserver. However, the non-dafs volume server does not use the new
fssync commands and reads the volume headers from disk.

Revert the volume attachment processing for the non-dafs volume
server to request the volume with the V_READONLY mode. This causes
the fileserver to update the volume headers, allowing the volume
server to read the up to date volume header data.

Sadly, this adds another dafs ifdef to the already twisty maze of
passages that all look alike.

This changes the volserver to use the V_READONLY attachment mode
only for the case of getting a single volume, as that what was
done in 1.4.x.

Change-Id: Ibee25bfcfb087e73ccbc17e181a99da49a7751ae
Reviewed-on: http://gerrit.openafs.org/8327
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovol: allow non-dafs volume utils to attach with V_READONLY again
Michael Meffie [Tue, 30 Oct 2012 14:22:40 +0000]
vol: allow non-dafs volume utils to attach with V_READONLY again

Allow non-fileserver, non-dafs, programs to attach volumes with the
V_READONLY mode again. This was lost during the code changes for
dafs.

The caller sends a fssync request to the fileserver, which updates the
on-disk contents of the volume headers, before the caller reads the
volume headers, allowing the caller to have the most recent info about
the volume. The fileserver still has the volume in use.

Later in the attachment process, the inUse check is skipped for the case
of a non-fileserver process which is attaching the volume using the
V_READONLY mode, otherwise the attachment would incorrectly mark the
volume as needing to be salvaged.

Note: The mode checks in VMustCheckOutVolume() are correct. We must
checkout the volume when attaching with the V_READONLY mode. This
fix updates the VShouldCheckInUse(), in which an additional
exception was added to cover the case for V_READONLY mode from a non-
fileserver process.

Note: A check is added in the dafs version of attach to avoid overwriting the
inUse field when a volume utility is attaching a volume in V_READONLY mode.
Currently, V_READONLY is not used by dafs, but this was done to avoid future
errors.

Change-Id: I09d3af1e74087d0627399392e662e5075d41cdeb
Reviewed-on: http://gerrit.openafs.org/8339
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agofileserver: check value of -cb argument
Hans-Werner Paulsen [Fri, 9 Nov 2012 12:48:45 +0000]
fileserver: check value of -cb argument

The value of the -cb argument for the fileserver was not checked correctly.
The fileserver refused to start for any number of callbacks.

Change-Id: I25fe9d81ba20d286f36999a554c94fda4ef7fb2f
Reviewed-on: http://gerrit.openafs.org/8420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: use hKUserMap to read afslogon username
Jeffrey Altman [Thu, 8 Nov 2012 18:26:36 +0000]
Windows: use hKUserMap to read afslogon username

hkTemp is not the correct registry handle.  Use hkUserMap

Change-Id: I44776b6dd46bb0ecac0c729bf80ed9261ddf7a67
Reviewed-on: http://gerrit.openafs.org/8412
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Prevent SMB unitialized variable access
Jeffrey Altman [Thu, 8 Nov 2012 17:20:30 +0000]
Windows: Prevent SMB unitialized variable access

smb_ReceiveNTTranCreate would make use of 'fidp' before it was
allocated.

Change-Id: Ib4a7262ba09f15049f1855535250638c2e5d17a4
Reviewed-on: http://gerrit.openafs.org/8411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Treat invalid AFSFetchStatus as VBUSY
Jeffrey Altman [Thu, 8 Nov 2012 16:29:20 +0000]
Windows: Treat invalid AFSFetchStatus as VBUSY

Modify cm_Analyze() to accept an AFSFetchStatus parameter which
when set is verified for validity.  If the status info is invalid,
then consider the response equivalent to VBUSY and attempt to
query an alternate file server (if any.)   Log the invalid status
info to the Windows Application Event Log as a Warning.

When cm_Analyze() is processing the response of an RPC that returns
multiple AFSFetchStatus structures, pass in the one that corresponds
with the source object.

Change-Id: I84be22f332ff6fd7bc9620347f958538a3412380
Reviewed-on: http://gerrit.openafs.org/8404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_IsStatusValid
Jeffrey Altman [Thu, 8 Nov 2012 15:39:43 +0000]
Windows: cm_IsStatusValid

Break out validity checking for AFSFetchStatus responses into
a new function.

Change-Id: I15d2ed12ed2d9ca9a24d6f717243d823db22d30c
Reviewed-on: http://gerrit.openafs.org/8403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_MergeStatus now returns an error code
Jeffrey Altman [Thu, 8 Nov 2012 05:24:14 +0000]
Windows: cm_MergeStatus now returns an error code

cm_MergeStatus() can fail if the AFSFetchStatus InterfaceVersion
field does not have the value 0x1 as that is the only version that
is defined by the protocol.  The return code will be CM_ERROR_INVAL.
cm_MergeStatus() returns 0 on success.

Update all of the call sites.

Change-Id: Iddf56f68dfa26b0f11744b905a70d7d39ad853d1
Reviewed-on: http://gerrit.openafs.org/8402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoafs: Make last_error always useful
Andrew Deason [Wed, 31 Oct 2012 20:04:55 +0000]
afs: Make last_error always useful

Currently we record last_error as the last getuerror() we got when
failing to read in a slot in UFSGetDSlot. For kernels that do not have
getuerror(), this variable is currently useless, and we do not record
anywhere what the last error received was (besides logging it via
afs_warn).

So, for non-uerror, just record what 'code' we got, so we at least
have something.

Change-Id: Iede39bbeee48ea48f380b788f2968886a831a918
Reviewed-on: http://gerrit.openafs.org/8369
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoafs: Log slot for GetDSlot read errors
Andrew Deason [Wed, 31 Oct 2012 20:02:09 +0000]
afs: Log slot for GetDSlot read errors

When we log that a disk read error occurred during GetDSlot, log which
slot we were trying to read for convenience.

Change-Id: I35ffa94ff31cee735e85542ed9697b5f14180226
Reviewed-on: http://gerrit.openafs.org/8368
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Fix non-TSFPQ rxi_FreePackets
Andrew Deason [Thu, 8 Nov 2012 00:46:24 +0000]
rx: Fix non-TSFPQ rxi_FreePackets

Actually count the number of packets we're given, so we don't bail out
early because num_pkts is 0. Without this, we effectively do not free
most packets for non-pthreads Rx, so e.g. the unix kernel module will
leak memory quite quickly and be very slow.

This was introduced by 170dbb3c.

Change-Id: Id781e37170683c422b40079fdda018be1caddaf3
Reviewed-on: http://gerrit.openafs.org/8401
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: RDR_CleanupFileEntry protect lock release
Jeffrey Altman [Wed, 7 Nov 2012 21:34:23 +0000]
Windows: RDR_CleanupFileEntry protect lock release

Prevent lock release of scp->rw when not held.

Change-Id: I9ed3ca464a7881cd365ebe3560d5a6da22e21c86
Reviewed-on: http://gerrit.openafs.org/8372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: call MIDL_user_allocate instead of calloc
Jeffrey Altman [Tue, 6 Nov 2012 11:39:39 +0000]
Windows: call MIDL_user_allocate instead of calloc

In the RPC service routines do not call calloc() directly.
All memory will be deallocated by a call to MIDL_user_free()
so use MIDL_user_allocate() to perform the allocation.

Modify MIDL_user_allocate() to call calloc() instead of malloc()
to ensure that the memory is initialized to NUL bytes.

Change-Id: I4d458bb5d8888c63040f213550d04f481e98175b
Reviewed-on: http://gerrit.openafs.org/8365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: no more _wcsdup; use wcsdup
Jeffrey Altman [Tue, 6 Nov 2012 11:38:14 +0000]
Windows: no more _wcsdup; use wcsdup

_wcsdup is not mapped by roken.h.  Use wcsdup which is.

Change-Id: I0f6bb3f5465c74ad52f992892fcbc9837c276c0c
Reviewed-on: http://gerrit.openafs.org/8364
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoCatch up to FreeBSD non-MPSAFE deorbit
Ben Kaduk [Wed, 7 Nov 2012 15:08:33 +0000]
Catch up to FreeBSD non-MPSAFE deorbit

All filesystems must have their own locking now.
We have been MPSAFE for quite some time, but the preprocessor macro
"MPSAFE" has been removed and we must catch up in order to compile.

The MNTK_MPSAFE macro has not yet been removed, but it is toothless
now, so we can preemptively stop using it.

Change-Id: I9d9090fd1afc020670a0cf874baacf483fd34915
Reviewed-on: http://gerrit.openafs.org/8366
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoopr: Add Windows stuff for dict.c/h
Simon Wilkinson [Thu, 1 Nov 2012 20:42:58 +0000]
opr: Add Windows stuff for dict.c/h

The NTMakefile changes were omitted from the patch which added
opr/dict.h for Unix. Add them here.

Change-Id: I240b40116aed83dcf232a1d741d0ef7b442bf6f7
Reviewed-on: http://gerrit.openafs.org/8358
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Use MountRoot for Absolute Symlinks
Jeffrey Altman [Thu, 1 Nov 2012 00:59:30 +0000]
Windows: Use MountRoot for Absolute Symlinks

Replace the absolute symlink processing in AFSLocateName().
Implement AFSIsAbsoluteAFSName() to test whether or not the
path is in fact an absolute /afs path by comparing the input
string to the registry MountRoot value which specifies the
case sensitive root path for all absolute symlinks stored
in the AFS cell.

If a symlink target path begins with a directory separator
and is not an absolute afs path name, return an error.

Construct the substitution string using the target path
without the MountRoot prefix.

Add functionality to AFSRedir.sys to read the MountRoot
from the registry and pass it on to AFSRedirLib.sys.

Change-Id: Ie1df24da1e6de257c73dc34c80a75288bad47d29
Reviewed-on: http://gerrit.openafs.org/8353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoconfigure: check for poll()
Derrick Brashear [Thu, 1 Nov 2012 18:15:27 +0000]
configure: check for poll()

if we have code which uses HAVE_POLL, check for poll().

Change-Id: I1baf61541b243f82b3acca112db2cbbca813182b
Reviewed-on: http://gerrit.openafs.org/8357
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoopr: Add dictionary implementation
Simon Wilkinson [Tue, 30 Oct 2012 11:25:02 +0000]
opr: Add dictionary implementation

Add a simple implementation of a dictionary/hash structure based around
opr queues and the jhash hashing function.

Change-Id: I4ae5cafcef377b05c8caa7c455737a992b1d36cd
Reviewed-on: http://gerrit.openafs.org/8355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoopr: Add opr_jhash_int2 function
Simon Wilkinson [Mon, 29 Oct 2012 19:02:03 +0000]
opr: Add opr_jhash_int2 function

Add a function to jhash that can be used to hash a pair of unsigned
integers (or other stuff that can cast to them) without having to build
up an array.

Provide a couple of tests for the new function

Change-Id: I594848f64316fb459eff565933691f560512ca79
Reviewed-on: http://gerrit.openafs.org/8354
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agotests: Fix fallout from cleanup change
Simon Wilkinson [Thu, 1 Nov 2012 17:38:45 +0000]
tests: Fix fallout from cleanup change

The change to cleanup temporary files after tests
(0c3670914a05c7aa33f0b1239ba9cc25f430ed04) broke all attempts
to run the tests using libwrap, as it would cause libwrap to run
the binary named "MAKECHECK=1"

Move the variable defintion before the libwrap invocation to fix this.

Change-Id: I330267c9b53483abccf43d60a7dc8f8d973c3959
Reviewed-on: http://gerrit.openafs.org/8356
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: cm_ConnByServer increment under lock
Jeffrey Altman [Wed, 31 Oct 2012 16:04:50 +0000]
Windows: cm_ConnByServer increment under lock

Incrementing the cm_conn.refCount must be performed while holding
the cm_connLock in order to prevent cm_GCConnections() from
seeing an in-use object as having a zero count.

Change-Id: Ifaa755ef0f04f3bf64223434dfc518bc73d01d4d
Reviewed-on: http://gerrit.openafs.org/8347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_FindVolumeByName refactoring
Jeffrey Altman [Wed, 31 Oct 2012 13:53:57 +0000]
Windows: cm_FindVolumeByName refactoring

The cm_volume allocation within cm_FindVolumeByName() was racy.
Given how locks were obtained and dropped it was possible for two
threads to both determine that a cm_volume_t object needed to be
allocated.  It might even have been possible for two threads to
attempt to allocate the same object.

This refactoring ensures that if a volume cannot be found under
a read lock that a second search is performed under the write lock
in case the object had in fact been allocated during the transition.

Once it is determined that an allocation is required, the cm_volumeLock
is not dropped until the object has been built and inserted into the
name hash table.   This ensures that two threads cannot attempt to
allocate a cm_volume object for the same volume group.

InterlockedIncrement is used to manage the cm_data volume count.

Change-Id: I64c07cbc0f7968c5580478ff33214f67088072f8
Reviewed-on: http://gerrit.openafs.org/8346
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: use cm_GetVolume / cm_PutVolume
Jeffrey Altman [Wed, 31 Oct 2012 13:52:23 +0000]
Windows: use cm_GetVolume / cm_PutVolume

Instead of locally incrementing and decrementing the cm_volume
refCount field use cm_GetVolume and cm_PutVolume.  Doing so makes
it easier to see if there is an imbalance.

Change-Id: Id62e42a74a9b1d9865a00dae177550a93e6e0f08
Reviewed-on: http://gerrit.openafs.org/8345
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Interlocked ops for cell and scache allocation
Jeffrey Altman [Wed, 31 Oct 2012 13:50:34 +0000]
Windows: Interlocked ops for cell and scache allocation

Replace foo++ with InterlockedIncrement for cm_data cell and scache
counters which are used for allocating objects.

Change-Id: I09d2a536ef559d6d5873a3fdead4c8580bc93a0c
Reviewed-on: http://gerrit.openafs.org/8344
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Do not flush dirty bufs to deleted FID
Jeffrey Altman [Wed, 31 Oct 2012 01:54:20 +0000]
Windows: Do not flush dirty bufs to deleted FID

If the FID is known to have been deleted, drop all dirty data
returned from the redirector on the floor.

Change-Id: I8b9a1a69d632d7243bdbcfedb5329558e0004d2e
Reviewed-on: http://gerrit.openafs.org/8343
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolinux: bypass readpages should update nocache read parms
Hartmut Reuter [Thu, 18 Oct 2012 13:38:50 +0000]
linux: bypass readpages should update nocache read parms

the nocache read parms need to have the offset updated during a bypass
readpages request

Change-Id: Iced321e6eeab7fd784c5ccb871fcda7ff9c7493d
Reviewed-on: http://gerrit.openafs.org/8254
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>

11 years agoptserver: Avoid inet_ntoa
Andrew Deason [Tue, 23 Oct 2012 20:47:06 +0000]
ptserver: Avoid inet_ntoa

The ptserver uses inet_ntoa in a few places, such as for calculating
host CPS. This isn't safe in pthreaded environments, so use
afs_inet_ntoa_r instead.

Change-Id: I84cdf606ffd44d2d87c0db509af0950a6547364e
Reviewed-on: http://gerrit.openafs.org/8287
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFix mutex assertion
Simon Wilkinson [Sun, 21 Oct 2012 19:07:44 +0000]
Fix mutex assertion

RX mutexes have two mechanisms for asserting ownership of a mutex:
MUTEX_ISMINE, which returns true if the caller is the owner of the
mutex in question, and osirx_AssertMutex which fires an assertion if
the calling thread doesn't own a specified mutex.

Neither of these work with pthread mutexes on all platforms, and the
kernel support for MUTEX_ISMINE is dubious in places. Because in some
implementations, MUTEX_ISMINE tries to lock the mutex in question, a
failing call to MUTEX_ISMINE can lead to the process holding an
additional, unexpected, lock.

This patch reworks all of this, and uses the new opr mutex framework
so that we can do mutex assertions in userspace, too. We remove the
unsafe MUTEX_ISMINE macro, and replace it with MUTEX_ASSERT which
simply asserts if the specified mutex is not held by the current
thread. osirx_AssertMutex is removed as it is now redundant.
MUTEX_ASSERT will always work in kernel code.

For userspace, we provide opr_mutex_assert, which is implemented using
POSIX error checking mutexes. As error checking mutexes have a runtime
overhead, this is only available when configured with
--enable-debug-locks, the rest of the time calls to opr_mutex_assert are
no-ops.

Change-Id: I285ee2b558389fa3d63b786e4bc4420fa2126c80
Reviewed-on: http://gerrit.openafs.org/8282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Move kernel assertion macros
Simon Wilkinson [Sun, 21 Oct 2012 20:19:40 +0000]
rx: Move kernel assertion macros

Move the kernel assertion macros out of rx_prototypes.h and into
rx_kernel.h. This solves an ordering problem if these macros are to
be used from src/rx/<arch>/*.h

Change-Id: I5f11e0802b3d25c1c32a2c646a35c0b59422ab3d
Reviewed-on: http://gerrit.openafs.org/8283
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agotests: cleanup temporary files
Marc Dionne [Wed, 19 Sep 2012 23:14:31 +0000]
tests: cleanup temporary files

Call the configuration directory cleanup function before exiting
so there are no files left behind, even in case of error.

Add KeyFileExt to the list of files that are removed.

Change-Id: Ie795bef0d44609b36950970244c02a6c6da1a843
Reviewed-on: http://gerrit.openafs.org/8142
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolinux: fix cache bypass applicability function
Hartmut Reuter [Thu, 18 Oct 2012 11:00:18 +0000]
linux: fix cache bypass applicability function

don't allow cache bypass if execsOrWriters is true

don't trigger cache bypass based on being larger than the
"disabled" value of -1.

Change-Id: Ic174b133e5da3e9215465c9c2705c25e81a8beca
Reviewed-on: http://gerrit.openafs.org/8248
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: remove unused afs_set_name inline functions
Marc Dionne [Mon, 29 Oct 2012 23:11:23 +0000]
Linux: remove unused afs_set_name inline functions

These were used in an earlier version of the patch that got merged.

Change-Id: Ifc5ba94392a394d0fb55c31051b4b74211cfc1f0
Reviewed-on: http://gerrit.openafs.org/8332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoAdd opr/lock.h and tidy locking macros
Simon Wilkinson [Sat, 20 Oct 2012 22:14:41 +0000]
Add opr/lock.h and tidy locking macros

The MUTEX_* and CV_* macros leaked from RX a while ago - they mean
that most of the pthreaded tree has a dependency on RX, as well as
further confusing the difference between userspace and kernel.

Tidy all of this up so that we have opr_mutex_* and opr_cv_* macros
to handle portable locking, and use these throughout the userspace
tree. Only kernel code should now use MUTEX_* and CV_*.

Provide opr/lockstub.h as a header that can be used by non-pthreaded
code to easily stub out these functions.

Change-Id: I24be525c7667641134d50561ce7f1e2d752cdf1f
Reviewed-on: http://gerrit.openafs.org/8280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Move transmit queue clearing
Simon Wilkinson [Fri, 26 Oct 2012 14:37:52 +0000]
rx: Move transmit queue clearing

When the client receives a data packet from the server, it means that
the server has completed processing the client's request. This, in turn,
implies that the transmit queue can be cleared. However, we were doing
this with every incoming data packet.

Move the transmit queue clearing to the code which handles the rest of
the data packet, and make the function only run if the transmit queue
is non-empty.

Now that there's no client specific logic in the ReceiveCall section,
clean up this code to reduce duplication.

Change-Id: Ia4f9024720c676cbcc6d8426d4b94a0acded20bc
Reviewed-on: http://gerrit.openafs.org/8301
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Refactor code to acknowledge a whole TX queue
Simon Wilkinson [Fri, 26 Oct 2012 14:23:48 +0000]
rx: Refactor code to acknowledge a whole TX queue

We acknowledge a whole transmit queue whenever an ACKALL packet is
received, or whenever the call changes direction. As the same logic
is used in both locations, pull it out into a common helper function.

Change-Id: Ia91b037c73cc0dd612ebbd0bd38ec171ec7c96a5
Reviewed-on: http://gerrit.openafs.org/8300
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Remove duplicate out of order ACK check
Simon Wilkinson [Fri, 26 Oct 2012 13:55:02 +0000]
rx: Remove duplicate out of order ACK check

Once we've moved the congestion window, there's no going back. So
any ACK packets that attempt to move the window backwards by including
a 'firstPacket' value earlier than the current window position must
be ignored.

However, we check (and ignore) these packets twice. Once in
rxi_ReceivePacket, which only checks in the client side case, and again
in rxi_ReceiveAckPacket, which has a more complete check that runs for
both client and server connections.

Remove the identical check from rxi_ReceivePacket in a continuing effort
to clean up this bit of code.

Change-Id: I090bc289848d0797860f46aec5877ad07fcc9b82
Reviewed-on: http://gerrit.openafs.org/8299
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Remove duplicate security layer check
Simon Wilkinson [Fri, 26 Oct 2012 13:52:46 +0000]
rx: Remove duplicate security layer check

rxi_FindConnection checks that the connection it returns has a
security layer matching that of the incoming packet. Don't duplicate
this check within the rxi_ReceivePacket code.

Change-Id: I03e7d50ecf84f638d8e222d77defc25b8a58627a
Reviewed-on: http://gerrit.openafs.org/8298
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Refactor rxi_ReceivePacket call selection
Simon Wilkinson [Fri, 26 Oct 2012 13:50:51 +0000]
rx: Refactor rxi_ReceivePacket call selection

Refactor the call selection logic in rxi_ReceivePacket so that it is
a little bit easier to follow, and better optimised to the common case.

Split the current logic into a function for packets being received by
a server, and a function for packets being received by a client.

Change-Id: Ie27de7952cc13fa3b92619cfe68e671e6d5e170c
Reviewed-on: http://gerrit.openafs.org/8297
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Don't build a call to immediately abort it
Simon Wilkinson [Fri, 26 Oct 2012 11:21:41 +0000]
rx: Don't build a call to immediately abort it

If the server is over the busy threshold, then don't create a new
call structure just to be able to send an abort on that call. Instead,
use rx_SendRawAbort to send an abort packet on the appropriate channel.

Change-Id: I02782fc25fe8ed7608b39e3f8355e2793f7526e3
Reviewed-on: http://gerrit.openafs.org/8296
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Remove unreachable debug statement
Simon Wilkinson [Thu, 25 Oct 2012 12:34:33 +0000]
rx: Remove unreachable debug statement

ReceivePacket has a dpf which is conditional on the packet having a
zero callnumber. However, just before we reach this debug statement,
we always return if the header doesn't have a call number included.

So, the debug statement can never run. Just remove it, as it's
potentially confusing.

Change-Id: I5fad9f39c9a0c4aac50853aaf4f853b9f7715e61
Reviewed-on: http://gerrit.openafs.org/8295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Always provide rxi_WaitForTQBusy
Simon Wilkinson [Thu, 25 Oct 2012 11:01:04 +0000]
rx: Always provide rxi_WaitForTQBusy

Move the prototype for rxi_WaitForTQBusy to rx_internal.h, and always
provide it (as a prototype for RX_ENABLE_LOCKS, and as a no-op for lwp).

Remove all of the #ifdef RX_ENABLE_LOCKS around rxi_WaitForTQBusy calls.

Change-Id: I6c2b943d6d06bf19d3cb4495201d278e3900b6ef
Reviewed-on: http://gerrit.openafs.org/8294
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Set Server Prefs recalc immediately
Jeffrey Altman [Mon, 29 Oct 2012 16:59:14 +0000]
Windows: Set Server Prefs recalc immediately

When processing the set server preferences pioctl call cm_RankServer()
to update the server preference value reported by "getserverprefs"
in addition to cm_ChangeRankVolume() or cm_ChangeRankCellVLServer().

Change-Id: Iacd8d30865286c39a7cc02e2f659b8c684f8f4a4
Reviewed-on: http://gerrit.openafs.org/8328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: mark server reference offline for VOFFLINE
Jeffrey Altman [Mon, 29 Oct 2012 14:33:18 +0000]
Windows: mark server reference offline for VOFFLINE

cm_Analyze() was not marking the cm_ServerRef_t reference to
a volume instance as srv_offline in response to a VOFFLINE error.
As a result the same volume instance is tried again and again.

Change-Id: Ic467f41e96408281e6251a796d2dfba3245bb023
Reviewed-on: http://gerrit.openafs.org/8326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoRevert "Windows: Media Protected if create on RO volume"
Jeffrey Altman [Mon, 29 Oct 2012 13:19:13 +0000]
Revert "Windows: Media Protected if create on RO volume"

This reverts commit f3f282265a3d9e3c968fd06793e6d1a91337f443.

Returning STATUS_MEDIA_WRITE_PROTECTED in preference to
STATUS_OBJECT_NAME_COLLISION when the file results in silent
failures by some applications (ie, Firefox.exe) when the
first directory in the path below the share name is the
root of a .readonly volume.

FIXES 131416

Change-Id: I342d9ff09ef68615371cf9d372f38fac854ed6c0
Reviewed-on: http://gerrit.openafs.org/8325
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: MUTEX_* are no-ops when !RX_ENABLE_LOCKS
Simon Wilkinson [Thu, 25 Oct 2012 10:57:22 +0000]
rx: MUTEX_* are no-ops when !RX_ENABLE_LOCKS

Remove any occurences of
    # ifdef RX_ENABLE_LOCKS
    MUTEX_ENTER(&mutex)
    # endif

and similar for MUTEX_INIT, MUTEX_DESTROY and MUTEX_EXIT, as all of
these operations are no-ops when RX_ENABLE_LOCKS isn't defined.

Change-Id: Ic0f27b42d56ae4362ff095f1f08a06575c4ca2c1
Reviewed-on: http://gerrit.openafs.org/8293
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Get rid of AFS_GLOBAL_RXLOCK_KERNEL
Simon Wilkinson [Thu, 25 Oct 2012 10:49:55 +0000]
rx: Get rid of AFS_GLOBAL_RXLOCK_KERNEL

Get rid of the AFS_GLOBAL_RXLOCK_KERNEL #define. RX used to have a
single global lock locking mode, but none of our kernel modules use
it any more. In fact, AFS_GLOBAL_RXLOCK_KERNEL is now only defined
when RX_ENABLE_LOCKS is also defined. Simplify the code by renaming
all of the occurrences of AFS_GLOBAL_RXLOCK_KERNEL as RX_ENABLE_LOCKS,
and remove any cases where we're now doing unecessary tests

Change-Id: I061d8d364c61168370b223cdac48ad161f0c9d74
Reviewed-on: http://gerrit.openafs.org/8292
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Don't have 2 different protos for rxi_CheckCall
Simon Wilkinson [Thu, 25 Oct 2012 10:32:03 +0000]
rx: Don't have 2 different protos for rxi_CheckCall

Use a single prototype for rxi_CheckCall in both the pthread and
lwp cases. Remove the #ifdef maze at the call sites, and take advantage
of the fact that MUTEX_EXIT reduces to an empty string in the lwp
case.

Change-Id: Iaa8c1b983f1c8372e9c2e1b90aaef25a2bc5f81f
Reviewed-on: http://gerrit.openafs.org/8291
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Don't double check conn->call
Simon Wilkinson [Thu, 25 Oct 2012 10:27:33 +0000]
rx: Don't double check conn->call

We currently have

call = conn->call[channel]
if (call) {
   ...
} else {
    call = conn->call[channel]
    if (call) {
       ...
    }
}

As we don't drop (or acquire) any locks between the first and the
second check of call, there's no way that the result can be different
from the first time we checked. So just get rid of the uneccessary
code, and reindent the following block to match.

Change-Id: If21a1d0af461fe0c0651e713dfb99a7c5f01cba4
Reviewed-on: http://gerrit.openafs.org/8290
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Move bytesSent + bytesRcvd into app only data
Simon Wilkinson [Tue, 23 Oct 2012 18:21:09 +0000]
rx: Move bytesSent + bytesRcvd into app only data

The call->bytesSent and call->bytesRcvd counters are only manipulated
by the application thread in running calls. Move them into the app-only
section of the call structure so this is clear.

Change-Id: Ib7929a8e34bcb70c8cb9c1f89544adce0d627299
Reviewed-on: http://gerrit.openafs.org/8288
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Don't use app-thread variable in SendXmitList
Simon Wilkinson [Tue, 23 Oct 2012 12:35:43 +0000]
rx: Don't use app-thread variable in SendXmitList

The value of call->app.mode is changed by the application thread
without taking the call lock. Instead of using this variable in
SendXmitList to determine whether the queue should be flushed, add
a new flag (RX_CALL_FLUSH) to control flushing behaviour.

As call->flags is manipulated under the call lock, its value can
be safely used by SendXmitList.

Change-Id: I8416697f457e5003af08a35ac08809512b03a9be
Reviewed-on: http://gerrit.openafs.org/8286
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Make lock-free call data explicit
Simon Wilkinson [Tue, 23 Oct 2012 11:41:07 +0000]
rx: Make lock-free call data explicit

For speed, the application thread accesses a number of elements of
the call structure without holding the call lock. This is safe, as
long as the application thread is the only place in which these
items of data are accessed.

Make this distinction explicit by creating a new structure to hold
all of these fields, and include this structure within the rx_call.

This turns up one place in the code (SendXmitList) which accesses an
application private piece of data in the listener and event threads.
A forthcoming patch will fix this.

Change-Id: I7b5ffb8b5ce68a2186e37ae64461fe356a40603e
Reviewed-on: http://gerrit.openafs.org/8285
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Makefile dependencies
Jeffrey Altman [Sat, 6 Oct 2012 21:34:52 +0000]
Windows: Makefile dependencies

Permit "afsrdr" and "extra" to be built without the rest of
the tree by making them depend on "config".

Change-Id: I52e484f64d02e7f9b136164e10accdc981835ec0
Reviewed-on: http://gerrit.openafs.org/8321
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Send all \\AFS\PIPE to afsd_service
Jeffrey Altman [Mon, 6 Aug 2012 16:19:26 +0000]
Windows: Send all \\AFS\PIPE to afsd_service

Anytime there is a pipe service request, forward it to the
afsd_service.exe and permit the service to manage the request.
The prior implementation resulted in STATUS_FILE_NOT_FOUND errors
being delivered when an unexpected service was requested.

Change-Id: I2ae9c45db787c0cb422fa3fecdfb235631927415
Reviewed-on: http://gerrit.openafs.org/8320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Treat EIO from file server as fatal error
Jeffrey Altman [Wed, 26 Sep 2012 05:51:37 +0000]
Windows: Treat EIO from file server as fatal error

Return STATUS_DISK_OPERATION_FAILURE to caller when a file
server fails an RPC with EIO.  Previous behavior was to retry
the request indefinitely.

Change-Id: I8fa3dbc92dda4e50e1331ad350dd697092f26985
Reviewed-on: http://gerrit.openafs.org/8319
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: ObjectInfo RefCount 0 <-> 1 transitions
Jeffrey Altman [Fri, 19 Oct 2012 15:26:21 +0000]
Windows: ObjectInfo RefCount 0 <-> 1 transitions

When the reference count transitions from 0 <-> 1 ensure that the
ObjectInfoLock is held exclusive to prevent the current thread from
altering the state while another thread is holding the ObjectInfoLock
shared in order to conditionally perform an action based upon
the the reference count being zero.

Change-Id: I5bcf384a0ea90e4896e55b537e92112ac3791a4c
Reviewed-on: http://gerrit.openafs.org/8257
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: PrimaryVolumeWorker ObjectInfoLock deadlock
Jeffrey Altman [Thu, 25 Oct 2012 22:42:11 +0000]
Windows: PrimaryVolumeWorker ObjectInfoLock deadlock

Patchset eaad522651a81f20eac4966a55a731e0e59e39dd inadvertently
introduced a deadlock with invalidation requests from the service.
It is not safe to hold the ObjectInfoLock resource across calls
to AFSCleanupFcb().  Instead of holding the lock obtain a reference
to the ObjectInformationCB.

Change-Id: I048401ec3e432c05c8a72251ef1e32442974256d
Reviewed-on: http://gerrit.openafs.org/8308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSCleanup re-organization
Jeffrey Altman [Thu, 25 Oct 2012 18:33:29 +0000]
Windows: AFSCleanup re-organization

Reorganize the activities of the AFSCleanup() for File FCBs
so that the Fcb Resource can be dropped prior to issuing the
cleanup request to the cache manager.   The cache manager can
block for a long period of time while flushing data and holding
the Fcb resource blocks all subsequent CreateFile requests.

Change-Id: Ieaf3653ebf487670bce1043e73be093eb77a8736
Reviewed-on: http://gerrit.openafs.org/8307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSCleanup Flush Data decision
Jeffrey Altman [Thu, 25 Oct 2012 18:31:14 +0000]
Windows: AFSCleanup Flush Data decision

AFSCleanup() should instruct the cache manager to flush dirty
data when the Context Control Block indicates that the handle
being closed was opened for writing and was granted appropriate
permissions.   The decision to flush should not be dependent on
the open handle count because the last handle might belong to
an authentication group that does not have write permission.

Change-Id: I4e181616f1c8eba9e4c6184e2035d9f6cbaba1d0
Reviewed-on: http://gerrit.openafs.org/8306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: buf_DirtyBuffersExist return value
Jeffrey Altman [Thu, 25 Oct 2012 18:12:42 +0000]
Windows: buf_DirtyBuffersExist return value

buf_DirtyBuffersExist() should return 'found' not '0'.

Change-Id: I037ce37d5fc8a63f563ded196925af930434fb16
Reviewed-on: http://gerrit.openafs.org/8305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSMarkDirty() require ExtentsResource held
Jeffrey Altman [Tue, 23 Oct 2012 00:40:21 +0000]
Windows: AFSMarkDirty() require ExtentsResource held

Instead of dynamically testing if the ExtentsResource is held
and if not acquire it within AFSMarkDirty(), simply require that
it be held.  AFSMarkDirty() is only called from one location.

Change-Id: If30fc05fead4c9e0604555239e9b862659de3e8b
Reviewed-on: http://gerrit.openafs.org/8304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSFlushExtents QueuedFlushCount leak
Jeffrey Altman [Tue, 23 Oct 2012 00:34:59 +0000]
Windows: AFSFlushExtents QueuedFlushCount leak

The FCB QueuedFlushCount was decremented in all code paths
but only incremented if the AuthGroup acquisition succeeded.
Increment the counter before the AuthGroup checks.

Change-Id: I3f58075124412cc4a7ac63dc6a7f90a91af369cf
Reviewed-on: http://gerrit.openafs.org/8303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: RDRFunction remove DebugBreak
Jeffrey Altman [Tue, 23 Oct 2012 00:29:47 +0000]
Windows: RDRFunction remove DebugBreak

DebugBreak hard coded into the source tree makes debugging
other unrelated issues difficult if the code path being executed
includes them.  Remove them.

Change-Id: I0f55b1fbccdbac13abecb4f4e9774b23fa57678d
Reviewed-on: http://gerrit.openafs.org/8302
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Promote DELETED from DirEntry to ObjInfo
Jeffrey Altman [Fri, 19 Oct 2012 13:33:18 +0000]
Windows: Promote DELETED from DirEntry to ObjInfo

On deletion of the DirEntry in AFSDeleteDirEntry() set the
AFS_OBJECT_FLAGS_DELETED flag on the ObjectInformation object
if and only if the AFS_DIR_ENTRY_DELETED flag was set in the
DirEntry.  Setting the AFS_OBJECT_FLAGS_DELETED should not
be conditional on the ObjectInformatION ReferenceCount being
zero.

Remove the test and set of AFS_OBJECT_FLAGS_DELETED from
AFSClose() because that operation will already have been
performed in the call to AFSDeleteDirEntry() if necessary.

Change-Id: Ib52f89633e6a343b08d408ef24b067c8fae73e0f
Reviewed-on: http://gerrit.openafs.org/8256
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoopr: Clarify opr_time copyright
Simon Wilkinson [Fri, 19 Oct 2012 13:06:57 +0000]
opr: Clarify opr_time copyright

opr_time.h made it in to the tree without a copyright statement.
Clarify that it is BSD licensed.

Change-Id: Ifd6e3dff547337885e5e0bdc0d04e218b733ce44
Reviewed-on: http://gerrit.openafs.org/8279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovolser: comment with a list of all dump tags
Hartmut Reuter [Sat, 20 Oct 2012 22:24:53 +0000]
volser: comment with a list of all dump tags

this is a list of all the dump tags currently defined

Change-Id: Ie040f48b35ac5ec377e5d4184bcb8e47020d1d46
Reviewed-on: http://gerrit.openafs.org/8281
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: Rework handling of names in the lookup functions
Marc Dionne [Sat, 20 Oct 2012 16:59:01 +0000]
Linux: Rework handling of names in the lookup functions

Rework the name lookup functions in the kernel to deal more cleanly
with the change of API for kernel 3.7

Change-Id: I1de9e02cfedbbeee31e2793c443722d4eed57705
Reviewed-on: http://gerrit.openafs.org/8278
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agolwp: zero reused request blocks
Magnus Ahltorp [Fri, 19 Oct 2012 22:12:13 +0000]
lwp: zero reused request blocks

new blocks are calloc()d as zeroed. reused ones are not.
zero them

FIXES 131369

Change-Id: I646c04d3d14ffc121d54e740a92803bb18f32091
Reviewed-on: http://gerrit.openafs.org/8277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: fix afs_putname wrapper for pre-3.7 kernels
Marc Dionne [Fri, 19 Oct 2012 17:31:53 +0000]
Linux: fix afs_putname wrapper for pre-3.7 kernels

Make the compatibility function use the right type for pre-3.7
kernels.

Change-Id: I9222a3dc5a923c97dc36f69485d9cd3ecc6810fb
Reviewed-on: http://gerrit.openafs.org/8276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Remove 'bAllocatedFcb' from AFSCreate.cpp
Jeffrey Altman [Tue, 16 Oct 2012 13:36:56 +0000]
Windows: Remove 'bAllocatedFcb' from AFSCreate.cpp

All functions now call AFSInitFcb() and the ObjectInfo->Fcb == NULL
test is performed internally.  Therefore, it is not possible for
the caller to track whether or not an Fcb was allocated.  It is
irrelevant.  The Fcb will be cleaned up when the ObjectInfo is
destroyed by the PrimaryVolumeWorker thread.

Change-Id: I3255563e1b0c44082e4f390002d294ad333d534f
Reviewed-on: http://gerrit.openafs.org/8242
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: PrimaryvolumeWorker do not pause if busy fcb
Jeffrey Altman [Mon, 8 Oct 2012 03:41:32 +0000]
Windows: PrimaryvolumeWorker do not pause if busy fcb

The AFSPrimaryVolumeWorkerThread should not unnecessarily block
on the FCB Resource because such blockage could be the result of
of waiiting for extents to be delivered from the service.  The
AFSPrimaryVolumeWorkerThread is the primary method by which
extents are released back to the service.

AFSCleanupFcb() is modified to return STATUS_RETRY if the Fcb
resource cannot be obtained without blocking.

The AFSPrimaryVolumeWorkerThread() does not call
AFSCleanupFcb() with 'ForceFlush' parameter set to TRUE and
remembers if STATUS_RETRY is returned.  If any Fcb was busy,
then the worker does not wait for the 5 second timer to fire.

Change-Id: If3eab06b902202483eb354362a4db6bc8167d0df
Reviewed-on: http://gerrit.openafs.org/8227
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: avoid race set/clear ExtentsRequestComplete
Jeffrey Altman [Fri, 19 Oct 2012 12:37:25 +0000]
Windows: avoid race set/clear ExtentsRequestComplete

The FCB ExtentsRequestComplete KEVENT setting, clearing
and testing was racy.  Clear the event before issuing the
request to the service and if the request fails, set it in
case two threads issued requests for the same FCB in parallel
and one fails and the other succeeds.

We must ensure that a clear does not mask the event being set
prior to the request thread returning.

Change-Id: I6d496214a2621aeca2b9f6d2f50095ffd19b6c59
Reviewed-on: http://gerrit.openafs.org/8255
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: clear pending delete upon deletion
Jeffrey Altman [Thu, 18 Oct 2012 13:56:12 +0000]
Windows: clear pending delete upon deletion

During cleanup processing if the DELETE_PENDING flag is set
the service will be told to delete the file when the handle
count reaches 1.  At that point the file will be deleted
and the DELETED flag will be set on the object info object.
The DELETE_PENDING flag was not being cleared which could
lead to confusion.  This patchset clears the flag after deletion.

Change-Id: Ib30bb3a5c3a06b8971ac4523e6eacefaaed068ce
Reviewed-on: http://gerrit.openafs.org/8253
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitFcb Check ObjectInfo->Fcb for NULL
Jeffrey Altman [Sun, 7 Oct 2012 14:23:19 +0000]
Windows: AFSInitFcb Check ObjectInfo->Fcb for NULL

Now that AFSInitFcb is called under the ObjectInfoLock, it is
once again safe to perform a test for ObjectInfo->Fcb != NULL
and return immediately if an Fcb is already assigned.

Change-Id: Id926b9ccf24c7761dbeacf42c53d7cc7d1375482
Reviewed-on: http://gerrit.openafs.org/8226
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Fix DV Raced Trace Message Parameters
Jeffrey Altman [Sun, 7 Oct 2012 14:20:11 +0000]
Windows: Fix DV Raced Trace Message Parameters

Data Versions are logged as HighPart:LowPart not QuadPart.

Change-Id: I7cfb712060fd602a1d20ca1d4f20b892820edf89
Reviewed-on: http://gerrit.openafs.org/8225
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Protect ObjectRefCnts with ObjectInfoLock
Jeffrey Altman [Fri, 5 Oct 2012 15:36:45 +0000]
Windows: Protect ObjectRefCnts with ObjectInfoLock

The ObjectInfoCB.ObjectReferenceCount is tested to determined
when it is safe to remove an FCB from the ObjectInfoCB.  The
value must not be permitted to change while a removal is performed.

Protect AFSRemoveFcb() calls with exclusive holds of the
ObjectInfoCB.NonPagedInfo->ObjectInfoLock.  New functions:

  AFSObjectInfoIncrement()
  AFSObjectInfoDecrement()

perform all increments and decrements while holding the
ObjectInfoLock in a Shared state.

Change-Id: If89b7668ef0a891d55b039d9516620b581c79e10
Reviewed-on: http://gerrit.openafs.org/8224
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSPrimaryVolumeWorkerThread AFSRemoveFcb
Jeffrey Altman [Wed, 3 Oct 2012 01:11:01 +0000]
Windows: AFSPrimaryVolumeWorkerThread AFSRemoveFcb

Do not call AFSRemoveFcb() on a directory entry whose Fcb
has a non-zero use count.

Change-Id: I0d733327c094f15a7b681eb1806a4fa9a4a6c151
Reviewed-on: http://gerrit.openafs.org/8223
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Always AFSInitFcb and AFSRemoveFcb
Jeffrey Altman [Wed, 3 Oct 2012 01:07:21 +0000]
Windows: Always AFSInitFcb and AFSRemoveFcb

Instead of comparing ObjectInfo->Fcb to NULL and conditionally
calling AFSInitFcb() or AFSRemoveFcb(), always call them and use
InterlockedExchangePointer() as the test.

Change-Id: I81915dfdfdf180c04ad2b4ff7506784a83ee8c2a
Reviewed-on: http://gerrit.openafs.org/8221
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSRequestExtentsAsync and AFSDoExtentsMapRegion
Jeffrey Altman [Sat, 6 Oct 2012 21:36:25 +0000]
Windows: AFSRequestExtentsAsync and AFSDoExtentsMapRegion

When calling AFSDoExtentsMapRegion() the FCB ExtentsResource
must be held.   AFSRequestExtentsAsync() failed to hold the
ExtentsResource across the call.

Change-Id: I607cfb45725410c7f079b3be03002b002fccbea4
Reviewed-on: http://gerrit.openafs.org/8220
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolwp: add shared-locked macro
Hartmut Reuter [Thu, 18 Oct 2012 11:32:50 +0000]
lwp: add shared-locked macro

we have a macro to check for write locked, add one for shared locked

Change-Id: I2cd7754fd0e725df19b37f2a2234997cb4c34d3f
Reviewed-on: http://gerrit.openafs.org/8252
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agomemcache: add extend-entry function
Hartmut Reuter [Thu, 18 Oct 2012 11:28:33 +0000]
memcache: add extend-entry function

export directly and rewrite writevblk in terms of it

Change-Id: I181f84428158e93e9bc6008ac9226958653a9409
Reviewed-on: http://gerrit.openafs.org/8251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agobypasscache: update threshold variable type
Hartmut Reuter [Thu, 18 Oct 2012 11:14:26 +0000]
bypasscache: update threshold variable type

if we're doing things based on size, we should allow storing
a size

Change-Id: Ibfb15c45b8b8c7a7c17154165da98c7a8518032a
Reviewed-on: http://gerrit.openafs.org/8250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolibafs: add partial background store
Hartmut Reuter [Thu, 18 Oct 2012 11:07:21 +0000]
libafs: add partial background store

add a bop that does a partial store

Change-Id: I5971d2cda705a11c7fba7c0cfa54a3fa2d90f392
Reviewed-on: http://gerrit.openafs.org/8249
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Remove Fcb.Specific.File.LazyWriterThread
Jeffrey Altman [Tue, 16 Oct 2012 13:08:37 +0000]
Windows: Remove Fcb.Specific.File.LazyWriterThread

The LazyWriterThread should not be recorded in the FCB.  It is
possible for multiple lazy writes to occur on a file in parallel
in separate threads.  The value is not used for anything in any
case.  AFSCommonWrite() tests the LazyWriterThread value but only
if 'bMapped' is FALSE.  Since 'bMapped' is always TRUE, the
comparison is never performed.   Remove the test and the value.

Change-Id: Iddbb65d2125f39f0362aba72ae20ab2666944367
Reviewed-on: http://gerrit.openafs.org/8241
Tested-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Add cm_SyncOp to cm_ReadMountPoint()
Jeffrey Altman [Sun, 14 Oct 2012 19:46:06 +0000]
Windows: Add cm_SyncOp to cm_ReadMountPoint()

Add a cm_SyncOp(CM_SCACHESYNC_FETCHDATA) call to cm_ReadMountPoint()
to prevent multiple FetchData RPCs being issued for the same
mount point at the same time.

Change-Id: I7651f4505727289d800af060cc3ff5a5f449f447
Reviewed-on: http://gerrit.openafs.org/8235
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitFcb assign pFcb->ObjectInformation
Jeffrey Altman [Wed, 3 Oct 2012 01:09:35 +0000]
Windows: AFSInitFcb assign pFcb->ObjectInformation

In AFSInitFcb() assign pFcb->ObjectInformation before the
InterlockedExchangePointer call and not afterwards.  Assigning
it afterwards leaves a small race where the ObjectInformation
value will be invalid.

Change-Id: Ie79587e0b2f161b7ff612fc4fb283135bafd1085
Reviewed-on: http://gerrit.openafs.org/8222
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: OpenTargetDirectory AFSInitFcb Reparse Test
Jeffrey Altman [Wed, 17 Oct 2012 00:26:43 +0000]
Windows: OpenTargetDirectory AFSInitFcb Reparse Test

In AFSOpenTargetDirectory the test to determine if AFSInitFcb
allocated a FCB or returned an existing one (STATUS_REPARSE)
was reversed.  If AFSInitFcb was called and AFSOpenTargetDirectory
eventually failed, an in use FCB would be freed.

Change-Id: Ie5974fee5202685575f286fe4fef43dfdc0698cb
Reviewed-on: http://gerrit.openafs.org/8244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: ObjectInformationCB indentation
Jeffrey Altman [Fri, 5 Oct 2012 15:40:44 +0000]
Windows: ObjectInformationCB indentation

Fix indentation within ObjectInformationCB structure

Change-Id: I004ca5a16fceb63522e3f244177e60e4459e507b
Reviewed-on: http://gerrit.openafs.org/8219
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Do not call buf_ClearRDRFlag unlink/rmdir
Jeffrey Altman [Sat, 6 Oct 2012 05:40:47 +0000]
Windows: Do not call buf_ClearRDRFlag unlink/rmdir

When processing unlink and remdir operations initiated by the
SMB stack do not call  buf_ClearRDRFlag.  The redirector upon
receiving the AFS_INVALIDATE_DELETE call will cancel outstanding
extent operations, mark the FCB deleted, and tear down any held
extents.

Change-Id: I5203dbe5489fcfd0a1c871c3e7aa6aa1a7d65e9a
Reviewed-on: http://gerrit.openafs.org/8218
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Correct alloc size SetFileExtents result
Jeffrey Altman [Sat, 6 Oct 2012 00:16:35 +0000]
Windows: Correct alloc size SetFileExtents result

AFSFileExtentCB objects not AFSSetFileExtentsCB objects.
The latter are too large.  Just wastes memory.

Change-Id: I2ffd1bfd639acc37e2d06bc61749d4ac93376668
Reviewed-on: http://gerrit.openafs.org/8217
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFS_INVALIDATE_DELETE must cancel IO
Jeffrey Altman [Fri, 5 Oct 2012 02:07:40 +0000]
Windows: AFS_INVALIDATE_DELETE must cancel IO

When processing an AFS_INVALIDATE_DELETE the redirector
must cancel any outstanding extent requests on the file
prior to tearing down the extents.

This code path is triggered either when VNOVNODE is received
from a file server or when an alternate cache manager interface
(SMB) unlinks the file.

Change-Id: I16c08c2469228b33ae4ece0e45a9890a057ab257
Reviewed-on: http://gerrit.openafs.org/8206
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agosalvager: fix formatting in the rest of the Log messages
Derrick Brashear [Mon, 15 Oct 2012 16:22:03 +0000]
salvager: fix formatting in the rest of the Log messages

right now some not-commonly-defined code fails to compile with warnings.
fix it so it uses a format string like everything else.

Change-Id: Ib35445db9800444f3ee74a43f17aeb6f2959645a
Reviewed-on: http://gerrit.openafs.org/8236
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Use opr queues
Simon Wilkinson [Fri, 12 Oct 2012 09:07:22 +0000]
rx: Use opr queues

Modify RX so that it uses opr queues throughout, rather than the older,
non-type-safe rx_queue structure and macros. Attempt to clarify which
items in a structure are queue headers, and which are linkage pointers.

This has the knock on effect that including an RX header doesn't
automatically give you rx_queue.h in your application's namespace.

Change-Id: I1b3fbcd8c03f8153a557bd4532710bcebfe45818
Reviewed-on: http://gerrit.openafs.org/8232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Move server queue entry structure out of rx.h
Simon Wilkinson [Thu, 11 Oct 2012 11:34:46 +0000]
rx: Move server queue entry structure out of rx.h

Hide the server queue management structure in its own header file,
rather than exposing it globally in rx.h. This structure has always
been private - applications have no business knowing about it!

Change-Id: I97ac31e0e77dbe1c10b2804f33901d933a8f0627
Reviewed-on: http://gerrit.openafs.org/8231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolibafs: Fix second pass in ShakeLooseVCaches
Marc Dionne [Fri, 12 Oct 2012 20:31:24 +0000]
libafs: Fix second pass in ShakeLooseVCaches

Commit 3105c7ff introduced a two phase process for reclaiming
vcache entries.  First go through the list and do what's possible
without sleeping (skipping aliased dentries on Linux), then do
a second pass only if necessary, allowing sleeping.

Unfortunately the test for the end of the VLRU scan is incorrect
and can never trigger, so this second pass was effectively disabled
and any code that is conditional on defersleep=1 was never
exercised.  The code to start the second scan also has issues.

Fix the end of VLRU test, and also correctly set the variables
needed to restart the scan.

Change-Id: I8034cd3b79aab4f2976ab2559c13c102126480d7
Reviewed-on: http://gerrit.openafs.org/8234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux 3.7: putname is no longer exported
Marc Dionne [Mon, 15 Oct 2012 16:26:09 +0000]
Linux 3.7: putname is no longer exported

putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

Change-Id: I5416067566f6332d77e5d91ce2b9cf7bc0c96dce
Reviewed-on: http://gerrit.openafs.org/8237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>