Fix PrintInode() mismatched array parameter warnings The PrintInode() prototypes do not match the function definitions. When AFS_64BIT_IOPS_ENV is defined (which is the common case and is required for namei), the buffer parameter is declared as a bounded character array (afs_ino_str_t) in the prototype, but is defined as an unbounded character pointer. When AFS_64BIT_IOPS_ENV is not defined (for legacy 32-bit inode vice partitions), PrintInode() is declared with no specified parameters. A static buffer is used to hold the formatted string when a NULL is passed as the first argument to PrintInode(). However, this method is only used by the volinfo and iopen utility programs. Fix the mismatch function prototypes and definitions to use the bounded char array (afs_ino_str_t) in all cases. Remove the deprecated function declaration with no specified parameters. Update vol-info and iopen to pass an afs_ino_str_t buffer and remove the now unused static buffer. Update the duplicated PrintInode() function definition in namei_ops.c. (This duplicated code could be removed in a future commit.) Change-Id: I5c0128bb0d572dab0df637289daad0e648ad8a8f Reviewed-on: https://gerrit.openafs.org/14770 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
vol: Avoid FDH_SEEK/FDH_READ All code in the tree except for this uses positional i/o (FDH_PREAD/FDH_PWRITE). For consistency and to ensure that we do not mix positional and non-positional i/o, just use the positional i/o functions here. It's simpler, too. Change-Id: Ib65f81dde7532631cd7d642c9ef814d47c71581a Reviewed-on: http://gerrit.openafs.org/11377 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Hans-Werner Paulsen <hans@mpa-garching.mpg.de> Tested-by: Hans-Werner Paulsen <hans@mpa-garching.mpg.de> Reviewed-by: Perry Ruiter <pruiter@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
vol: rename volUpdateCounter macro Change the volUpdateCounter volume macro name to be consistent with the volume header name. Change-Id: I55f55f2c084135e9598c194ed9081fce800ddfe9 Reviewed-on: http://gerrit.openafs.org/11318 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
volinfo: fix documenting comments As pointed by Andrew deason during review of the 1.6 pullup of commit ae27283550dab33704f30e18975722e0ed2c5424, psize is not a parameter of HandleHeaderFiles, and in function HandleSpecialFile it is of type inout since the value is first read by the += operation. Fix this, and try to improve the description of psize too. Change-Id: Ia728b20475f0c44b6104dc954aaa04d5f0f098b5 Reviewed-on: http://gerrit.openafs.org/11319 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
volinfo: separate volscan binary Refactor vol-info.c into several files and change the makefile to build a separate volscan binary, instead of using the program name to determine if the user is running volinfo or volscan. This commit adds new source files for the volinfo and volscan main() function and a common header file. Change-Id: I53a2a503812237a850170c39c81ee3fb56c8282e Reviewed-on: http://gerrit.openafs.org/10903 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
volinfo: refactor global options Move the global options to a structure and pass it to the vol-info functions. This is a precursor for creating separate volinfo and volscan programs. Change-Id: I86ea9e875f73831e6c7ea4b50591e31df3e0c39f Reviewed-on: http://gerrit.openafs.org/10902 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
volscan: hide -mask option The -mask option is unneccessary and sets a bad precedent, so deprecate and hide this option. The vnodes of interest can be found can be found easily and much more flexibly with a simple command pipeline. Change-Id: Ibe75928c6b041d135c0cb5867228947cd7f4e889 Reviewed-on: http://gerrit.openafs.org/10901 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
volscan: avoid printing null mount-point cellname The 'mcell' field is null when there is no cell set in the mount point, so do not try to print it. Change-Id: I363310665313f7bbcca783a4d9be87aaa7b0a8fe Reviewed-on: http://gerrit.openafs.org/10226 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
ubik/udebug.c, vol/vol-info.c: check array index before dereferencing Avoid out-of-bounds array accesses by first checking that the index is in-bounds, and then dereferencing; not the other way around. Change-Id: Ib36a28ca6181a7a7fd602de45cb5a15fad099a44 Reviewed-on: http://gerrit.openafs.org/8879 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
vol: fix everything to use volumeid type use one type for volumeid, not 3. kill VolId, and stop using afs_uint32 (and a few times, afs_int32) Change-Id: Ibcbd09b5a24d8720b02a02f926e6f59dc0f529aa Reviewed-on: http://gerrit.openafs.org/8845 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
rx: Use opr queues Modify RX so that it uses opr queues throughout, rather than the older, non-type-safe rx_queue structure and macros. Attempt to clarify which items in a structure are queue headers, and which are linkage pointers. This has the knock on effect that including an RX header doesn't automatically give you rx_queue.h in your application's namespace. Change-Id: I1b3fbcd8c03f8153a557bd4532710bcebfe45818 Reviewed-on: http://gerrit.openafs.org/8232 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Don't cast the return from calloc() calloc returns a (void *) argument. So we don't need to cast its output before storing it. Change-Id: Ibdfc61a8a2cf9779a0bfb17ff8ebf1f3bef3ea0e Reviewed-on: http://gerrit.openafs.org/7456 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
volinfo: show header filenames even if error When invoked with -header option, print the header inode number, and namei filename, even if the header file cannot be opened. Change-Id: Id2a2e63f07e12cd817718a9da63d24250718ae06 Reviewed-on: http://gerrit.openafs.org/7190 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementix.org>
volscan: index offset output column Add index offset as a possible volscan output column. Change-Id: I1bf6e8dc3c506a2ee013536e19141ddb214879a6 Reviewed-on: http://gerrit.openafs.org/6980 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
volscan: option to ignore dir vnode magic Option to ignore directory vnode magic when looking up the path names. Print which vnode failed when doing the checks. Change-Id: Id4b74ee9f139305025b849a007a4534b8ed04dbf Reviewed-on: http://gerrit.openafs.org/6979 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Make volscan's column delimiter option work Currently, volscan ignores the -delim command-line option, using the hardcoded default. This patch adds processing for this option, allowing alternative characters. Corrects an error in a08c3207255756c825ab69a19e04f79dd879c646 Change-Id: I750f2d998cff029fc02556ed0baaaa0ca1c95e08 Reviewed-on: http://gerrit.openafs.org/6894 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
volinfo: initialize vnode details Clear the vnode details object. Fixes the path lookup in volscan. Change-Id: I5176cf50bdb54529230fc72e4d1a65a20b4c14ba Reviewed-on: http://gerrit.openafs.org/6722 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
volinfo: fix formating of placeholder printfs needed to placate gcc-llvm on lion Change-Id: Ie15e4768d2e3feb7ad80dfef05395f2c4a227c0f Reviewed-on: http://gerrit.openafs.org/6565 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
vol: fix a08c3207255756c825ab69a19e04f79dd879c646 Patchset a08c3207255756c825ab69a19e04f79dd879c646 broke the suse and windows builds by relying on C99 language syntax. Fix it. Change-Id: I8220e0504048d2caff00deb08e3bf53599e596b7 Reviewed-on: http://gerrit.openafs.org/6337 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
volscan: print vnode metadata information volscan program to print vnode meta-data in a grep/awk/perl friendly format. Optionally, find the paths of each vnode relative to the volume root. Access control list data can be reported, and are listed as one access entry per line. Mount point information can be shown to which volumes are mounted from given volumes. The path lookup code originally written by Tom Keiser. Change-Id: I743e1a33d9e6076e4f1b1b2cc462960a94e3763b Reviewed-on: http://gerrit.openafs.org/5102 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: Derrick Brashear <shadow@dementix.org>