Commit Graph

206 Commits

Author SHA1 Message Date
Andrew Deason
219276bab0 Resolve symlinks for 'fs rmmount'
'fs rmmount' is the only 'fs' command that does not resolve symlinks
for its pioctls for some reason. Make it resolve symlinks.

Thanks to Arne Wiebalck.

Change-Id: Ifb6bdf0b381abd2e157d93d7eea4d853e1b3a689
Reviewed-on: http://gerrit.openafs.org/1805
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-22 09:37:16 -07:00
Andrew Deason
5a7d6da525 Kill afs_inet_ntoa
Replace all calls to afs_inet_ntoa with the threadsafe
afs_inet_ntoa_r. afs_inet_ntoa was being used in a few places that may
be threaded (ubik), and in general should be avoided in case the
relevant code becomes threaded. Remove the definition of afs_inet_ntoa
to prevent anyone from using it.

Change-Id: I163d3f58fdd3d28077780963ced9995247682d78
Reviewed-on: http://gerrit.openafs.org/1680
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-01 20:39:34 -07:00
Jeffrey Altman
7b6ccc1b91 Windows: Permit Windows to build
Recent changes added a new dependency of afspioctl.lib to all
server binaries.

Export new afsconf_ functions from libafsauthent.dll

Fix afsconf_* usage in afsio.c

Change-Id: I03e377a3d28b4efbea4a799e6ca63606eab699c9
Reviewed-on: http://gerrit.openafs.org/1273
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-09 11:54:37 -08:00
Simon Wilkinson
d5622d0319 Add rx security index enum
Add a enumerated type for rx security indexes, initially containing
the values reserved for null, kad, gk, and k5. Start to use this type,
and related names, rather than hard values throughout the code.

Change-Id: Ic71e5da28b4270abf7b6688b2c6438f17268f1da
Reviewed-on: http://gerrit.openafs.org/1242
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-09 09:07:09 -08:00
Simon Wilkinson
d72846bb0a Fix fs storebehind on files with 2 or more servers
fs storebehind didn't allocate a large enough buffer for its call
to VIOCWHERIS. This meant that when it was called on a file with
more than one server (one in a readonly volume), it would error
out with E2BIG, rather than a more appropriate message.

Fix this, by using the generic 'space' buffer for the VIOCWHERIS
call.

Change-Id: Ida0d40175f07ad528720ca700db5b5027b975095
Reviewed-on: http://gerrit.openafs.org/1224
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-03 13:29:57 -08:00
Simon Wilkinson
a1fd212bc6 Make twiddle build
Update the twiddle utility (for manipulating rx settings in the
Unix CM) so that it builds with error checking enabled.

Also, add the binary to the gitignore file in that directory.

Change-Id: I5c19832579db139e5c558b3488d7c49fdb7c08c4
Reviewed-on: http://gerrit.openafs.org/1222
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-03 13:25:22 -08:00
Simon Wilkinson
d008089a79 Add interface to select client security objects
Add a pair of interfaces to support the selection of a security
object by the client. The idea of these interfaces is to abstract
out the job of selecting an interface from the client code itself,
and into a common library. This reduces duplicated code, and makes
it easier to add new security objects in the future.

Change-Id: I2bf411e6b56534070c827d009d36fa8a618c4511
Reviewed-on: http://gerrit.openafs.org/1219
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-03 13:07:04 -08:00
Derrick Brashear
44147f3c02 icl trace code deduplication
right now we have 2 copies of the same code for dealing with traced objects.
it's the same code! make a function, and call it 4 times.

Change-Id: I1c8b6d7b2cff59108eada1522ba1ec76efeba421
Reviewed-on: http://gerrit.openafs.org/1199
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-02-02 06:08:22 -08:00
Marc Dionne
fdee40d8ea up.c: remove unused variable pageSize
Variable pageSize is declared and set to the system page size
using getpagesize(), but the value is not used anywhere.

getpagesize() doesn't necessarily have a prototype declared in
unistd.h with recent glibc, which can generate a new warning and
trip up an enabled-checking build.

Instead of trying to put in a workaround, just remove the unused variable.

