openafs.git
9 years agoviced: Fix host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:25:00 +0000]
viced: Fix host enumeration flags

Do not give uninitialized flags values to h_Enumerate callback
functions. In fact, do not give a flags value to h_Enumerate or
h_Enumerate_r callback functions at all, since they are not actually
used.

Fix host enumeration callback functions to just return 0 or the
relevant flags, instead of basing the return value off of the given
flags value. Update MultiBreakVolumeCallBack_r to use the correct
return values, since it currently tries to use the old meanings of the
host enumeration return values.

FIXES 129376

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

9 years agoWindows: remove trailing whitespace
Jeffrey Altman [Mon, 25 Apr 2011 11:58:49 +0000]
Windows: remove trailing whitespace

remove trailing whitespace from

  NTMakefile
  *.h
  *.c
  *.cpp
  *.idl
  *.def
  *.txt
  *.htm

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

9 years agoautoconf: Add required headers to net/if.h test
Simon Wilkinson [Sat, 23 Apr 2011 15:28:49 +0000]
autoconf: Add required headers to net/if.h test

On Darwin, net/if.h is only usable if sys/socket.h is included first.
Do so, to stop autoconf from warning about this test.

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

9 years agoWindows: Remove duplicate file
Simon Wilkinson [Mon, 25 Apr 2011 12:56:38 +0000]
Windows: Remove duplicate file

The 'Streamfiles.txt' file had been committed with both that name,
and an all lower case name. This makes git very sad on systems with
case insensitive filenames.

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

9 years agoFix build of user-space on nbsd50 and greater
Jonathan A. Kollasch [Thu, 21 Apr 2011 15:20:55 +0000]
Fix build of user-space on nbsd50 and greater

Change-Id: I7b2fef051da7c5ff820e9ecb1fe77b8d8d9e011a
Reviewed-on: http://gerrit.openafs.org/4509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoAdd nbsd60 param files and autoconf logic
Jonathan A. Kollasch [Thu, 21 Apr 2011 08:24:15 +0000]
Add nbsd60 param files and autoconf logic

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

9 years agoRevert "aklog: Return token when performing 524 conversion"
Andrew Deason [Thu, 21 Apr 2011 21:19:58 +0000]
Revert "aklog: Return token when performing 524 conversion"

This reverts commit 65186d8390a06fb0b7331b2472db07b6fb306446, which
was mistakenly merged to the wrong branch.

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

9 years agolibafs: Initialize _settok_tokenCell primary flag
Andrew Deason [Thu, 21 Apr 2011 22:10:13 +0000]
libafs: Initialize _settok_tokenCell primary flag

Always set the *primary flag to something in _settok_tokenCell.
Otherwise, the lag may be unset, as it is not required to be
initialized by all callers.

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

9 years agoWindows: change thyper to offset and fix error
Jeffrey Altman [Tue, 19 Apr 2011 17:17:56 +0000]
Windows: change thyper to offset and fix error

In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.

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

9 years agoDarwin CM: afs_IsDynrootFid takes a fid ...
Simon Wilkinson [Thu, 21 Apr 2011 17:18:54 +0000]
Darwin CM: afs_IsDynrootFid takes a fid ...

... not a vcache.

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

9 years agoaklog: Return token when performing 524 conversion
Andrew Deason [Thu, 21 Apr 2011 19:24:45 +0000]
aklog: Return token when performing 524 conversion

We weren't actually returning a token and username from
rxkad_get_converted_token. Do so.

This is a 1.6-specific change. This issue was fixed on master when
aklog was changed to use the new SetTokenEx family of pioctls in
commit 53837416cbed3ba4d11f63015e1f13800519f2ed.

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

9 years agoafsio: fix objdir build
Derrick Brashear [Thu, 21 Apr 2011 14:26:42 +0000]
afsio: fix objdir build

use the relative path for afsio.c
use objdir path for generated files

Change-Id: I3b16108eacd949bcb1ddc2224961e87bce9999bb
Reviewed-on: http://gerrit.openafs.org/4508
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoUnused variable warning fixes
Marc Dionne [Wed, 20 Apr 2011 02:42:12 +0000]
Unused variable warning fixes

Fix several simple cases of unused variables.

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

