openafs.git
13 years agoubik: Introduce version lock
Marc Dionne [Fri, 4 Feb 2011 01:51:06 +0000]
ubik: Introduce version lock

The "version" lock is a new lock that protects the database version
information.  The goal is to allow the beacon thread to use the
protected values without blocking for an extended period of time,
which could occur if it was using the database lock.

Reading requires holding either lock, while writing requires holding
both locks.

The following values are protected:
ubik_epochTime
db->version
db->flags
db->tidCounter
db->writeTidCounter

Based on analysis and design work from Jeffrey Hutzelman.

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

13 years agoubik: Introduce new address lock
Marc Dionne [Sun, 23 Jan 2011 18:09:48 +0000]
ubik: Introduce new address lock

Introduce a new lock to protect:
ubik_server->addr[]
ubik_server->disk_rxcid
ubik_server->vote_rxcid
ubikSecClass
ubikSecIndex

Globals are put into a new addr_data structure along with the lock.

Based on analysis and design work from Jeffrey Hutzelman.

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

13 years agoubik: Introduce new vote lock
Marc Dionne [Sun, 23 Jan 2011 03:17:14 +0000]
ubik: Introduce new vote lock

Introduce a new lock to protect ubik data related to voting.
Specifically, it protects the following globals:
ubik_lastYesTime
lastYesHost
lastYesClaim
lastYesState
lowestHost
lowestTime
syncHost
syncTime
ubik_dbVersion
ubik_dbTid

Variables are grouped along with the lock in a new structure.

Also introduce a few helper functions to safely deal with ubik_dbVersion:
uvote_eq_dbVersion: Return true if the passed version is equal to the
current ubik_dbVersion
uvote_set_dbVersion: Set ubik_dbVersion to a specified value

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

13 years agoubik: Introduce new beacon lock
Marc Dionne [Sat, 22 Jan 2011 18:51:07 +0000]
ubik: Introduce new beacon lock

A new lock is introduced to protect beacon related data when
compiled with pthreads.  A global structure is added containing
the lock itself and the global variables that it protects.

The lock also protects some values in the ubik_server structures:
lastVoteTime
lastBeaconSent
lastVote
up
beaconSinceDown

Based on some analysis and design work by Jeffrey Hutzelman

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

13 years agoImport of code from heimdal
Heimdal Developers [Sun, 3 Apr 2011 15:26:39 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
987658325eb7bd6b10882cc4cdd224499e7f7a03 (switch-from-svn-to-git-2052-g9876583)

New files are:
roken/gettimeofday.c

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

13 years agoRoken: Import gettimeofday
Simon Wilkinson [Sun, 3 Apr 2011 15:25:48 +0000]
Roken: Import gettimeofday

Import the roken gettimeofday implementation, so we can use it on
Windows.

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

13 years agoTidy up gettimeofday usage
Simon Wilkinson [Sun, 3 Apr 2011 15:09:44 +0000]
Tidy up gettimeofday usage

The roken gettimeofday implementation doesn't return timezone
information. Audit the whole code to make sure that we don't rely on
this, and tidy up those places where we were passing an unused
timezone structure to the gettimeofday call.

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

13 years agoRemove NINTERFACE define
Simon Wilkinson [Sat, 2 Apr 2011 12:43:15 +0000]
Remove NINTERFACE define

Whatever behaviour was controlled by the -DNINTERFACE define is long
gone from our code base (git log -SNINTERFACE can't find any references,
which suggests that its removal predates OpenAFS).

Simplify our Makefiles by removing the definition

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

13 years agoReplace afs_ctime with strftime and friends
Simon Wilkinson [Sat, 2 Apr 2011 12:33:36 +0000]
Replace afs_ctime with strftime and friends

Replace our local afs_ctime() hack with strftime and localtime_r,
which roken can provide for us if necessary. This avoids the
compatibility problems inherent with ctime_r, and removes another bit
of platform compatibility goo from libutil.

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

13 years agoconfigure: Check for localtime_r properly
Simon Wilkinson [Sun, 3 Apr 2011 15:23:13 +0000]
configure: Check for localtime_r properly

Fix our check for localtime_r so that it actually picks up if it's
missing on Unix platforms, and gets libroken to build it.

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

13 years agoutil: Remove the unused magic.h header
Simon Wilkinson [Sun, 3 Apr 2011 15:36:30 +0000]
util: Remove the unused magic.h header

util/magic.h is unused, so get rid of it

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

13 years agoxstat: Tidy up header includes
Simon Wilkinson [Sat, 2 Apr 2011 14:06:10 +0000]
xstat: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agovol: Tidy up header includes
Simon Wilkinson [Sat, 2 Apr 2011 14:04:24 +0000]
vol: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agovol: Don't use MAX_INT when UINT_MAX will do
Simon Wilkinson [Sat, 2 Apr 2011 14:00:27 +0000]
vol: Don't use MAX_INT when UINT_MAX will do

limits.h provides us with UINT_MAX, so use this for the maxmimum
size of an unsigned integer, rather than trying to grow our own.

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

13 years agoviced: Tidy header includes
Simon Wilkinson [Sat, 2 Apr 2011 13:17:41 +0000]
viced: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

Also add a selection of headers to the list that autoconf checks for

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

13 years agoIrix: Supress some more warnings in kernel builds
Simon Wilkinson [Mon, 4 Apr 2011 10:02:17 +0000]
Irix: Supress some more warnings in kernel builds

Suppress the following warnings in kernel builds:
 *) The function "blah" was declared but never referenced (1174)
 *) The indicated trailing comma is non-standard (1201)
 *) The parameter "blah" was never referenced (3201)
 *) implicit conversion of a 64-bit integral type to a smaller
    integral type (3968)

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