Change-Id: I6a9519eb2642bb0479edd1cf1195ce3f751c72bb
Reviewed-on: http://gerrit.openafs.org/1117
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-01-16 21:29:11 -08:00
Andrew Deason
9651fd726f Fix warnings in fs.c with --enable-cache-bypass
Fix some warnings in src/venus/fs.c so we can compile with
--enable-cache-bypass and --enable-checking:

 -- Include ctype.h so isdigit gets a prototype

 -- Make BypassThresholdCmd have the proper signature

 -- Remove the unused 'size' variable

Change-Id: I09afc6c04c990476226d1c2a751e23d3d39085b6
Reviewed-on: http://gerrit.openafs.org/1025
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-23 13:12:44 -08:00
Michael Meffie
846f772601 Prefix global defines
Prefix constants relocated to the common afs_consts.h
header to void naming collisions.

Change-Id: Ib657e00385002c957b40b36058f260c6cabd108c
Reviewed-on: http://gerrit.openafs.org/905
Reviewed-by: Mickey Lane <mlane@sinenomine.net>
Tested-by: Mickey Lane <mlane@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-21 13:40:11 -08:00
Michael Meffie
2b8e09315c Consolidate duplicate definitions
Housekeeping change to consolidate some common definitions.
Create a new common header called afs_consts.h.  This allows
us to remove the afscp.c dependency on afs.h (so src/tests
will build again.) Rename the max filename definition in the
update server package to MAXFNSIZE to avoid a name conflict
with MAXSIZE.  The global defines will be prefixed with
AFS_ in a second patch.

Change-Id: I2b8d555a244cc92d889618de4eec4a99550d7c7f
Reviewed-on: http://gerrit.openafs.org/855
Reviewed-by: Mickey Lane <mlane@sinenomine.net>
Tested-by: Mickey Lane <mlane@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-21 13:36:05 -08:00
Simon Wilkinson
03b5994d7b Remove AFS_USEBUFFERS
The AFS_USEBUFFERS code has been disabled for all supported platforms
since the initial OpenAFS code drop. Simplify the buffers code by
removing it entirely.

Change-Id: Iab6b2d54361eca1a1446b4804b3d6533d75f2831
Reviewed-on: http://gerrit.openafs.org/894
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-06 20:31:39 -08:00
Simon Wilkinson
b9eaf43bbe Don't cast the pointer past to memset
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.

Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 11:34:12 -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
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
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
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
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
Hartmut Reuter
e5cf14ba04 New option '-cmd' for 'fs listacl'
prints 'fs setacl' commands necessary to create the current
ACLs. This is useful for backup scripts using TSM (or others)
to save the ACLs into a file to allow for later restore.

Reviewed-on: http://gerrit.openafs.org/556
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-06 05:29:36 -07:00
Hartmut Reuter
4e3d3d5049 afsio is a command to pipe data into or out of afs files
afsio bypasses the cache manager to achieve higher throughput.
However, it uses the cache manager to stat or create files over the
AFS path.

Besides 'apropos' and 'help' there are 3 subcommands:

'write'	pipes data into a new or empty AFS file

'append' pipes data at the end of an existing AFS file

'read' pipes data out of an AFS file

for 'write' there is an option '-md5' which calculates on the fly
the md5 chscksum and prints it to stdout. (Useful when you create
long time archives to keep it separately for later ...)

for 'write' there is also an option '-synthesize <size>' to do just
performance tests. It creates a file which contains at the
begin of each 4 KB block the offset printed in ascii.

for all subcommands exists a '-verbose' option which writes to
stderr data rate and timing information.

All three subcommands may also be used prefixed with 'fid' accepting
then a Fid instead of an AFS path. With the 'fid' prefix also a '-cell'
option is allowed.

Reviewed-on: http://gerrit.openafs.org/555
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-05 02:14:34 -07:00
Simon Wilkinson
a53732ef5f Miscellaneous warning cleanup
Assorted warning cleanup, that it didn't seem to make sense having one
patch per file for.

This patch
    - Adds some casting for syscall pointers
    - ANSIfies SRXAFSCB_GetDE in fsprobe
    - Loads sys/ioctl.h on some more platforms in usd
    - Includes some missing header files
    - Removes unused variables
    - Makes it clear that VIsSalvager does handle all enumerated types
    - Adds some more prototypes

