Commit Graph

6383 Commits

Author SHA1 Message Date
Derrick Brashear
41baf5c58f add SRV record lookups to unix afsconf support suite also
create new api call afsconf_LookupServer
make afsconf_GetAfsdbInfo call it
include T_SRV support

Reviewed-on: http://gerrit.openafs.org/594
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-14 14:51:15 -07:00
Simon Wilkinson
34c71e6b11 Add fsint dependency to audit builds
The 'audit' target requires that fsint is built first. Express this as a make
dependency.

Reviewed-on: http://gerrit.openafs.org/660
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-14 14:33:24 -07:00
Jeffrey Altman
94ceae1220 Windows: refactor afs status cloning and clone when fs fetchdata bug detected
When the file server fetchdata invalid length bug is detected the
cache manager must fake the AFS Status info for the file as well
as the AFSVolSync info.   Otherwise, the merge status is incorrect.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/651
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-14 11:04:32 -07:00
Jeffrey Altman
a394d74e44 Revert "Windows: Readonly Volume Versioning for Windows Cache Manager"
This reverts commit bb6e38a45b.

Reviewed-on: http://gerrit.openafs.org/659
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-14 06:32:03 -07:00
Jeffrey Altman
5a403db74e Windows: fix build due to broken src/volser/NTMakefile
Commit 82aa5b4e09 incorrectly
updated the src/volser/NTMakefile resulting in a broken
build system.

Reviewed-on: http://gerrit.openafs.org/658
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-14 05:09:01 -07:00
Marc Dionne
958f547664 Linux: Remove declaration of unused variable filp
filp is unused after the recent rework of osi_file.c

Reviewed-on: http://gerrit.openafs.org/656
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-13 19:11:59 -07:00
Andrew Deason
789580d135 Fix warnings in butc, tbutc, and butm
tbutc:
 - Ignore warnings for dump.c

butc/dump.c:
 - butm_WriteFileData takes a char*, no need to cast buffer

 - volumeHeader_hton takes a struct volumeHeader*, though, need to cast
   buffer there

 - Ignore strict prototypes

butc/recoverDb.c:
 - scanVolData takes a uint*, not an int*

 - Initialize nbytes to 0

 - Remove warning inhibition

butc/tcmain.c:
 - atocl takes an int*, not a uint*

 - Ignore implicit function declaration warnings

butc/tcudbprocs.c:
 - Ignore implicit function declaration warnings (ubik stuff)

butm/file_tm.c:
 - Include sys/wait.h for the waitpid() prototype

Reviewed-on: http://gerrit.openafs.org/635
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-13 18:34:05 -07:00
Jeffrey Altman
664e5aca16 Windows: If SecurityLevel is configured use it for vos.exe and pts.exe
If the SecurityLevel registry value indicates that crypt should be
the default, then always set -encrypt for vos.exe and pts.exe.

Reviewed-on: http://gerrit.openafs.org/648
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-13 12:00:10 -07:00
Andrew Deason
78d8b8c5c1 Use f_bsize for ZFS afs_fsfragsize
On ZFS, the disk space files can use up can be rounded up to the next
recordsize boundary if they've been truncated. This can cause the Unix CM
to mis-estimate cache usage, since it truncates files fairly often, and
assumes the disk space used is the file length rounded up to the next
f_frsize.

Since the ZFS recordsize is available via the statvfs f_bsize, just
round up to that instead. There is still some additional file metadata
that takes up some additional space on disk, but according to ZFS people
I've spoken to about this, it cannot be known in advance. In practice,
the additional metadata storage doesn't appear to exceed about 10% of
the data storage, which should be acceptable.

FIXES 125365

Reviewed-on: http://gerrit.openafs.org/650
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Andrew Deason <adeason@sinenomine.net>
2009-10-13 05:34:49 -07:00
Simon Wilkinson
82aa5b4e09 Add public protoypes for volser
Add a new public header file volser_prototypes.h, which contains
prototypes for those volser functions that are used by the rest of the
tree, and link it into the Unix and Windows build systems.

Rename the current volser_prototypes.h volser_internal.h, and update
references to it.

Make those places that should use the new public header use it, and
re-enable warnings-as-errors as appropriate.