9 years agoAllocate system type ID numbers for i386_nbsd60 and amd64_nbsd60
Jonathan A. Kollasch [Wed, 20 Apr 2011 10:00:34 +0000]
Allocate system type ID numbers for i386_nbsd60 and amd64_nbsd60

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

9 years agoMake whitespace consistent in NetBSD system type ID number section
Jonathan A. Kollasch [Wed, 20 Apr 2011 09:53:52 +0000]
Make whitespace consistent in NetBSD system type ID number section

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

9 years agoadminutil: parallel build fixes
Marc Dionne [Sun, 17 Apr 2011 18:06:57 +0000]
adminutil: parallel build fixes

Rearrange the Makefile to make it more parallel build proof.
Add some dependencies on the header files, and avoid rules
with 2 targets.

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

9 years agoFreeBSD: Don't ignore Makefile
Simon Wilkinson [Sat, 16 Apr 2011 13:50:11 +0000]
FreeBSD: Don't ignore Makefile

The file src/packaging/FreeBSD/Makefile is part of the repository,
and so shouldn't be excluded by .gitignore (the exclusion is inherited
from the top level). So, restore it with .gitignore in this directory.

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

9 years agolibafscp: add lock support
Derrick Brashear [Fri, 15 Apr 2011 17:45:57 +0000]
libafscp: add lock support

add support for locking as well as for tracking callbacks so a
lock break can be detected

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

9 years agoWindows: avoid race when writing mountPointString
Jeffrey Altman [Tue, 19 Apr 2011 04:12:49 +0000]
Windows: avoid race when writing mountPointString

cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData().  Only copy the data into
the mountPointStringp buffer under the rwlock.

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

9 years agomake afsdump_scan get ACLs right
Stephan Wiesand [Sun, 17 Apr 2011 22:37:36 +0000]
make afsdump_scan get ACLs right

This makes afsdump_scan get the ACLs right on little endian systems.
It also corrects and slightly beautifies some output (indentation,
cut&paste error for negative ACL label).

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

9 years agoroken header dependencies mean we need roken
Derrick Brashear [Sat, 16 Apr 2011 21:44:28 +0000]
roken header dependencies mean we need roken

and probably more than just these but let's start here.

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

9 years agoauth: Set correct flags in token_extractRxkad
Andrew Deason [Thu, 14 Apr 2011 19:36:36 +0000]
auth: Set correct flags in token_extractRxkad

The flags that token_extractRxkad returns are flags that are passed to
ktc_SetToken, not the flags that are passed directly to the PSetTokens
pioctl. So, we should be setting AFS_SETTOK_SETPAG, which is
interpreted by ktc_SetToken.

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

9 years agolibafscp: fix kerberos bits
Derrick Brashear [Fri, 15 Apr 2011 17:36:04 +0000]
libafscp: fix kerberos bits

get the correct afs principal. this entire blob will go away
and be replaced by rxgk token getting, but deal for now.

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

9 years agolibafs: Remove afs_write duplication
Simon Wilkinson [Wed, 13 Apr 2011 14:21:46 +0000]
libafs: Remove afs_write duplication

The afs_write() code for memory and disk cache suffered from exactly
the same duplication problems as the afs_read() code.

Apply a similar fix - unify afs_UFSWrite and afs_MemWrite into a single
afs_write function, place the UFS specific code into afs_UFSWriteUIO,
and make use of the existing afs_MemWriteUIO for the memcache case.

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

9 years agolibafscp fixes
Derrick Brashear [Fri, 15 Apr 2011 17:34:14 +0000]
libafscp fixes

fix callback package in libafscp to track addresses correctly (use
correct byte order)

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

9 years agoafsio: rewrite using libafscp
Chaz Chandler [Tue, 20 Jul 2010 14:25:20 +0000]
afsio: rewrite using libafscp

afsio is a utility for file transfer to and from AFS file space
without the help of the AFS client/cache manager.  Using libafscp,
this (partially rewritten) version of afsio is able to accomplish
(1) authenticated access to an AFS path or FID (an existing
KerberosV ticket is required), (2) fall back on unauthenticated
("anonymous") access if authentication (token acquisition) fails,
and (3) work independtly of the AFS cache manager (afsd need not
be running, though CellServDB and ThisCell are currently required).