Reviewed-on: http://gerrit.openafs.org/508
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:58:16 -07:00
Marc Dionne
581ec9f06a Eliminate some "implicit function declaration" warnings
Include appropriate header files to eliminate some warnings for
implicit function declarations.  These are simple cases that don't
generate new warnings because of the prototypes.
Use grp.h if it exists to get setgroups() definition.

Reviewed-on: http://gerrit.openafs.org/233
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-07-27 10:55:35 -07:00
Marc Dionne
25eb69a32a Disable kdump build on linux 2.6
Don't try to build kdump on linux 2.6 where it has been known to be broken
for a long time.  The build failure was ignored, but produced a large number
of errors and warnings, polluting the build log.
On a test amd64_linux26 system with a recent kernel and --enable-warnings,
this results in over 750 fewer warnings and 100+ fewer errors.

Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/150
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2009-07-17 19:45:30 -07:00
Derrick Brashear
07692c44d3 fstrace needs -lnsl on Solaris
in order for gethostbyname to be satisfied for util.a, -lnsl is needed

Reviewed-on: http://gerrit.openafs.org/146
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2009-07-16 13:09:24 -06:00
Russ Allbery
54b1324094 Demystify catopen return value in fstrace
For some reason, the code was, on all platforms other than Digital
UNIX, assigning the return value of catopen to an integer, with
and then immediately assigning it to an nl_catd (the actual return
value type).  Remove all of that and store the return value directly
in an nl_catd variable.

Reviewed-on: http://gerrit.openafs.org/93
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Verified-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-07-16 11:49:04 -06:00
Russ Allbery
0e3036e4d1 Simplify fstrace message catalog and support non-dest installation
fstrace was searching for its message catalog first through the normal
NLS message catalog search paths and then falling back on the client
configuration directory.  This, however, is neither a traditional
message catalog for internationalization nor is it a configuration file.

Instead, search for the message catalog only in a C directory under
AFSDIR_CLIENT_DATA_DIRPATH, which is for architecture-independent data,
and simplify the code.

Now that we have a standard location for the message catalog, install
it with make install as well as make dest.

Reviewed-on: http://gerrit.openafs.org/92
Verified-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-07-16 11:48:55 -06:00
Russ Allbery
280861970e Remove NLS message catalog implementation for pre-2.0 OSF
fstrace had its own copy of the NLS catopen/catgets/catclose library
functions only on OSF platforms prior to 2.0 with the functions
renamed to add a "1" (which looked cut and pasted from somewhere
else).  This is old enough that we no longer support that platform,
so drop all of that code and partly untangle the #ifdefs to remove
the pre-2.0 OSF case.

Reviewed-on: http://gerrit.openafs.org/88
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Verified-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
2009-07-15 19:43:46 -06:00
Evan Broder
54c0a3f3e6 Allow passing in human-readable units for specifying amounts of space
Add a util_GetHumanInt32 function for parsing numbers human-readable
units using single-character, uppercase suffixes for indicating orders
of magnitude (e.g. 'M', 'G').

Use this function to parse human readable values for all arguments
that previously accepted a value in kilobytes: fs setquota, fs
setcachesize, vos setfields, and vos create.

Reviewed-on: http://gerrit.openafs.org/66
Verified-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Verified-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-07-13 15:42:34 -06:00
Hartmut Reuter
42d64b5b1f Make 'fs listquota' output readable for large quota
With the old print format quota and used values became one large
number for quotas in the terabyte range.

Fix alignment of the "no limit" string in the Windows fs command
for volumes with no quota.

Reviewed-on: http://gerrit.openafs.org/34
Verified-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-07-12 16:07:34 -06:00
Simon Wilkinson
01ba9cde63 Prototypes for venus/test
Add additonal headers, prototypes, and ANSIfy function definitions in
venus/test