13 years agovfsck: Tidy header includes
Simon Wilkinson [Sat, 2 Apr 2011 13:04:27 +0000]
vfsck: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agotsalvaged: Tidy up build rules
Simon Wilkinson [Sat, 2 Apr 2011 12:54:06 +0000]
tsalvaged: Tidy up build rules

COMMON_CFLAGS already includes XCFLAGS and ARCHFLAGS, so don't include
them again in the salvager cflags rule

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

13 years agovenus: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 23:24:17 +0000]
venus: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agouss: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 22:03:00 +0000]
uss: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agousd: Tidy header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:59:26 +0000]
usd: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agoupdate: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:57:46 +0000]
update: Tidy up header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agoubik: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:55:05 +0000]
ubik: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agopthreaded servers: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:50:23 +0000]
pthreaded servers: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agosys: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:46:46 +0000]
sys: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agoafs: Retry unlock after afs_StoreAllSegments
Andrew Deason [Fri, 1 Apr 2011 18:43:13 +0000]
afs: Retry unlock after afs_StoreAllSegments

HandleFlock calls afs_StoreAllSegments when unlocking an exclusive
flock lock. This can drop the write lock on avc, so we must
effectively retry the entire lock operation again, since the world may
have changed while we were waiting to reacquire the lock on avc. So,
retry once all of the lock checks up to that point, to ensure that a
lock on the file actually still exists.

FIXES 125446

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

13 years agoscout: Tidy header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:37:47 +0000]
scout: Tidy header includes

Remove headers which are provided by libroken

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

13 years agorxkad: Tidy header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:34:01 +0000]
rxkad: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agorxgen: Tidy up header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:23:20 +0000]
rxgen: Tidy up header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agorxdebug: Tidy header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:20:08 +0000]
rxdebug: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agorx: Tidy header includes
Simon Wilkinson [Sun, 27 Mar 2011 21:18:23 +0000]
rx: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agoprocmgmt: Tidy header includes
Simon Wilkinson [Fri, 25 Mar 2011 19:46:42 +0000]
procmgmt: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agopam: Tidy header includes
Simon Wilkinson [Fri, 25 Mar 2011 19:42:50 +0000]
pam: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agoroken: Add env functions to configure checks
Simon Wilkinson [Sun, 3 Apr 2011 09:23:56 +0000]
roken: Add env functions to configure checks