issues:
1) libvldbint and libafsint are not compiled pthreaded. we link in
what we need. this should be changed when we are all-pthreaded.
2) venus is not a pthreaded-directory otherwise. same deal:
in an all-pthreaded universe, undo the bodge that we do here.
3) venus is not an all-krb5 directory either. slight ick.

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

9 years agoRX: Remove allocation counters
Andrew Deason [Thu, 14 Apr 2011 19:11:22 +0000]
RX: Remove allocation counters

Remove the osi_alloccnt and osi_allocsize counters, and the associated
osi_alloc_mutex. These counters are pretty useless since nothing looks
at them, and their use of a mutex requires Rx to be initialized before
XDR can be used. Removing them lifts this restriction.

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

9 years agoSuppress cmp component version error messages
Andrew Deason [Wed, 13 Apr 2011 17:39:19 +0000]
Suppress cmp component version error messages

When we use cmp to determine whether to replace
AFS_component_version_number.c, suppress stderr in addition to stdout,
to slightly reduce output during the build.

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

9 years agoAIX51: Fix PAGs
Andrew Deason [Fri, 15 Apr 2011 16:18:37 +0000]
AIX51: Fix PAGs

On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.

This effectively reverts 277c37f48c8126ba9cb986ffc7361fcb98e2bbf2, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.

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

9 years agotsm41: Reformat function definitions
Andrew Deason [Fri, 15 Apr 2011 17:38:37 +0000]
tsm41: Reformat function definitions

Make function definitions consistent with the formatting in the rest
of the tree.

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

9 years agopam: Use PAM_CONST more often
Andrew Deason [Wed, 13 Apr 2011 15:52:50 +0000]
pam: Use PAM_CONST more often

Some callers of pam_get_item et al were just casting their argument to
a const void **. Some PAM implementations (Linux) want a const void**,
but others (Solaris) do not. Use the PAM_CONST symbol already defined
by autoconf to declare or cast the relevant variable const or not as
appropriate.

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

9 years agopam: Check for null upwd from getpwnam_r
Andrew Deason [Wed, 13 Apr 2011 16:10:52 +0000]
pam: Check for null upwd from getpwnam_r

The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.

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

9 years agopam: Use POSIX getpwnam_r on Solaris
Andrew Deason [Wed, 13 Apr 2011 16:08:09 +0000]
pam: Use POSIX getpwnam_r on Solaris

_POSIX_PTHREAD_SEMANTICS is now always defined for Solaris, which
means we get a POSIX-conforming getpwnam_r, which takes 5 arguments.
So, add Solaris to the list of platforms that use a POSIX getpwnam_r.

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

9 years agovfsck: Fix roken fallout
Andrew Deason [Wed, 13 Apr 2011 17:15:12 +0000]
vfsck: Fix roken fallout

Including roken.h in vfsck sources pulls in some more modern headers
that vfsck code isn't used to. Accommodate:

 - Prevent roken.h from pulling in dirent.h so we don't conflict with
   the old-style directory defines for HP-UX. Also move the inclusion
   of the old-style directory defines to before roken.h, so we have
   the directory types defined in roken.h.

 - Remove some prototypes so the don't conflict with the prototypes in
   system headers.

 - Remove a couple of bizarre vprintf invocations, as they conflict
   with the actual vprintf definitions.

Change-Id: Ifd7cd2544e75ed49b93ab491c4acadcb18528315
Reviewed-on: http://gerrit.openafs.org/4472
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agokernel upcall rx env should shut down event daemon
Derrick Brashear [Fri, 15 Apr 2011 12:02:22 +0000]
kernel upcall rx env should shut down event daemon

also shut down event daemon in upcall environment

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

9 years agoFix some configure header prereqs
Andrew Deason [Wed, 13 Apr 2011 15:34:37 +0000]
Fix some configure header prereqs

On at least Solaris, the configure tests for netinet/if_ether.h and
security/pam_modules.h issued warnings because they existed but were
not compilable. Perform the tests with the prerequisite headers of
net/if.h and security/pam_appl.h, respectively, so autoconf will stop
yelling at us.

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

