8905 Commits

Author SHA1 Message Date
Michael Meffie
8fc3d6dfe1 volinfo: accept vice partition id for -part option
Accept a partition id for the -part option. For example, -part a
is the same as -part /vicepa.

Change-Id: I59d9cb71a49bbfc631c7975a859ebc3e5eccdf1a
Reviewed-on: http://gerrit.openafs.org/4739
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:27:02 -07:00
Michael Meffie
6b0ad5786d volinfo: comments
Add doxygen style comment headers.

Change-Id: Id8e18a102e8aa5fbb0a0e0f3c58983d93bf2bb50
Reviewed-on: http://gerrit.openafs.org/4738
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:22:56 -07:00
Michael Meffie
8eddff4b78 volinfo: fix file size data type
Use afs_sfsize_t for file size instead of int.

Change-Id: If68fca11183cd7b3ecd3750609f1b989af7445f5
Reviewed-on: http://gerrit.openafs.org/4737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:22:10 -07:00
Michael Meffie
59a1c40efb volinfo: avoid exit on errors
Instead of exiting on errors, try to carry on.

Change-Id: Ia8da9403c57c19ac25a3ef4dac36c3e71bd1be25
Reviewed-on: http://gerrit.openafs.org/4736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:20:57 -07:00
Michael Meffie
277a8ad658 volinfo: refactor mode variables
Untangle the various global mode variables, which became muddled when dsizeOnly
and saveinodes were introduced. DumpInfo now indicates the default mode and
DumpVnodes means print the vnode entries, not scan but sometimes print.  Remove
unused globals.

Change-Id: I9d331a19afede864ad1d23477f5e3948e59558ec
Reviewed-on: http://gerrit.openafs.org/4735
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:20:27 -07:00
Michael Meffie
56714e9a4d volinfo: refactor volume and vnode handling code
Refactor volume and vnode handling code for better
maintainability.  Move the code invoked by -saveinodes to a new
function. Remove an unneeded else clause in HandleVolumes.

Change-Id: I02d9392ce065f78e5e84b902668b5d84242d7f5a
Reviewed-on: http://gerrit.openafs.org/4734
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:18:33 -07:00
Michael Meffie
4e97b2e5f8 volinfo: refactor size counters
Put the volume, partition, and server size counters into structures.

Change-Id: I3bb7a25b39e191b7717dc725604fe5fe1be8045c
Reviewed-on: http://gerrit.openafs.org/4733
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:15:23 -07:00
Michael Meffie
70145b4f4a volinfo: refactor -sizeOnly printing
Refactor the -sizeOnly output processing to reduce code
duplication and coupling with -saveinodes.

Change-Id: I4d1c53678732afebba83813be676a292e2d8e62c
Reviewed-on: http://gerrit.openafs.org/4732
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:13:43 -07:00
Ben Kaduk
55a41d0005 Enable gencat for i386_fbsd_*
The machines certainly have a /usr/bin/gencat, and I see nothing
in history to indicate a reason for this prevention.
Allow the 32-bit machines to build afszcm.cat and make packaging
more uniform between architectures.

Change-Id: If1017d28cc804d58cfb29019158ad5b3d70da9ac
Reviewed-on: http://gerrit.openafs.org/4760
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:08:31 -07:00
Simon Wilkinson
bcdcf5cf38 vlserver: Add flags to extent address entries
Add a "flags" field to the extent address entry so that we can store
per server bit flag information. Rename the header flags feel (and
corresponding macro) so that it's explicitly a header flag. Take
this opportunity to also fix this comment to clarify that the header
flags are not a copy of anything from the vlentry, but that they
must be at the same structure offset as the vlentry flags field (so
that something accessing an extent block as if it was a vlentry can
see what it is from the flags)

Change-Id: If8a4816418d9400fb971679c08b4777e7d83c983
Reviewed-on: http://gerrit.openafs.org/4776
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:07:40 -07:00
Simon Wilkinson
a082c4eeae vlserver: Make space in extent block explicit
The address entry side of the union within the extent addr block
actually has a significant amount of free space. It looks as though
the original author assumed that a UUID required 16 32-bit words,
rather than 16 octets, and sized the structure to match.

Make the free space within the structure explicit, so that it can
be used for future expansion

Verified with
  gdb vlserver
    (gdb) print sizeof(struct extentaddr)
    $1 = 128

Change-Id: If67f669fb298763f054ce82447a4513c59ef7526
Reviewed-on: http://gerrit.openafs.org/4775
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:06:12 -07:00
Simon Wilkinson
a9bd64f994 vlserver: Rationalise multi homed host processing
The same code for getting extent structures for multi homed hosts
was scattered throughout vlprocs.c, sometimes with error handling,
and sometimes without. Rationalise all of this into a pair of
static inline functions, which do all of the hard work.