Add the putenv, setenv and unsetenv functions to the list of
functions that configure checks for. This avoids the roken header
redefining them to rk_*, which we're then not providing an
implementation of.

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

13 years agoUpdate README.WARNINGS, adjust warning inhibition flags
Marc Dionne [Sat, 2 Apr 2011 15:04:25 +0000]
Update README.WARNINGS, adjust warning inhibition flags

Remove warning inhibition for fsprobe and uss_kauth, and
adjust README.WARNINGS to the current status.

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

13 years agoConvert ubik_Call(x) calls to ubik_x()
Marc Dionne [Sat, 2 Apr 2011 13:43:26 +0000]
Convert ubik_Call(x) calls to ubik_x()

Convert remaining ubik_Call(function, ..) users to ubik_function(..).

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

13 years agofsprobe: Fix usage message
Marc Dionne [Sat, 2 Apr 2011 13:03:55 +0000]
fsprobe: Fix usage message

Fix the usage message to display the correct command name.

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

13 years agofsprobe: call RXAFS_GetTime directly
Marc Dionne [Sat, 2 Apr 2011 12:40:15 +0000]
fsprobe: call RXAFS_GetTime directly

Call RXAFS_GetTime directly instead of using ubik_Call which is
not prototyped and has logic that we don't need/want here since
we're targeting a specific server.

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

13 years agolibwp: Tidy header includes
Simon Wilkinson [Fri, 25 Mar 2011 19:36:35 +0000]
libwp: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agoLinux: Fix USE_UCONTEXT detection
Simon Wilkinson [Fri, 1 Apr 2011 15:37:32 +0000]
Linux: Fix USE_UCONTEXT detection

On Linux, afs/param.h determines whether to use the ucontext()
function based on the glibc version. However, the glibc version
macros aren't available until a C library header has been included.

There have been a couple of attempts to fix this. The first included
afs_sysnames.h before the C library check, but this wasn't sufficient
to pull in a header for all builds. The second included stdio.h before
including afs/param.h in process.c.

Whilst the second approach works, it has the drawback that it breaks
our convention that afsconfig.h and afs/param.h must always be the first
includes in a file. More seriously, it means that the behaviour of
afs/param.h is different depending on where it appears in the include
order - which is especially dangerous for 3rd party user.

So, this patch tries to resolve all of this by explicitly including
features.h before doing the glibc version checks. The only danger I
can see here is that Linux platforms without glibc may lack a
features.h, but I suspect we have trouble building on such platforms
in any case.

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

13 years agoafs: Avoid memory leak on recursive write flock
Andrew Deason [Fri, 1 Apr 2011 21:43:24 +0000]
afs: Avoid memory leak on recursive write flock

When a process requests an exclusive lock on a file on which it
already holds an exclusive lock, we basically form a no-op. However,
HandleFlock was allocating a new SimpleLocks and attaching it to
avc->slocks, without freeing the old SimpleLocks structure.

Since we don't need to do anything if we already hold an exclusive
lock, just break out of the loop right away when we detect that
scenario. Thus we avoid adding a new structure to avc->slocks, and we
avoid a memory leak.

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

13 years agocrypto: return a value from krb5_abortx
Marc Dionne [Fri, 1 Apr 2011 22:53:31 +0000]
crypto: return a value from krb5_abortx

The krb5_abortx stub is declared as returning a krb5_error_code,
so make it return something to avoid a warning.

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

13 years agomacos: no more startupitems
Derrick Brashear [Fri, 1 Apr 2011 16:17:13 +0000]
macos: no more startupitems

if we're upgrading, a "cruft" startupitems script should just
be nuked.

FIXES 129601

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

13 years agolibafscp: code cleanup
Chaz Chandler [Sat, 3 Jul 2010 19:02:30 +0000]
libafscp: code cleanup

This patch is intended to bring libafscp into accordance with the
current OpenAFS coding standards while also fixing a few small
issues.  Apologies in advance for the numerous whitespace changes.

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