9 years agoRX: Include sys/file.h for rx_lwp.c
Andrew Deason [Wed, 13 Apr 2011 15:11:59 +0000]
RX: Include sys/file.h for rx_lwp.c

rx_lwp.c uses FNDELAY, which requires sys/file.h on at least Solaris.
So, include it.

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

9 years agoasetkey: permit des-cbc-md5 and des-cbc-md4 keys
Jeffrey Altman [Tue, 12 Apr 2011 15:48:27 +0000]
asetkey: permit des-cbc-md5 and des-cbc-md4 keys

A DES key is a DES key.  Permit importing CRC, MD5 and MD4
when using non-MIT keytab support.

Add a special error message that specifies what principal
name, kvno, and enctype were being searched for when the
error is KRB5_KT_NOTFOUND.

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

9 years agolibafs: Remove unecessary parameters to afs_read
Simon Wilkinson [Tue, 12 Apr 2011 18:49:38 +0000]
libafs: Remove unecessary parameters to afs_read

We were providing additional buffer and length parameters to
afs_read which are now unused, as the necessary information is
contained within the iovec. Just remove these parameters to tidy the
code up a bit.

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

9 years agolibafs: Remove afs_read duplication
Simon Wilkinson [Tue, 12 Apr 2011 18:41:30 +0000]
libafs: Remove afs_read duplication

The disk cache and memcache afs_read functions are effectively
duplicates of each other. Abstract out the common code into a generic
afs_read() function, and put the cache type specific code into
UFSReadUIO (there is already a MemReadUIO which contains the code
necessary for the memcache).

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

9 years agofs: Abstract out code to get the last component
Simon Wilkinson [Tue, 12 Apr 2011 18:28:15 +0000]
fs: Abstract out code to get the last component

fs.c contained two identical copies of code to parse a path, resolve
any symbolic links in that path, and return the directory and basename.

Abstract this code out into a single function, rather than maintaining
two separate copies of it.

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

9 years agolibuafs: Add afsd symlink to the clean rules
Simon Wilkinson [Tue, 12 Apr 2011 18:48:02 +0000]
libuafs: Add afsd symlink to the clean rules

The libuafs Makefile creates a link to afsd in the libuafs build
directory. So, have the clean rule tidy it up after us.

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

9 years agoviced: Remove logging duplication
Simon Wilkinson [Fri, 8 Apr 2011 15:18:13 +0000]
viced: Remove logging duplication

In lots of places in the fileserver we were doing
    ViceLog(0, (x))
    osi_Panic(x)

Remove this duplication by creating a new macro, ViceLogThenPanic,
which does both of these in one fell swoop.

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

9 years agofix manpage for udebug -servers
Ken Dreyer [Mon, 11 Apr 2011 21:24:41 +0000]
fix manpage for udebug -servers

The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.

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

9 years agoroken: export tsearch, tdelete, tfind on windows
Jeffrey Altman [Mon, 11 Apr 2011 14:29:28 +0000]
roken: export tsearch, tdelete, tfind on windows

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

9 years agoafscp: build for windows
Derrick Brashear [Mon, 4 Apr 2011 17:43:44 +0000]
afscp: build for windows

attempt windows support for afscp

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

9 years agoDAFS: Request salvage on detach for volser
Andrew Deason [Fri, 8 Apr 2011 18:00:15 +0000]
DAFS: Request salvage on detach for volser

When the volserver notices that a volume needs salvaging, mark
V_needsSalvaged. So when we VDetachVolume the volume, we can then just
request the salvage in the volume package.

Fix the VolClone salvaging code to do this as well, instead of using
the vol-private VRequestSalvage_r interface.

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

9 years agovolser: Avoid assert on ViceCreateRoot failure
Andrew Deason [Thu, 7 Apr 2011 17:36:19 +0000]
volser: Avoid assert on ViceCreateRoot failure

If IH_CREATE fails in ViceCreateRoot, it may just be due to an on-disk
inconsistency. So, don't assert, but just return an error and detach
the volume.

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

9 years agoDAFS: Do not give back vol to viced after salvage
Andrew Deason [Thu, 7 Apr 2011 18:51:14 +0000]
DAFS: Do not give back vol to viced after salvage