Change-Id: Ib0f55e5b5f455b07753409ebff2a5cd0ca188cda
Reviewed-on: http://gerrit.openafs.org/4774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:02:38 -07:00
Simon Wilkinson
90507fcb10 vlserver: Use correct memsets in vlentry convertor
The various vlentry_to_<blah> conversion functions have obviously
been copy and pasted from each other. However, the size of the
structure which is being zeroed has not been updated when we are
zeroing different structures. Fix this, so that we always clear all
of the structure that we are filling.

Change-Id: Ic822e1d2b17494574074c332c7680e94d4701c66
Reviewed-on: http://gerrit.openafs.org/4773
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 07:00:32 -07:00
Simon Wilkinson
41dc2509ba vlserver: Clean up abort logic
Clean up the failure logic in the server RPC handlers so that there
is always a single exit point upon aborts. This should make it much
easier to fix the various problems with cleaning up memory when
RPCs fail.

Change-Id: Ia5f8e97c37bf4aca1c8f2597a21eb54d1ba094fb
Reviewed-on: http://gerrit.openafs.org/4772
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:59:37 -07:00
Simon Wilkinson
a180b0c5d8 vlserver: Use correct base value when replacing
When we're removing existing address entries the code calculates
a base and index value for each entry that we're removing an address
from. However, it then _uses_ a previously calculated base value,
with the new index. This works fine if the old base and the new base
match, but if they don't, chaos will ensue.

Fix to always use matched base and index pairs.

Change-Id: Ia592abdc1c58b5cf5776bb24e67aee708275a9b0
Reviewed-on: http://gerrit.openafs.org/4771
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:55:18 -07:00
Simon Wilkinson
e7f457469f vlserver: Rename errorcode to code
The convention in the OpenAFS code is to use 'code' or 'ret' for
return values from functions. Rename 'errorcode' in vlprocs.c to
be in keeping with this convention.

Change-Id: Idffd6eccdd820cb602e5c7cd66ebaa4fbd37c6b5
Reviewed-on: http://gerrit.openafs.org/4770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:54:46 -07:00
Simon Wilkinson
a14e791541 vlserver: Tidy up request counting
Tidy up the counting of requests and aborts in the vlserver. Don't
hide a variable allocation within a macro, convert macros to inline
functions, and make it possible to not count particular operations
by passing in an opcode of 0.

Change-Id: Ifd26027ebb97a6039b6f7f7289ffbe166627390b
Reviewed-on: http://gerrit.openafs.org/4769
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:53:03 -07:00
Simon Wilkinson
4c9134a995 Build system: Move install definitions to include
Move the definitions of the INSTALL_* variables out to
Makefile.config rather than replicating them in each file.

Change-Id: I5f74dcbf544a93716994418bee3be2c51a2a82d0
Reviewed-on: http://gerrit.openafs.org/4781
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:50:52 -07:00
Simon Wilkinson
1841860f62 aklog: Remove Windows specific code from header
When commit 3f54c934b9c933d5f34644a096c821375db17d97 removed all of
the Windows code from aklog, it missed the stuff in aklog.h. Get
rid of this too, for clarity.

Change-Id: I6d408ffc313d18fd512fa03494a15ec628f1e292
Reviewed-on: http://gerrit.openafs.org/4782
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 06:50:05 -07:00
Simon Wilkinson
cc72cb1e81 ubik: Initialise global version lock before use
Commit e4ac552ab79be21d90397079eaf6be7050497752 introduced a global
version lock to ubik, but doesn't initialise this lock before make use
of it. On platforms which require that pthread mutexes are initialsed,
this causes an assertion failure.

Initialise this lock at the same time as we MUTEX_INIT all of our other
locks.

Change-Id: Ib5ef75d443101a823738fba55c0760cb1848dbcf
Reviewed-on: http://gerrit.openafs.org/4780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-05 06:00:28 -07:00
Michael Meffie
64b255327d cmd: Reorder cmd_AddParmAtOffset arguments
Reorder the arguments of this recently introduced function to
make client code more readable.

Change-Id: I37f662f849bd96176230f75783e2a1c62d94b8c9
Reviewed-on: http://gerrit.openafs.org/4755
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-04 19:32:29 -07:00
Michael Meffie
13aeb1dcae xstat: print collection values in debug mode
Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.