13 years agoLinux: Fix fallout from path_lookup commit
Marc Dionne [Wed, 30 Mar 2011 22:32:04 +0000]
Linux: Fix fallout from path_lookup commit

Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

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

13 years agolog: Tidy header includes
Simon Wilkinson [Fri, 25 Mar 2011 19:25:31 +0000]
log: Tidy header includes

Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

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

13 years agolibadmin: Tidy header includes
Simon Wilkinson [Fri, 25 Mar 2011 10:12:08 +0000]
libadmin: Tidy header includes

Remove headers which are provided by libroken, and reorded header
includes so that they're a bit a more legible.

Add math.h to the list of headers that configure will check for

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

13 years agolibacl: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 22:32:39 +0000]
libacl: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agokopenafs: Tidy up headers
Simon Wilkinson [Thu, 24 Mar 2011 22:17:55 +0000]
kopenafs: Tidy up headers

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agoxdr symbol fallout
Derrick Brashear [Wed, 30 Mar 2011 13:46:43 +0000]
xdr symbol fallout

changes to xdr make xdr_vector and xdr_reference missing from libuafs.
fix it.

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

13 years agoUnbreak make dest for FBSD
Ben Kaduk [Wed, 30 Mar 2011 02:26:50 +0000]
Unbreak make dest for FBSD

It turns out that we do need an afs.rc.fbsd that is set up for
transarc paths in this directory.  To get it to work properly
will require the user to symlink to it from a dir that gets
checked by rcorder, but them's the breaks.

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

13 years agoOpenBSD: Complete implementation of afs_osi_TimedSleep
Antoine Verheijen [Mon, 28 Mar 2011 16:05:40 +0000]
OpenBSD: Complete implementation of afs_osi_TimedSleep

The OpenBSD version of afs_osi_TimedSleep() is missing the required
afs_event structure and afs_getevent routine. This update adds them
(by borrowing a copy of the code from the FreeBSD implementation).

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

13 years agovol: Add timeouts to SYNC server select() calls
Andrew Deason [Tue, 29 Mar 2011 17:28:46 +0000]
vol: Add timeouts to SYNC server select() calls

Normally *SYNC server processes wait indefinitely for activity to
occur on one of the SYNC sockets. On some Linux kernels, there exists
a race condition where data can come in on a socket, but the select()
call continues to wait. To ensure that we do not hang forever in such
a scenario, add a timeout to the select() call, which will ensure we
notice the new data within 10 seconds. Raise the timeout on non-Linux
to reduce impact elsewhere.

The Linux kernel bug is tracked in
<https://bugzilla.redhat.com/show_bug.cgi?id=494404>, though that bug
report may not represent all affected kernels.

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

13 years agoAlways set LIB_roken when we find libroken
Andrew Deason [Tue, 29 Mar 2011 18:04:48 +0000]
Always set LIB_roken when we find libroken

If we found an external libroken when configuring, we were not setting
LIB_roken if --with-roken=DIR was not specified. Set LIB_roken when we
find a libroken without --with-roken=DIR.

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

13 years agoNEWS updates for 1.6.0pre4
Russ Allbery [Mon, 28 Mar 2011 19:56:10 +0000]
NEWS updates for 1.6.0pre4

Add additional 1.6.0 NEWS entries based on the release notes for
1.6.0pre4.

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

13 years agorx: always use/protect the xdr routines in the kernel
Chas Williams (CONTRACTOR) [Wed, 16 Mar 2011 14:32:48 +0000]
rx: always use/protect the xdr routines in the kernel

This clears up some warnings about duplicate symbols with Solaris 11
since the Solaris kernel already has these routines.  Since we never
use stock kernel version of the xdr routines perhaps we should always
use/protect our version of the symbols.

Change-Id: I4b5b4a691fb838093aff728469d17c28dccbaaea
Reviewed-on: http://gerrit.openafs.org/4252
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agokauth: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 21:58:29 +0000]
kauth: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

This adds arpa/inet.h to the list of headers that configure checks for

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