If we VRequestSalvage_r a volume successfully, and we are not the
fileserver, we will tell the fileserver to salvage a volume. So, we do
not need to give back the volume afterwards, since telling the
fileserver that a volume needs a salvage effectively gives it back (so
the salvager can take it).

So, clear needsPutBack so we don't try to also give back the volume,
and avoid the fileserver yelling at us for trying to give back a
volume that is checked out by someone else (or is not checked out at
all).

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

9 years agoadd tsearch to Windows
Derrick Brashear [Fri, 8 Apr 2011 15:12:34 +0000]
add tsearch to Windows

roken now has tsearch for windows. add it.

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

9 years agoImport of code from heimdal
Heimdal Developers [Mon, 11 Apr 2011 02:13:08 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
988355d9d0d1953e8c17c4b5c935938573efe4ba (switch-from-svn-to-git-2070-g988355d)

Upstream changes are:

Derrick Brashear (1):
      roken: Make tsearch build on windows

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

9 years agoXDR: decouple from system XDR implementation
Andrew Deason [Mon, 2 Aug 2010 18:23:34 +0000]
XDR: decouple from system XDR implementation

Since commit 7293ddf325b149cae60d3abe7199d08f196bd2b9 we have stopped
trying to use the system-provided XDR implementation, but the xdr_ops
structure was still structured to accomodate for the old limitations
of the system XDR. Change xdr_ops so it is just always one consistent
structure.

This removes:

 - The AFS_XDR_64BITOPS define and all related code, since we never
   call the 64-bit versions of getint and putint ourselves

 - The rearrangement of getint32/putint32 depending if we are in
   Solaris kernel-land or not

 - The .x_control field

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

9 years agoptserver: Add cmdline options for config and log
Simon Wilkinson [Wed, 23 Mar 2011 16:31:42 +0000]
ptserver: Add cmdline options for config and log

Make it possible to set the location of the ptserver's configuration
directory, and the file that it logs to, from the command line. This
makes it possible to bring up a ptserver without requiring an
installation on the system for testing purposes.

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

9 years agoImport of code from heimdal
Heimdal Developers [Sat, 9 Apr 2011 13:46:26 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
2a32bf67f0a7c77b6adf6e7c23ec8abe7937a9ea (switch-from-svn-to-git-2067-g2a32bf6)

Upstream changes are:

Derrick Brashear (1):
      Add tsearch and friends, and a test program

New files are:
roken/search.hin
roken/tsearch.c

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

9 years agoImport tsearch.c from roken
Derrick Brashear [Fri, 8 Apr 2011 14:59:35 +0000]
Import tsearch.c from roken

Add tsearch.c (and search.hin) to the files we import from heimdal

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

9 years agotests: Remove spurious rxgk reference
Simon Wilkinson [Thu, 7 Apr 2011 17:07:32 +0000]
tests: Remove spurious rxgk reference

A reference to the rxgk library crept into auth Makefile ahead of
time. Remove it so that tests can continue to work in trees without
rxgk.

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

9 years agoafsd: Trim trailing slashes on Linux mntent
Andrew Deason [Wed, 6 Apr 2011 21:56:22 +0000]
afsd: Trim trailing slashes on Linux mntent

When we write a mount entry on Linux when mounting /afs, trim trailing
slashes on the mount path. Otherwise, the umount utility can get
slightly confused, and leave the /afs mount entry in /etc/mtab after
it's been unmounted.

For full correctness we should probably completely canonicalize the
path like the mount utility does, but it's unlikely that anyone will
provide significantly weird paths for cacheMountDir, so don't bother.

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

9 years agoWindows: Use roken gettimeofday implementation
Simon Wilkinson [Sun, 3 Apr 2011 15:31:56 +0000]
Windows: Use roken gettimeofday implementation

Use the gettimeofday implementation from roken, rather than brewing
our own on Windows.

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

9 years agoImport of code from heimdal
Heimdal Developers [Thu, 7 Apr 2011 18:39:30 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
a597ccdde692709ab387cde21518f09eb501c5a1 (switch-from-svn-to-git-2063-ga597ccd)

Upstream changes are:

Simon Wilkinson (1):
      roken: Rename gettimeofday replacement

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

9 years agovlserver: Add options for config, log and db
Simon Wilkinson [Thu, 24 Mar 2011 12:28:10 +0000]
vlserver: Add options for config, log and db

Make it possible to set the location of the vlserver's configuration
directory, database file, and the file that it logs to, from the
command line. This makes it possible to bring up a vlserver without
requiring an installation on the system for testing purposes.

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

9 years agosalvager: Do not AskDelete on GetInodeSummary fail
Andrew Deason [Thu, 31 Mar 2011 17:51:44 +0000]
salvager: Do not AskDelete on GetInodeSummary fail

GetInodeSummary can fail due to a number of different reasons, not
just because the VG doesn't exist. If, for example, we just fail to
write the temporary inode file, we will return with an error, but we
should not AskDelete the volume in that instance.

GetInodeSummary already has code to delete the volumes in question
when no inodes are found, so remove the extra AskDelete after
GetInodeSummary returns.

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

9 years agosalvager: Error volumes on GetInodeSummary errors
Andrew Deason [Thu, 31 Mar 2011 22:22:12 +0000]
salvager: Error volumes on GetInodeSummary errors

When GetInodeSummary fails due to an internal failure (not from just
failing to find applicable inodes), currently it just returns an
error, and does not return the checked-out singleVolumeNumber back to
the fileserver.

When we fail to gather inodes, we should force the volume to an error
state, since we haven't salvaged the volume. But if we fail to find
any applicable inodes, we just want to VOL_DONE the volume, since the
header has possibly been destroyed, and the volume doesn't exist.

So, issue an FSYNC_VOL_FORCE_ERROR command when we encounter errors in
GetInodeSummary, except when we fail to find applicable inodes.

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

9 years agoubik: don't rely on timeout value after select()
Marc Dionne [Wed, 6 Apr 2011 01:30:20 +0000]
ubik: don't rely on timeout value after select()

The value of timeout after a select() call should be considered
undefined; relying on its value is not portable.
Since IOMGR_Select doesn't modify the timeout it is given, the
intention of the code seems to be to wait for gradually increasing
timeout values, starting at 50ms.  At least under Linux, the
timeout gets set to 0 by select() if it waited for the full specified
time, resulting in a much shorter maximum possible wait period.

Initialize the timeout value for each loop according to the existing
logic, to get consistent behaviour between the lwp and pthreaded code.

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

9 years agoAtomically collect callbacks to be broken
Rainer Toebbicke [Mon, 6 Dec 2010 14:39:25 +0000]
Atomically collect callbacks to be broken

Collect callbacks to be broken in one go, otherwise a file server may
lock out a client while new callbacks tickle in.

With revised multi_Rx, responses get handled early, taking away an argument for
issuing callbacks in small chunks -> crank up chunk size.

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

9 years agoCorrect strftime callers
Andrew Deason [Tue, 5 Apr 2011 19:51:26 +0000]
Correct strftime callers

Some strftime callers were not using the resultant string
appropriately. Correct them to have the same behavior as when we were
using afs_ctime (which included a trailing newline).

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

9 years agoubik: take DB lock in ubik_GetVersion
Marc Dionne [Sat, 19 Mar 2011 13:21:56 +0000]
ubik: take DB lock in ubik_GetVersion

The lock is needed to copy the database version.
Note that this function is currently unused in OpenAFS.

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

9 years agoubik: DB lock usage in ubik_Flush and ubik_Write
Marc Dionne [Sat, 29 Jan 2011 18:28:05 +0000]
ubik: DB lock usage in ubik_Flush and ubik_Write

ubik_Flush and ubik_Write need to hold the DB lock to use iovec_info
or iovec_data

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

9 years agoubik: SVOTE_Beacon should hold the DB lock for CheckTid
Marc Dionne [Sat, 29 Jan 2011 17:09:30 +0000]
ubik: SVOTE_Beacon should hold the DB lock for CheckTid

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

9 years agoubik: Document lock ordering
Marc Dionne [Mon, 7 Mar 2011 18:55:19 +0000]
ubik: Document lock ordering

Document the required lock ordering for the new locks.
The text is adapated from Jeffrey Hutzelman's notes.

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

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>

9 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>