Change-Id: I12d8d27306c50fb9f35ade2a080b3bc20542b63f
Reviewed-on: http://gerrit.openafs.org/2878
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-04 11:10:59 -07:00
Rainer Strunz
7d76a5b4f9 fs: add support for relative ACL changes
This change permits "fs setacl" to change ACLs in a relative
manner, rather than just setting rights absolutely as it is
done now.

If a single plus (+) or minus (-) character is appended to
the rights' letters argument, the new rights are computed
relatively to the existing ones.

A few examples should make clear that behaviour:

old rights: rights set: new rights:
-----------------------------------------------
rl a+ rla
rlid idwa- rl
rla write- a
rl write- [none] (ie. entry deleted)
[any] read= rl

As shown in the last example, a '=' character got implemented
also (and for free) as an alternative writing of the current
and default behaviour of just setting an ACL.

FIXES 123962

Change-Id: If15a4ab3c69ec44a42c8746a0b93f5e8b785d61e
Reviewed-on: http://gerrit.openafs.org/4496
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-04 10:43:29 -07:00
Simon Wilkinson
5ad1e6cb90 dir: Prototype and function name cleanup
Tidy up typing in the dir package, so that we have a specific type
for a directory file handle.

Also rename all of the functions to afs_dir_* globablly, rather than
just renaming for kernel code.

Change-Id: I6750a8eb9f0606d5debf9d677a92b9c8a63dbcf3
Reviewed-on: http://gerrit.openafs.org/4745
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-06-02 07:38:14 -07:00
Simon Wilkinson
0284e65f97 dir: Explicitly state buffer locations for data
DNew and DRead always returned directory page aligned pointers,
however the directory code further manipulates those pointers,
requiring the DRelease be able to fill a page when passed a pointer
to any address within that page. This is relatively straightforward
in the userspace implementation, but much more complex in the kernel,
where all of the directory pages are not necessarily contiguous.

Resolve this issue by making DNew, DRead and DRelease all return a
new structure, struct DirBuffer. This structure contains both a
pointer to the data, and an implementation specific private
pointer to data describing the page containing the address. The
directory code is free to play with the data pointer as it wishes,
as long as the private pointer to the page is passed through intact.

DRelease (and DVOffset) can then simply use the private pointer for
their operations, without having to walk page lists.

This new behaviour also requires changes to the directory functions
GetBlob, FindItem and FindFid which all return pointers to directory
data.

Change-Id: I8b8b003b789976b593a7c752969f47d55f4ee707
Reviewed-on: http://gerrit.openafs.org/4744
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-02 07:37:59 -07:00
Simon Wilkinson
b3ea4fa4ff doc: bos != vos
As it says on the tin

Change-Id: I2c03f51303d01ccc772c1fc0b2ed1dd0b176892d
Reviewed-on: http://gerrit.openafs.org/4764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-02 06:54:50 -07:00
Simon Wilkinson
b6add117ad vos: Don't leak/overflow bulkaddrs
The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.

This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.

Fix this by freeing the arrays correctly with each pass of the call.

Change-Id: I540d369c1529ec3574548f42cbd48b6c2b38cebd
Reviewed-on: http://gerrit.openafs.org/4756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-01 06:13:42 -07:00
Christof Hanke
6af6a6a7cb libafscp: fix install/dest in sep. Objectdir
When compiling libafscp in separate objdir,
make dest and make install fail, because of wrong
pathes. Fix it.

Change-Id: Id2b672bce308609d99b343322babe890ec8d6a38
Reviewed-on: http://gerrit.openafs.org/4761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-01 06:12:16 -07:00
Jonathan A. Kollasch
750b865928 Port cache manager to NetBSD-5 and NetBSD-current
Change-Id: I3d1aa0b22bb8533718f48bd4424743299d5de019
Reviewed-on: http://gerrit.openafs.org/4661
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-05-31 05:35:32 -07:00
Derrick Brashear
ec26dae2bf macos: bulkstat sysctl
make bulkstat enable/disableable via sysctl

Change-Id: Ib1657964d62e402e96762394b7b61ed5e58a5fc9
Reviewed-on: http://gerrit.openafs.org/4723
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-27 07:43:20 -07:00
Adam Megacz
6260c4ae51 make bozo honor -rxbind correctly
Bozo needs to call rxInitHost() rather than rxInit() when -rxbind is
present. This patch causes it to read NetInfo/NetRestrict earlier in
the startup process so it can make that decision.

FIXES 57286