Remove the warning free files from the list in README.WARNINGS

Add butm_prototypes.h to butc/lwps.c, so we can enable warnings for that,
too.

Reviewed-on: http://gerrit.openafs.org/636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-13 05:33:46 -07:00
Andrew Deason
9bd7256927 Formatting typos in pts.pod
Fix a couple of B<...> sequences pod2man yells at us about.

Reviewed-on: http://gerrit.openafs.org/649
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2009-10-12 12:08:59 -07:00
Simon Wilkinson
633047c378 Add afsio to gitignore
Add the new afsio binary to the appropriate .gitignore file

Reviewed-on: http://gerrit.openafs.org/637
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-12 11:35:57 -07:00
Jeffrey Altman
bb6e38a45b Windows: Readonly Volume Versioning for Windows Cache Manager
When the HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
"ReadOnlyVolumeVersioning" DWORD registry value is non-zero, the volserver
will be queried for each .readonly volume to obtain the lastUpdateTime.
The lastUpdateTime will be used as a volume version identifier for each
cm_scache_t object stored in the volume.  With a known volume version,
whenever a current status is obtained for any object within the .readonly volume,
all the cached objects within that volume that have the same volume version
can share the resulting callback registration.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/579
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-12 07:38:52 -07:00
Jeffrey Altman
e026fcb2f0 Windows Explorer Shell Extension: Remove OutputDebugString calls
Remove all OutputDebugString calls from the explorer shell extension.
OutputDebugString() requires acquiring system global locks.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/643
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-12 07:28:26 -07:00
Jeffrey Altman
93fb21a8d0 Windows: Correct lock error codes and log file server lockCount
The error codes that should be returned when a lock request
fails are:

  STATUS_LOCK_NOT_GRANTED for an explicit lock request
  STATUS_SHARING_VIOLATION when a CreateFile fails due to a previous lock

Correct the service to ensure that these values are in fact returned.

Also, add 'fsLockCount' field to cm_scache_t and dump its value
as part of the "fs memdump" output.  This permits some ability to
identify what the file server thinks the lock count is.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/646
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-12 07:27:29 -07:00
Jeffrey Altman
917a860e81 Improve accuracy of Rx RTT calculation by skipping retransmitted packets
Rx RTT calculations are based on Van Jacobson's work using
constants that make computations fast but are not necessarily
the best for modeling Rx protocol exchanges.  This patch does
not alter the constants but does improve the comments to show
that the math is correct.

Phil Karn in 1987 demonstrated that Van Jacobson's algorithms
produced inaccurate results when the RTT computed from an
acknowledgement of a retransmitted packet were included.  The
resulting RTT would either be too small causing the system to
retransmit too many packets or too long resulting in too few
being sent.

This patch follows Phil Karn's advice which was also adopted
as mandatory for TCP in RFC2988.  Retransmitted packets and
delayed acks are skipped and the retransmit time is backed off
(up to a maximum of 3 seconds) until a successful acknowlegement
is received for an initially transmitted packet.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/580
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-12 06:48:59 -07:00
matt@linuxbox.com
76ae0f5189 Use AFS_PROC consistently
Make consistent use of AFS_PROC in portable and mixed files, adding the define
for platforms which lacked it.  This completes a change that has been ongoing
for several years.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/642
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-11 13:17:07 -07:00
Simon Wilkinson
d705e26eac Revert "Linux: kmem_cache_create fix and cleanup"
This reverts commit 6133d25397.

This patch breaks builds on RHEL5.3 - revert it until we can come up
with a fix.

Reviewed-on: http://gerrit.openafs.org/640
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-11 10:44:37 -07:00
Jeffrey Altman
dc94d7da5f Windows: use port when finding server by address
Modify cm_FindServerByIP to search by port as well.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/607
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-10 10:13:26 -07:00
Jeffrey Altman
8788462b65 Windows: Prevent fs fetchdata offset bug error from propagating to caller
When the file server fetchdata offset bug is triggered and detected,
not only do we have to behave as if 'length_found' is zero, but we
also must ignore the RXGEN_CC_UNMARSHAL error that will be returned
from rx_EndCall() due to the parsing error that occurred during the
rx_Read32() call.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/634
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-10 10:06:16 -07:00
Marc Dionne
6133d25397 Linux: kmem_cache_create fix and cleanup
Fix the kmem_cache constructor function to match the current
expected prototype, and cleanup related code.  This has been wrong
for a while, but since we were just passing extra parameters the
only effect was to generate a warning.

