Remove dead code There is a perhaps-surprisingly large amount of code disabled behind directives like '#if 0', '#ifdef notdef', and '#ifdef notyet'. At best, this code is clutter, and at worst some of it is confusing/outdated, and/or confusingly nested inside other preprocessor conditionals. Sometimes this disabled code shows up when grepping the tree, and causes a nuisance when refactoring related areas of code. Get rid of all of it. If anyone ever wants this code back, it can always be restored by reverting portions of this commit. Also delete some comments that clearly refer to the disabled code, and in some cases, adjust the adjacent comments to make sense accordingly. This commit doesn't touch any files in src/external/. Change-Id: If260a41257e8d107930bd3c177eddb8ab336f0d1 Reviewed-on: https://gerrit.openafs.org/13683 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
namei: IH_REALLYCLOSE special inode on delete When we delete a special inode, we should IH_REALLYCLOSE it, to ensure no other cached file handles are open for that special inode. However, currently PurgeHeader_r does this, and then IH_DECs the special inodes. On namei, calling IH_DEC on a special inode causes the inode to be opened, so we create a cached file handle right after we closed all cached file handles for that inode with IH_REALLYCLOSE. Making namei IH_DEC not open an FdHandle_t for the given file is non-trivial, at least when dec'ing the linktable. So instead, just make namei IH_DEC itself issue the IH_REALLYCLOSE right before the actual unlink() call. With this, we can keep the cached file handle open for special inodes until right before they are actually deleted, so we don't issue extra unnecessary open()s and close()s. Change-Id: I35b234ab429bc7cd0f29654cc8f854c82c961071 Reviewed-on: http://gerrit.openafs.org/10196 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.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>
Clean up assertion The AFS code has multiple different assertion implementations in userspace. This patchset is the start of bringing some sanity to them. In rx, we have osi_Assert, a user/kernel assertion macro. This is only available to libraries which have RX dependencies In util, we redefine the standard 'assert()' macro to provide a cross-platform assertion solution. Because util has an RX dependency, neither of these provide an assertion solution for libraries which should be independent of rx. So, pull the assertion code out of util, and put it into opr, as a new opr_Assert() macro. Implement the userspace osi_Assert in terms of this macro, leaving the kernel variant untouched. Update callers to the new macro and header file names. Change-Id: I780b30ec1ea1207daa17127df4d5fbf9a94481b6 Reviewed-on: http://gerrit.openafs.org/5394 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
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>
libroken: Build on windows A minimal change set to get libroken to build on Windows. Sadly, libroken contains definitions for a number of platform compatibility macros which were previously scattered throughout the windows code. These scattered macros have to be removed in order to build libroken. The impact of this removal is that a very large number of files throughout the tree require the addition of "roken.h" to pick up the new compatibility code. The bulk of this change is adding these includes. In addition, some of the added includes add roken dependencies to the Unix build. So, also add libroken to the build rules in affected Unix Makefiles. Change-Id: Ifba431bd37e67b1e273fbc6f69b805a232193456 Reviewed-on: http://gerrit.openafs.org/3205 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Use afs_foff_t for file offsets Some callers in vol and volser were not using afs_foff_t for file offsets for calls to STREAM_ASEEK, FDH_TRUNC, FDH_PREAD, or FDH_PWRITE. Most notably, in code for volume cloning, purging, and dumping operations. Fix them to use afs_foff_t to prevent errors when dealing with large special files. Change-Id: I531fa8cb3070007a9c03e5e19c70d546f272a12c Reviewed-on: http://gerrit.openafs.org/3289 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>
rename afs/assert.h to afs/afs_assert.h provide a private assert header which does not pollute the normal namespace for the assert header. further changes will modify pthread operations to not use generic assert as a "did it work", which breaks if NDEBUG is set Change-Id: I43a95c0aa31ad2e772bce9142356fd5c5bedac6c Reviewed-on: http://gerrit.openafs.org/2995 Tested-by: BuildBot <buildbot@rampaginggeek.com> 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>
ihandle positional read and write When available, use POSIX positional read and write calls in the ihandle package. Originally written by Derrick Brashear and Andrew Deason. Change-Id: I29a9d830872cb920e8ed5820e33d3cbcb7247460 Reviewed-on: http://gerrit.openafs.org/1562 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
death to trailing whitespace if we're gonna clean up... Change-Id: I5ab03f29468577b62dacab41a67eadfd8c43f812 Reviewed-on: http://gerrit.openafs.org/2463 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
death to register in soviet compilers, compiler optimizes you. stop providing dated (and annoying for debugging) register keywords. Change-Id: Ibcac0aa3f353fe531b9be0beedca919fb947bfab Reviewed-on: http://gerrit.openafs.org/2436 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
vol: Fix logging functions Fix the Log, Abort and Quit functions used by the vol package so that they are all defined in a common header file, rather than prototyped in each file which uses them. Use the appropriate macros to flag those functions which never return, and mark them all as taking printf style input. Fix all of the callers which had mismatched format strings and arguments. Change-Id: I78194f623360e13f055f8f37b3558c08a70acd1f Reviewed-on: http://gerrit.openafs.org/2444 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Consolidate code for reading/writing vol headers The code for reading in and overwriting/replacing volume headers is duplicated many times throughout the volume package. Consolidate the code into the functions VReadVolumeHeader, VWriteVolumeHeader, VCreateVolumeHeader, and VDestroyVolumeHeader. This makes it easy to change the semantics of how headers are read/written, though this commit should not change them. Change-Id: Id395ee25fc2db92de9301b9cdbe18f30830e18d3 Reviewed-on: http://gerrit.openafs.org/1238 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Add system headers There are a number of places in the tree which are missing system headers such as <unistd.h> <ctype.h> and <dirent.h>. Add these. Reviewed-on: http://gerrit.openafs.org/62 Verified-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
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>
vol-prototypes-20090316 LICENSE IPL10 FIXES 124252 prototype the vol directory
dafs-updates-20080612 LICENSE IPL10 pending changes from tom to avoid a deadlock issue
large-partition-support-20080305 LICENSE IPL10 FIXES 88811 support partitions over 2tb
openafs-string-header-cleanup-20071030 include only what we need
unroll-namei-delay-fsync-20070104 has been shown to cause problems with releases per haba@pdc.kth.se testing, unroll until we figure out why