Change-Id: I17058f4e8e5c23fdfcfe56178d5edc5dcceafb7a
Reviewed-on: http://gerrit.openafs.org/4729
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-26 18:31:26 -07:00
Derrick Brashear
7270cf5607 macos: bulkstat caller reference handling
if bulkstat is called and fakes up vnodes for non-dir cases, it can
guess wrong, and we end up needing to fix up the type by swapping
in a new vnode under the vcache. however, references are tracked on
the vnode, and more importantly, callers can know about the vnode;
unlinking a vcache from a vnode leaves null pointers to blow up on.

thing is, we shouldn't end up with a un-fixed-up vcache in use:
any caller of ProcessFS will notice if the vnode is the wrong type,
and fix it. so in order to reach CStatd, we have to fix it.
the only places where we can get a vcache in use not CStatd are:
FindVCache, LookupVCache, GetVCache where InReadDir. The last happens
only on Linux. LookupVCache doesn't happen anywhere that matters
(CForeign, or we immediately dispose...). FindVCache is only called
somewhere which won't lead to us fixing up during create, but that
vnode isn't returned to callers; we finalize in the result of create
and return the vnode that's linked to the vcache, which will be correct.

so, the only other place we can have a reference which won't immediately
get fixed up is in lookup, across the bulkstat call. if that's true,
and we return from bulkstat a non-CStatd vcache, lookup will fill in the
entry manually. so, if there are references remaining after we do a fixup,
unmark CStatd so the caller (presumably lookup, given the above) will give
back the vcache and retry, getting a corrected vnode as a result, with
the reference on the vnode we want it on.

Change-Id: I3b225c8d48067624f3cbac7b1f897e52193a8d55
Reviewed-on: http://gerrit.openafs.org/4722
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-26 08:29:46 -07:00
Christof Hanke
7133266baf linux: add read_descriptor_t configure test and ifdef
With linux 2.6.8 the struct read_descriptor_t changed.
Add a configure-test and respective ifdef to deal with that.

Change-Id: Iff1a6252707cd2119bdc0382c641934119ea0422
Reviewed-on: http://gerrit.openafs.org/4719
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-26 06:59:13 -07:00
Christof Hanke
baf7656f66 autoconf: add test for typedef'd structs
AC_CHECK_LINUX_STRUCT does not work for structs which are typedef'd.
The gcc will complain with "error: storage size of ‘_test’ isn’t known"
and fail the test.
Thus the new test-macro AC_CHECK_LINUX_TYPED_STRUCT.

Change-Id: Ib3e933c4e09a3e950ca8d8e7a66909d86f10cfdf
Reviewed-on: http://gerrit.openafs.org/4718
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-26 06:58:47 -07:00
Ben Kaduk
9703b023cc FBSD: VIMAGE support
Starting in FreeBSD 8.0, there is support for multiple virtual
network stacks (generally to be exposed to separate jail(8) environments).
It is enabled as a kernel configuration option, so our builds against
GENERIC have not failed, but we fail to build when options VIMAGE
is present.  Fix our variable references accordingly.

Change-Id: I679361b8ea62b0eae90c0aa61287dfc2dd189481
Submitted-by: Hiroki Sato of freebsd.org
Reviewed-on: http://gerrit.openafs.org/4721
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-05-25 22:58:14 -07:00
Andrew Deason
cc0ba3c430 tests: Make -flag the first parm in command-t
Move the -flag parameter to be the first parameter, to test more of
the positional argument handling.

Change-Id: I637c58e8c76bfc23919f29a1c598084275426773
Reviewed-on: http://gerrit.openafs.org/4710
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-25 12:47:55 -07:00
Andrew Deason
9cbd9d71b3 tests: Use symbolic constants in command-t
Change-Id: I1d7e47edc97dcdb855ad5ca732a2f015741c9d18
Reviewed-on: http://gerrit.openafs.org/4709
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-25 12:47:44 -07:00
Andrew Deason
83322372fb tests: Correctly pass string args in superuser-t
We need to give a NULL pointer for string OUT arguments, so XDR knows
to allocate a new string. Also free the string each time so it gets
set back to NULL.

Change-Id: I1eb0c63dc4019b855a2cbecd9e35393f2fbb0fd7
Reviewed-on: http://gerrit.openafs.org/4708
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-25 12:47:37 -07:00
Simon Wilkinson
6e2ecfbeeb cmd: Add cmd_OptionAsUint
Add an accessor function which can return a unsigned int for an
option value.