- Add a new configure test to detect the new constructor function
signature
- Define the older versions of the constructor in osi_compat.h,
making them call the current version
- Move a few compatibility #defines to osi_compat.h
- Clean up the call to kmem_cache_create by introducing an inline
afs_kmem_cache_create in osi_compat.h

Reviewed-on: http://gerrit.openafs.org/621
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-09 04:04:22 -07:00
Andrew Deason
6d59a0fcd0 Fix warning in vol/namei_ops.c
Commit 906403c6d7 introduced a warning by
making 'error' unused anywhere. Remove the declaration, as well.

Reviewed-on: http://gerrit.openafs.org/620
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 16:18:27 -07:00
Davor Ocelic
94eae9ed26 Update README with solved/pending docs tasks
Reviewed-on: http://gerrit.openafs.org/618
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-08 15:41:33 -07:00
Davor Ocelic
04fa499ac9 Update backup suite manpages
-- Add missing POD links (L<>)

 -- Verify all subcommands and options

 -- Format > 80 columns synopsis lines

Reviewed-on: http://gerrit.openafs.org/617
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-08 15:40:35 -07:00
Davor Ocelic
a6e15c992e Update fstrace suite manpages
-- Add missing POD links (L<>)

 -- Verify all subcommands and options

 -- Format > 80 columns synopsis lines

Reviewed-on: http://gerrit.openafs.org/616
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-08 15:28:56 -07:00
Davor Ocelic
923721f839 Minimal left docs updates for vos suite
Reviewed-on: http://gerrit.openafs.org/615
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-08 15:24:40 -07:00
Andrew Deason
eb46f02e56 Typo in vos_remsite.pod
A typo in c717fcd32c removed the = before
the first head1 in vos_remsite.pod. Put it back.

Reviewed-on: http://gerrit.openafs.org/612
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 13:23:24 -07:00
Davor Ocelic
065d9a65ba Add POD links (L<>) in pts.pod and symlink.pod
Reviewed-on: http://gerrit.openafs.org/610
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 11:00:14 -07:00
Davor Ocelic
c717fcd32c Update vos suite manpages
Larger collection of all vos suite commands, including but
not limited to:

 -- documented all commands / options, verified against both 1.4 and 1.5 tree
    (including the common -encrypt/-noresolve options)

 -- correct order, POD formatting and synopsis for all commands' options

 -- shorthand synopsis provided for all commands that missed it, with proper
    non-ambiguous command abbreviations of all options

 -- POD synopsis formatted to 80-columns in commands where it was running over

 -- for newer options, documented which OpenAFS version they became available

 -- proper manpage links using L<> in vos.pod

Reviewed-on: http://gerrit.openafs.org/609
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 10:59:20 -07:00
Davor Ocelic
dde6f7d840 Allow check-pod to work on specific files or dirs
Reviewed-on: http://gerrit.openafs.org/608
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 10:55:57 -07:00
Davor Ocelic
f387806bd4 Update readme with solved and pending tasks
Reviewed-on: http://gerrit.openafs.org/611
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 10:51:29 -07:00
Andrew Deason
8314001bdb Reduce warnings in vos.c
Squash a few miscellaneous that appear when building vos.c:

 -- CreateVolume should use util_GetUInt32 to parse vol ids, since they
    are now unsigned

 -- The m_uuid argument of print_addrs is altered, so do not declare it
    const

 -- Declare the confDir argument of ugen/vsu_ClientInit to be const,
    since it does not change, and vos.c passes a const confDir in
    MyBeforeProc

 -- Ignore implicit function declaration warnings and remove
    CFLAGS_NOERROR from the vos.c build, since the only remaining
    warning is an implicit function declaration

Reviewed-on: http://gerrit.openafs.org/602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 08:01:05 -07:00
Andrew Deason
c8482d0fb9 Fix warnings in rxkad
Some miscellaneous warnings throughout rxkad:

rxkad/ticket5.c:
 - Explicitly cast ticket blob to unsigned char*, as some functions take
   a ticket as a char*, and some take it as an unsigned char*

 - in tkt_DecodeTicket5, make 'start' and 'end' be unsigned, since that
   is what their callers think they are

 - Ignore implicit function declaration warnings (for CRC functons)

 - Remove general warning inhibition

rxkad/ticket.c:
 - in tkt_DecodeTicket, make 'start' and 'end' be unsigned, since that
   is what their callers think they are

 - Remove general warning inhibition

rxkad/v5der.c:
 - In decode_enumerated, use der_get_unsigned instead of der_get_int,
   since we're decoding an unsigned integer.

rxkad/rxkad_server.c:
 - The last two arguments to rxkad_DeriveXORInfo are char*s, so
   explicitly cast them to be so

 - Remove general warning inhibition

rxkad/rxkad_common.c:
 - rxkad_stats_t has had a couple of spares transform into
   clientObjects/serverObjects; account for them and don't overrun the
   spares array

Reviewed-on: http://gerrit.openafs.org/600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 08:00:13 -07:00
Andrew Deason
549002c906 Remove warnings related to type-punning
cmd/cmd.c:
 - Just make dummy be a struct cmd_item instead of casting

rxdebug/rxdebug.c:
 - Access the stats packet through a union instead of casting and
   dereferencing

util/uuid.c:
 - Access the seed through a union and an array instead of that
   incrementing-pointer approach

Reviewed-on: http://gerrit.openafs.org/599
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 07:59:18 -07:00
Jeffrey Altman
7197d35ef1 Windows: use xdr_alloc to allocate memory for Callback data structs
xdr_alloc must be used instead of malloc in SRXAFSCB_GetLocalCell
and SRXAFSCB_GetCacheConfig

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/606
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 06:13:54 -07:00
Marc Dionne
7f7b4c9aad authclient.c: fix 64-bit specific warnings
Commit 36be36e034 introduced some casts
from an integer type to void *.  This generates warnings on a 64-bit
platform.
Use uintptr_t casts to make the compiler happy.

Reviewed-on: http://gerrit.openafs.org/605
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 06:12:59 -07:00
Jeffrey Altman
3ea144bde5 Add missing variable to afsio
Callback variable missing in WriteFile

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/604
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 04:37:38 -07:00
Jeffrey Altman
e249aace42 Permit DNS SRV record lookups to be used by the Windows afsconf_GetAfsdbInfo
Permit DNS SRV record lookups to be used by the Windows afsconf_GetAfsdbInfo

As per the published DNS SRV internet draft for the AFS3 protocol,
DNS SRV records are to replace AFSDB records as the primary method
of looking up AFS3 service location information.

In order to make that happen for Windows:

1. afsconf_GetAfsdbInfo must be able to translate from internal service
names to IANA assigned service names.

2. The Windows getAFSServer() API must accept IANA service and protocol
parameters as well as the port number to use if AFSDB record fallback is
required.

3. The Windows cache manager must pay attention to the port number
stored within the sockaddr_in structure instead of using hard coded
values based upon the server type.
For afsconf_GetAfsdbInfo, in addition to searching for the requested
IANA service, if that service is prserver or kaserver fallback to
the vlserver record (if any).

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/593
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-08 04:07:08 -07:00
Andrew Deason
38ffa11119 xdrproc_t functions take a caddr_t, not caddr_t*
Callers of xdrproc_t functions give the function a foo* as the second
argument, not a foo**, and the xdrproc_t functions themselves expect
this. Make the xdrproc_t typedef accurately reflect that, thereby
ridding us of some warnings.

Reviewed-on: http://gerrit.openafs.org/603
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:52:26 -07:00
Andrew Deason
1d8118d3da Ignore libafsrpc warnings for shlibafsrpc also
Some warnings were ignored in libafsrpc, but not in shlibafsrpc. Ignore
them in both places.

Reviewed-on: http://gerrit.openafs.org/601
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:51:05 -07:00
Andrew Deason
8ef41263cf Fix warnings in lwp/process.c
-- The EP/ep function does not return anything; declare the function pointer
    accordingly

 -- Explicitly cast &stackvar to char* to avoid a warning