13 years agogtx: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 21:08:35 +0000]
gtx: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agofsprobe: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 21:03:00 +0000]
fsprobe: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agofinale: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:58:46 +0000]
finale: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also, tidy up translate_et_nt.c by removing the AIX specific code which
will never be built, as this file is only compiled on Windows!

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

13 years agodir: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:56:11 +0000]
dir: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agocom_err: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:50:21 +0000]
com_err: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agovol: remove flock emulation now provided by roken
Jeffrey Altman [Mon, 28 Mar 2011 12:29:25 +0000]
vol: remove flock emulation now provided by roken

flock emulation is provided by rk_flock from roken.   No need
to provide a local emulation function in namei_ops.c.

This change removes a macro redefinition warning.

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

13 years agoAIX: Add flock to roken
Simon Wilkinson [Mon, 28 Mar 2011 13:52:33 +0000]
AIX: Add flock to roken

Add the rk_flock() emulation function to roken, primarily for use
on the AIX build, but it will also be used for WIN32

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

13 years agocmd: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:46:54 +0000]
cmd: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agobu*: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:42:37 +0000]
bu*: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agobozo: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 20:07:37 +0000]
bozo: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 28 Mar 2011 13:44:20 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
987658325eb7bd6b10882cc4cdd224499e7f7a03 (switch-from-svn-to-git-2052-g9876583)

New files are:
roken/flock.c

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

13 years agoImport flock.c from roken
Simon Wilkinson [Mon, 28 Mar 2011 13:43:28 +0000]
Import flock.c from roken

Add flock.c to our list of roken imports, so that we can use it on
AIX

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

13 years agoLinux: 2.6.39: replace path_lookup with kern_path
Marc Dionne [Sun, 27 Mar 2011 14:59:55 +0000]
Linux: 2.6.39: replace path_lookup with kern_path

path_lookup is no longer available, use kern_path instead.

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

13 years agoihandle release locking simplification
Derrick Brashear [Tue, 22 Mar 2011 16:47:16 +0000]
ihandle release locking simplification

several callers drop locks so ih_release can be called unlocked,
then relock. simply allow a locked call (via _ih_release_r).

side effect: we had races before on refcnt check versus cleanup style.
this addresses it, but only removes lock contention.

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

13 years agoauth: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 19:56:35 +0000]
auth: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agoautoconf: Add tests for resolver headers
Simon Wilkinson [Mon, 28 Mar 2011 09:24:14 +0000]
autoconf: Add tests for resolver headers

Add tests for arpa/nameserv.h and resolv.h, so that roken will look
after including these files for us.

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

13 years agofssync: Rename state
Simon Wilkinson [Mon, 28 Mar 2011 09:23:22 +0000]
fssync: Rename state

The structure 'state' in fssync-debug conflicts with a structure
of the same name in AIX's resolv.h header. Renaming the structure here
to fssync_state to avoid the conflict.

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

13 years agoaudit: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 19:27:21 +0000]
audit: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agovol: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 19:23:34 +0000]
vol: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agovolser: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 19:11:15 +0000]
volser: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also, add sys/uio.h to the list of libraries that we check for.

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

13 years agovolser: More renaming of putshort and putint32
Simon Wilkinson [Fri, 25 Mar 2011 00:37:52 +0000]
volser: More renaming of putshort and putint32

Commit 2d6bc153689f14f8690878b15d9fb711a56b0546 renamed the putshort
and putint32 macros in dumpstuff.c to avoid conflicts with macros
that are defined in resolv.h. However, an almost identical copy of
that code also exists in vol-dump.c

Rename putshort and putint32 there too.

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

13 years agoafs_snprintf is dead, long live rk_snprintf
Simon Wilkinson [Thu, 24 Mar 2011 15:36:49 +0000]
afs_snprintf is dead, long live rk_snprintf

We were shipping our own implementation of snprintf and friends, as
afs_snprintf. Now that we're using roken everywhere, we can make use
of roken's rk_snprintf, and no longer need to ship our own.