Change-Id: I33bc9a2618191ca60b95086624100b54efb05ab2
Reviewed-on: http://gerrit.openafs.org/4652
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-05-25 12:47:20 -07:00
Andrew Deason
70624fd2ab cmd: Fix parsing positional args
If the first parameter of a libcmd syntax is a flag, cmd_Parse was
skipping over positional arguments, since j will be 0 at this point
(the j variable is only used if we're processing an explicit switch).
Effectively revert this area to what it was before
a2f1ca5fd52ac2fb7e68b101bbe3da9878c10474 so such positional parameters
work again.

Also move the j variable to inside the only block in which it is used,
to try and avoid such mistakes in the future.

Change-Id: Ifa52cecf50a3f561c70de351a9ebd026e90eeeab
Reviewed-on: http://gerrit.openafs.org/4711
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-23 19:53:40 -07:00
Jeffrey Altman
ba76149a57 Windows: ChangeLog for 1.5.9906 (1.6.0pre6)
Change-Id: Ie799849d3e538b98afc49e6003b6b0f595308da5
Reviewed-on: http://gerrit.openafs.org/4706
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-05-23 10:27:48 -07:00
Antoine Verheijen
b3004fbd50 Replace uintptr_t type cast with uintptrsz in afs_vcache.c
A recent change (commit 80fe111f0044aa7a67215ad92210dc72cb7eb2c0)
to afs_vcache.c contains a call to afs_warn() whose second parameter
contains a "(uintptr_t)" type cast as part of a double type cast.
This presents an issue on some systems, such as OpenBSD, where this
object type is defined in a header that is not presently included.
This change modifies that type cast to instead use the AFS-internal
"(uintptrsz)" type which should provide the same effect.

Note that an earlier version of this patch ateempted to remove the
"offending" type cast as redundant but it was pointed out that some
systems require this kind of cascading type cast when casting pointers
to integers to deal with possible size issues.

Change-Id: Iea81b2be1050a1c929978a99c518d86c6d1f2118
Reviewed-on: http://gerrit.openafs.org/4671
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 07:06:51 -07:00
Simon Wilkinson
98a4a5498f cmd: Include aliases in help output
Include any command aliases in the output from the -help option

Change-Id: Ifb2ac96d9ba6fc64bffff69bac9480a6b7e8568e
Reviewed-on: http://gerrit.openafs.org/4651
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 07:02:33 -07:00
Michael Meffie
4999ed13d2 volinfo: print namei filenames of index files
On namei fileservers, also print the namei filenames of the volume special
files when the -header flag is given.

Change-Id: I90112f13d0f39348ee3862fdbdb55074e8877108
Reviewed-on: http://gerrit.openafs.org/4696
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 07:00:53 -07:00
Michael Meffie
ae27283550 volinfo: remove code duplication in HandleVolumes
Reduce duplicate code for processing volume header files when printing header
details (-header) and calculating the volume size (-sizeOnly).

Change-Id: I1f1d3b3d065901379c289065dfa1999e249662a4
Reviewed-on: http://gerrit.openafs.org/4695
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 07:00:35 -07:00
Michael Meffie
c833ff6c5b volinfo: fix volume aux totals output
Do not print the volumes aux totals prematurely when running
volinfo with the -headers flag on an namei fileserver. Instead
print the aux totals only once after the link table size is found.

Change-Id: I4538e2fc8978530fd2e8593e0b343a2497c7a764
Reviewed-on: http://gerrit.openafs.org/4694
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 07:00:13 -07:00
Michael Meffie
b7fe087745 volinfo: print errors to stderr
Print volinfo errors messages to stderr instead of a mix of stdout
and stderr. Print a consistent program name.

Change-Id: Ifadae52d56a75ff7d73d639ff1dd893b1a926a28
Reviewed-on: http://gerrit.openafs.org/4693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 06:58:58 -07:00
Michael Meffie
ababc1ba44 volinfo: fix size totals when saving inodes
Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.

Change-Id: Ifafe6a128918500ac6fd5f9a1e39de2d4aff785d
Reviewed-on: http://gerrit.openafs.org/4691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 06:58:36 -07:00
Michael Meffie
e3fb2740ba doc: document volinfo -filenames option
Add the namei -filenames option to the volinfo man page.

Note this option as implemented implies the -vnode flag, but for
consistency with the other fields that modify the default mode
output, it is documented to be accompany the -vnode flag.

Change-Id: I7cc5cdf5e74e65ca25ecc086e550a468b803b971
Reviewed-on: http://gerrit.openafs.org/4690
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 06:58:18 -07:00
Jeff Blaine
97070b425d Added -dryrun
Added missing information about -dryrun option

Change-Id: I17f9e8c54c1d12c84476c9d19da48b0a5219e623
Reviewed-on: http://gerrit.openafs.org/4680
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-22 06:57:43 -07:00