Reviewed-on: http://gerrit.openafs.org/598
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:46:16 -07:00
Andrew Deason
36be36e034 Fix warnings in kauth/authclient.c
-- In ka_Authenticate, explicitly cast 'start' and 'end' to void*,
    since kawrap_ubik_Call takes all arguments as void*s

 -- Fix kawrap_ubik_Call to not be an old-style declaration

 -- Only ignore strict prototypes and implicit function declaration
    warnings

Reviewed-on: http://gerrit.openafs.org/597
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:42:19 -07:00
Andrew Deason
f512597b0a Remove a pointer->integer warning in fstrace.c
Explicitly cast eparm to a long in afs_syscall when calling
proc_afs_syscall, to avoid a warning.

Reviewed-on: http://gerrit.openafs.org/596
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:41:11 -07:00
Andrew Deason
72c2473724 Prototype strcasestr in afsmonitor.c
If we HAVE_STRCASESTR, we lack the prototype for strcasestr in
afsmonitor.c unless we def _GNU_SOURCE before including string.h on GNU
systems. To avoid side-effects or pulling in extra stuff, just prototype
strcasestr ourselves for the time being (if we have it) instead of
def'ing _GNU_SOURCE.

Reviewed-on: http://gerrit.openafs.org/595
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:40:09 -07:00
Andrew Deason
db949b7fad Correct and use AFS_SIZET_FMT
On *nix, a size_t needs either %lu or %u to be interpolated in a string,
depending on if we're on an ILP32 arch or not. Define AFS_SIZET_FMT
accordingly, and actually use AFS_SIZET_FMT when we try to print a
size_t.

This removes numerous -Wformat warnings, at least when building on
i386_linux26.

Reviewed-on: http://gerrit.openafs.org/592
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 20:09:30 -07:00
Michael Meffie
6ef4627412 Allow gnu-style long options
New users are surprised when OpenAFS command options
cannot be prefixed with two dashes, as is common
with most modern tools.  Permit an extra dash for
common commands when more than one character is
given. For example vos listvol --server foo.bar.com is
equivalent to vos listvol -server foo.bar.com, but
vos listvol --s foo.bar.com is an error.

Reviewed-on: http://gerrit.openafs.org/216
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 14:42:21 -07:00
Hartmut Reuter
1793f454e4 pioctl with VIOC_FS_CMD removed
This should ease the ingtegration for Windows.
Instead RXAFS_FetchStatus is called.

Reviewed-on: http://gerrit.openafs.org/590
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-07 14:01:29 -07:00
Jeffrey Altman
811418887d Build afsio on Windows; remove many warnings
With this commit afsio builds on Windows.   It will not work
until the VIOC_FS_CMD OSD extension is implemented in the
Windows Cache Manager.

Required changes:

  * Export ugen_ClientInit from libafsauthent.dll

  * Fix util_GetInt64 and util_GetUInt64 to return afs_int32
    instead of afs_int64 since it is just returning success
    or error

  * Define VIOC_FS_CMD for Windows even though it isn't implemented

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/587
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 12:34:39 -07:00
Andrew Deason
906403c6d7 Make namei convertROtoRW'd volumes usable
Right now, if you convertROtoRW a volume on namei, the converted volume
appears to need a salvage before it is usable, and the header of the old
(now empty) RO volume is kept around. Fix this:

 -- Set inUse = 0 on the converted volume, so the fileserver will be
    able to attach the volume when we give it back

 -- Unlink the RO header file, instead of trying to unlink the
    VI_VOLINFO file twice

 -- Log the actual error code (errno) in the error message for the last
    unlink

Reviewed-on: http://gerrit.openafs.org/591
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 12:31:18 -07:00
Simon Wilkinson
e3d1eaf0ca Use page_offset() on Linux
Since time began, Linux has provided page_offset() to turn a
page index into an offset into the corresponding file. Make us use
this everywhere we calculate a page offset, rather than doing our
own maths.

Reviewed-on: http://gerrit.openafs.org/581
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-07 02:44:45 -07:00