As Window's snprintf isn't C99 compliant, roken always uses its own
on this platform. The effect of this is that we can no longer use
AFS_UINT64_FMT and AFS_INT64_FMT for snprintf calls (and the Log
functions that call them). Instead, we need to always use the
Unix format specifiers when calling these functions.

Make thse changes across the whole tree.

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

13 years agoWindows: Don't use %I for IP addresses
Simon Wilkinson [Sun, 27 Mar 2011 20:06:27 +0000]
Windows: Don't use %I for IP addresses

%I isn't supported by the roken printf functions. In preparation
for switching over to them, replace our use of asprintf to convert
IP addresses to strings with the afs_inet_ntoa_r function.

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

13 years agoLinux: 2.6.39: deal with BKL removal
Marc Dionne [Sun, 27 Mar 2011 15:20:17 +0000]
Linux: 2.6.39: deal with BKL removal

For 2.6 kernels the OpenAFS code is already BKL free, but the
corresponding header file smp_lock.h is still included in various
places.  This header no longer exists, so remove all occurrences
outside of LINUX24.

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

13 years agovlserver: Rationalise usage message
Simon Wilkinson [Thu, 24 Mar 2011 10:57:47 +0000]
vlserver: Rationalise usage message

Rather than having 2 copies of the usage message, just have one
with #ifdef switches to disable options that are not available in
that build.

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

13 years agoptserver: Rationalise usage message
Simon Wilkinson [Thu, 24 Mar 2011 10:28:59 +0000]
ptserver: Rationalise usage message

Rather than having 4 copies of the usage message, just have one
with #ifdef switches to disable options that are not available in
that build.

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

13 years agoHP/UX: Make more use of roken
Simon Wilkinson [Fri, 25 Mar 2011 17:14:26 +0000]
HP/UX: Make more use of roken

Make more use of roken on HP/UX by letting it provide definitions
for random and srandom, and using its implementation of
getdtablesize

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

13 years agocrypto: Fixes for recent Heimdal changes
Simon Wilkinson [Fri, 25 Mar 2011 17:34:51 +0000]
crypto: Fixes for recent Heimdal changes

The last Heimdal import changed the name of a number of structures
so that they are private to the krb5 code. Mirror this by changing our
prototypes to match the new names.

This solves the key_type problem that we previously fixed by #defining
key_type to hc_key_type, so remove that define.

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

13 years agoImport of code from heimdal
Heimdal Developers [Fri, 25 Mar 2011 17:18:37 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
987658325eb7bd6b10882cc4cdd224499e7f7a03 (switch-from-svn-to-git-2052-g9876583)

New files are:
roken/getdtablesize.c

Upstream changes are:

Love Hornquist Astrand (2):
      prefix symbols that are _krb5_ structures
      prefix internal structures with _krb5_

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

13 years agoAdd getdtablesize to the roken import
Simon Wilkinson [Fri, 25 Mar 2011 17:17:47 +0000]
Add getdtablesize to the roken import

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

13 years agoaklog: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 15:58:19 +0000]
aklog: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also add pwd.h to the list of headers that we check for in configure,
and that roken will include if they are available

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

13 years agoNO_DES_H_INCLUDE is no longer necessary
Simon Wilkinson [Thu, 24 Mar 2011 15:50:47 +0000]
NO_DES_H_INCLUDE is no longer necessary

Now that we're using hcrypto for DES, rather than rolling our own,
we don't need to specific NO_DES_H_INCLUDE, so get rid of it.

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

13 years agoptserver: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 10:01:00 +0000]
ptserver: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also reorder our headers so that they go

 #include <afsconfig.h>
 #include <afs/param.h>
 #include <afs/stds.h> (if required)

 #include <roken.h>

 [ ... out of directory headers ... ]

 [ ... local headers ... ]

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

13 years agonew files for FreeBSD packaging at 1.6.0pre3
Ben Kaduk [Fri, 17 Dec 2010 06:16:30 +0000]
new files for FreeBSD packaging at 1.6.0pre3