Reviewed-on: http://gerrit.openafs.org/48
Verified-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2009-07-10 17:42:00 -06:00
Simon Wilkinson
3bb5fa5f1b Remove the RCSID macro
The move to git means that we can no longer populate the RCSID
macro in the way that it was used with CVS. This patch simply
removes the macro from every file, except where it contains
information from upstream (and it's in a comment).

Reviewed-on: http://gerrit.openafs.org/14
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-07-09 22:58:37 -06:00
Simon Wilkinson
d5081f264d Remove CVS ignore files
Now we're in git we don't need any cvsignore files any more...

Reviewed-on: http://gerrit.openafs.org/1
Verified-by: Derrick Brashear <shadow@gmail.com>
Reviewed-by: Derrick Brashear <shadow@gmail.com>
2009-07-06 11:03:16 -06:00
Simon Wilkinson
c41a467741 gitignore-20090615
LICENSE IPL10

make gitignore files
2009-06-15 23:29:29 +00:00
Simon Wilkinson
0a8f1e16ae venus-prototypes-20090316
LICENSE IPL10
FIXES 124250

prototype the venus directory
2009-03-16 13:24:25 +00:00
Simon Wilkinson
5bd86a09eb windows-64bit-printf-sanity-20090218
LICENSE IPL10
FIXES 124265

don't assume %lld works for 64 bit ints on windows
2009-02-18 17:48:39 +00:00
Peter Tripician
52f3295d32 fs-lsm-parse-bug-20090226
LICENSE IPL10
FIXES 124319

print correct error on root directory
2009-02-17 03:59:28 +00:00
Jeffrey Altman
d4b17a6e2e ubik_Call-no-more-20090122
LICENSE MIT

remove more ubik_Call(RPC, ...) calls and replace them with ubik_RPC(...)
2009-01-22 15:28:54 +00:00
Simon Wilkinson
a268678326 rename-conn-to-afs-conn-20090121
LICENSE IPL10
FIXES 124116

based on patch from daleg@elemental.org. rename to avoid conflict with opensolaris

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE IPL10
FIXES 124116

based on patch from daleg@elemental.org. rename to avoid conflict with opensolar
is

====================
LICENSE IPL10
FIXES 124116

based on patch from daleg@elemental.org. rename to avoid conflict with opensolar
is
2009-01-21 20:09:07 +00:00
Derrick Brashear
8166bd1d19 missing-comerr-header-includes-20081130
LICENSE IPL10
FIXES 123676

include com_err header in places where it's not so afs_error_message et al
exist
2008-11-30 20:24:12 +00:00
Simon Wilkinson
f27165f137 kill-uninitialized-variable-warnings-20081026
LICENSE IPL10

kill lots of compiler warnings
2008-10-27 23:41:02 +00:00
Harald Barth
d569a083e3 cmdebug-entry-count-20081010
LICENSE IPL10

raise max number of entries as cache managers routinely have more
than 10,000 vnode status objects
2008-10-10 12:50:52 +00:00
Hans-Werner Paulsen
5158e8c7af kdump-rx-stats-20081003
LICENSE IPL10
FIXES 118700

add change to kdump also
2008-10-03 21:39:43 +00:00
Matt Benjamin
9d63160ccc bypasscache-20080922
LICENSE IPL10

add cache bypass support (currently linux only)
2008-09-25 12:42:02 +00:00
Dragos Tatulea
433afd4779 disconnected-rw-20080922
LICENSE IPL10
FIXES 114605 114606 114607

add read-write disconnected support
2008-09-22 14:36:16 +00:00
Simon Wilkinson
18a36a3f62 disconnected-20080523
LICENSE IPL10

add readonly disconnected support
2008-05-23 15:57:18 +00:00
Derrick Brashear
1206e7538b pmtu-and-prefetch-20080520
LICENSE IPL10

try hard to optimize using the wire for high latency connections
2008-05-21 05:22:13 +00:00
Chaskiel M Grundman
7a6751c088 kdump-install-fixups-20080427
LICENSE IPL10
FIXES 96465

The install rule:
- installs the empty 'kdump-build' file instead of the binary on all
platforms except irix
- overwrites the selection script with the binary on linux and hpux
- doesn't have an alpha_linux branch
- installs the wrapper script as kdump32 and the binary as kdump on
solaris (instead of vice-versa)

The dest rule:
- overwrites the selection script with the binary on alpha_linux and hpux
2008-04-28 04:45:03 +00:00
Jeffrey Altman
b3fe9727b3 cmdebug-cellservdb-20080112
LICENSE MIT

Add -cellservdb option to the cmdebug command.

This option will retrieve the volume location database information
for all cells known to the cache manager and output the data in the
format required by the CellServDB file.

This functionality is supported by the UNIX cache managers and
Windows cache managers 1.5.31 and later.
2008-01-12 15:43:37 +00:00