Packaging for use with FreeBSD's Ports Collection.
The directory layout is flattened, and a couple of files that do not
make sense here are not included.
The afsd rc script lives in packaging/ as it is not runnable in
its committed form, it requires variable substitution that occurs
at install-time from the Ports Collection.

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

13 years agoRemove outdated rc file for afsd on FBSD
Ben Kaduk [Mon, 22 Nov 2010 04:32:37 +0000]
Remove outdated rc file for afsd on FBSD

The semantics of rc scripts have changed drastically since this
was written.  It will need to be rewritten from scratch; the
new version will live in src/packaging/FreeBSD as afsd.in, as it
is included with the port packaging in that form.

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

13 years agoRemove stale FreeBSD packaging
Ben Kaduk [Sat, 6 Nov 2010 04:30:12 +0000]
Remove stale FreeBSD packaging

We no longer use the Transaarc paths, and the rc environment
and packaging methods are quite different now.

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

13 years agoWindows: export roken symbols
Jeffrey Altman [Sat, 26 Mar 2011 20:50:52 +0000]
Windows: export roken symbols

rk_vsnprintf
rk_vasnprintf

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

13 years agoWindows: change log for 1.5.9904 (1.6.0pre4)
Jeffrey Altman [Sat, 26 Mar 2011 17:05:26 +0000]
Windows: change log for 1.5.9904 (1.6.0pre4)

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

13 years agoviced: REALLYCLOSE origfdP after CoW
Andrew Deason [Fri, 25 Mar 2011 20:54:01 +0000]
viced: REALLYCLOSE origfdP after CoW

In StoreData_RXStyle, we save a pointer to the original FdHandle_t if
we need to CopyOnWrite the target vnode, for the purposes of possibly
copying additional data later on.

After the CopyOnWrite call, this points to an inode that is not in the
current volume, and is thus less likely to be accessed. In CopyOnWrite
itself, the original file handle is FDH_REALLYCLOSE'd because of this,
so the handle does not remain in the cache. Do the same in
StoreData_RXStyle, so origfdP is always FDH_REALLYCLOSE'd after we
have called CopyOnWrite.

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

13 years agoRevert "ihandle: Ensure FDH_REALLYCLOSE really closes"
Andrew Deason [Fri, 25 Mar 2011 20:44:57 +0000]
Revert "ihandle: Ensure FDH_REALLYCLOSE really closes"

This reverts commit a50f4c8d802c7b1c258a9cbe388dfab50425596b.

The only difference between FDH_CLOSE and FDH_REALLYCLOSE has to do
with ihandle cache behavior. FDH_REALLYCLOSE just indicates that the
reference we are closing is not likely to be used by other code, and
should be kicked out of the cache immediately (thus closing the file
descriptor). So, if there is another reference to that FdHandle_t, and
it issues an FDH_CLOSE, it thinks that the reference is likely to be
used again soon, and so the handle should not be kicked out of the
cache. Thus, the behavior before a50f4c8d was already correct.

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

13 years agovol: avoid MAXINT redefinition warning in vnode.c
Jeffrey Altman [Tue, 8 Mar 2011 16:04:07 +0000]
vol: avoid MAXINT redefinition warning in vnode.c

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

13 years agoSOLARIS: Perform daemon syscalls as kernel threads
Andrew Deason [Tue, 8 Mar 2011 22:59:32 +0000]
SOLARIS: Perform daemon syscalls as kernel threads

Add AFS_SUN5_ENV to the list of platforms where AFS_DAEMONOP_ENV is
defined. Implement the necessary functionality so we spawn kernel
threads when a daemon syscall is called. Remove the rxk_Listener
wrapper, since it will be called in a separate thread via the
afs_DaemonOp interface.

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

13 years agolibafs: Consolidate afs_DaemonOp code
Andrew Deason [Tue, 8 Mar 2011 21:37:17 +0000]
libafs: Consolidate afs_DaemonOp code

Create the AFS_DAEMONOP_ENV define to simplify the logic of when we
perform afs_DaemonOp-y code paths. Also create the daemonOp_common
function, to perform common pre-fork operations that are common
between platforms.

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