IRIX: Remove pre-65 code Commit d1923139 (irix kill efs and start pruning pre-65) removed all files that defined AFS_SGI64_ENV and earlier, but didn't remove that code that depended on those defines. In addition, there has been code in the tree that checks for AFS_SGI53_ENV since OpenAFS 1.0, but nothing has ever defined Irix 5.3 support in OpenAFS. Remove all of this obsolete code. Change all references to AFS_SGIXX_ENV to AFS_SGI_ENV, and assume AFS_SGI_ENV is defined in all IRIX dirs. Consolidate some of the resulting ifdef logic appropriately. Change-Id: I9dd426296e04801980b805a5e195063762b23189 Reviewed-on: https://gerrit.openafs.org/14230 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
afs: clarify cold and warm shutdown logic Currently, any code that wants to perform a cold shutdown must first set global afs_cold_shutdown = 1, then call afs_shutdown(void). Instead, modify afs_shutdown() to accept a single parm which specifies AFS_WARM or AFS_COLD shutdown, and to set the value of global afs_cold_shutdown based on this parm. Remove all other assignments for afs_cold_shutdown. Modify all callers of afs_shutdown() to specify AFS_WARM or AFS_COLD as needed to maintain equivalent function. This should make it much easier to tell at a glance what type of shutdown is being requested by each caller to afs_shutdown(). No functional change should be incurred by this commit. Change-Id: I921eca5b4d2659209154fbe37d575db69bf708b8 Reviewed-on: https://gerrit.openafs.org/12182 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Retire AFS_MOUNT_AFS Currently, the AFS_MOUNT_AFS #define is used to mean two completely different things: - The string "afs", corresponding to the first argument to mount(2) on many platforms and some related calls inside libafs (e.g. getnewvnode() on FBSD). - An integer identifying the AFS filesystem (e.g. gfsadd() on AIX). Depending on the platform and the build context (UKERNEL vs KERNEL), AFS_MOUNT_AFS gets defined to one of those two things. This is very confusing, and has led to mistakes in the past, such as those fixed in commit 446457a1 (afs: Set AFS_VFSFSID to a numerical value). To avoid such confusion, get rid of AFS_MOUNT_AFS completely, and replace it with two new symbols: - AFS_MOUNT_STR, the string "afs". - AFS_FSNO, the integer given to gfsadd() et al. When AFS_MOUNT_AFS is split this way, AFS_MOUNT_STR then is always defined to the same value, so remove it from the param.h files for our platforms. Instead, define it in afs.h for libafs use, and in afsd_kernel.c (the only place outside of src/afs that uses it). Also remove the logic for conditionally defining MOUNT_AFS from the param.h files, moving the logic to the same locations as AFS_MOUNT_STR. Note that this commit removes the numeric definition for AFS_MOUNT_AFS in param.sgi_65.h (aka AFS_FSNO). We never actually used this value, since AFS_FSNO is not used on IRIX; instead, we tend to use the 'afs_fstype' global instead of a constant number. Change-Id: I6cbf051dc938cd1c456cbe236c0afe99a3c3dd87 Reviewed-on: https://gerrit.openafs.org/14323 Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
afs: Remove useless afs_GetVCache arguments The 'avc' argument in afs_GetVCache has never been used, all the way back to OpenAFS 1.0. The 'cached' argument was set correctly, but none of its callers ever looked at the result of 'cached'. Remove these useless arguments. afs_LookupVCache and afs_GetRootVCache also had the same 'cached' argument, which was also never used by callers. Remove it for those, as well. Change-Id: I3536259f26536acc02fbb058787f417bf0f50b9a Reviewed-on: https://gerrit.openafs.org/13681 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
afs: Stop abusing ENOENT When looking up a file, the ENOENT error code is supposed to be used if we know that the target filename does not exist. That is, the situation is a user or application error; they specified a filename that was not previously created. Currently, though, we use ENOENT for a variety of different situations, such as: - After successfully looking up a directory entry, we fail to afs_GetDCache or afs_GetVCache on the FID for that entry. - We encounter an invalid mount point, in certain code paths. In each of these situations, an ENOENT error code is incorrect, since the target filename does indeed exist and these situations may be caused by network or administrative errors. An ENOENT error implies that the user may be able to then create the target filename, which is not true most of the time in the above situations. In addition, on LINUX we return a negative dcache entry when we encounter an ENOENT error on lookup. This means that if any of the above scenarios occur, Linux would cache the fact that that directory entry did not exist, and return ENOENT for future lookups. This was worked around in one of the changes in commit 652f3bd9cb7a5d7833a760ba50ef7c2c67214bba to always invalidate such negative dentries, but at the cost of performance (since this caused negative lookups to never be cached). To avoid all of these issues, just don't use ENOENT in these situations. For simple non-disconnected afs_GetDCache or afs_GetVCache errors, return EIO, since we have encountered an error that is internal to AFS (either the underlying data is inconsistent, or we have a network error, or something else). In disconnected operation, return ENETDOWN like in other disconnected code paths, since often the root cause is due to us not having network access. When a bad mountpoint is encountered, return ENODEV, since that is what we use elsewhere in the code when encountering a bad mountpoint. It is also noteworthy that this changes removes the translation of VNOVNODE into ENOENT, since a nonexistent vnode is not the same as a nonexistent filename, as described above. Some code paths have special behavior for this situation (ignoring the error in some cases where it does not matter). These code paths should be okay with this change, since all of them examine error codes that have not been translated through afs_CheckCode. Some useless references to ENOENT were also removed in src/afs/LINUX*/osi_misc.c. These did not result in incorrect behavior, but removing them makes searching for bad ENOENT references easier. Change-Id: Ib01e4309e44b532f843d53c8de2eae613e397bf6 Reviewed-on: http://gerrit.openafs.org/11788 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
afs: Raise fake free space reporting We report 'fake' values for free space, free file nodes, etc for the 'AFS' filesystem, since these values are not meaningful for AFS itself. Currently we report about 9G of free space for most platforms, and a few different values for a few others. Raise all of these to 2^32-1, so that trying to copy over 9G of data into AFS does not fail for those applications that check the destination free space with statfs(2). Note that one such application is KDE 4.8.x. Consolidate all places that do this, and put the 'fake' value in one place, AFS_VFS_FAKEFREE, along with the relevant comments. Related issues reported by Lars Schimmer, Richard Brittain, and others. Change-Id: Ia15175da32744e11f62489c29bedfe1f5560d2b4 Reviewed-on: http://gerrit.openafs.org/9688 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Markus Koeberl <markus.koeberl@tugraz.at> Tested-by: Markus Koeberl <markus.koeberl@tugraz.at> Reviewed-by: D Brashear <shadow@your-file-system.com>
IRIX: Pull NFS translator hooks We've never had working NFS translator for IRIX, and the system call codes which are required to install the symbols used by the IBM translator have long been used for other things by OpenAFS. Simplify this mess by just removing the translator stubs from the kernel module, and all of the code in afsd which used to handle pulling addresses out of the kernel module so that we can hook ourselves in. Change-Id: I2da2b0040afc0191e236706126d75bc7d39c0936 Reviewed-on: http://gerrit.openafs.org/5375 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
libafs: Drop xvcache for AllocCBR Normally when we AllocCBR, we are holding xvcache write-locked, since it is called from FlushVCache. Before a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush CBRs due to a lack of space, we hit the net, giving up callbacks on fileservers. This can cause a problem if one of those fileservers needs to contact us in order to complete that request, since the callback service thread may be waiting for xvcache, causing a deadlock (that is eventually broken by network timeouts). To avoid this, drop xvcache if AllocCBR looks like it does not have sufficient space. Fix all callers of afs_FlushVCache to handle the case where we sleep, since with this change, afs_FlushVCache can sleep on all platforms. This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it contains an alternative method of avoiding the xvcache lock in this situation. This commit restores much of the code path to be much more similar to how it used to be, except that it allows for dropping xvcache for AllocCBR. This should make any change to our prior behavior smaller/simpler, and thus safer and more consistent with existing clients. This reintroduces the hard limit to how much space we allocate for CBRs, although the part of a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is retained. Change-Id: Id4aaa941b3908f59390873e83e23429041c0828f Reviewed-on: http://gerrit.openafs.org/3958 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
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>
irix kill efs and start pruning pre-65 we haven't built on irix 6.4 in a while. likewise, no efs anymore. just remove the extra code Change-Id: I559f4bca5bf52f9a0344472ccf60b93751282a2b Reviewed-on: http://gerrit.openafs.org/1380 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.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>
discon-allow-saving-vcaches-on-shutdown-20090126 LICENSE IPL10 FIXES 124211 restructure so we can save info necessary to keep dirty changes across offline shutdown
shutdown-cleanup-20071213 LICENSE IPL10 get rid of cold_shutdown; it's in afs_prototypes.h. log when we don't clean up memory
fix-indent-bug-with-lock-macros-part-three-20040818 Add trailing semicolons to more macros and re-indent.
reindent-20030715 FIXES 1774 thanks to nneul@umr.edu for providing a script to do this. gnu indent 2.2.9 options: -npro -nbad -bap -nbc -bbo -br -ce -cdw -brs -ncdb -cp1 -ncs -di2 -ndj -nfc1 -nfca -i4 -lp -npcs -nprs -psl -sc -nsob -ts8 ==================== 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. ==================== FIXES 1774 fix subst mistake
no-copy-libafs-builds-20021015 make things so file copies from src/libafs don't happen; change how libafs_tree is done
This is mostly a rewrite of src/afs/afs_cell.c, and associated changes to other things. Features of the new cell code: * Persistent name-to-cell-number mapping across reboots, to ensure the cell numbers in the dcache are meaningful. Stored in the new cache file, /usr/vice/cache/CellInfo. * Allow cmdebug to query the cell number to cell name mapping. * Allow clients to have an empty CellServDB as long as AFSDB is enabled and ThisCell has AFSDB records. * The home cell retains the setuid bit even if looked up via AFSDB. * Dynroot gets its own cell, rather than piggybacking on cell 1. * Cell 1 is no longer special; cell numbers are now semi-opaque. * Convert cell traversal code to using GetCellByIndex rather than directly poking at CellLRU / afs_xcell. * Separate cells from aliases, which shouldn't have been the same in the first place. * Cleaner code (IMHO). ==================== 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. ==================== make the arguments afs_CellNumValid takes match the prototype (since it really is a afs_int32 it looks like) ==================== update irix to deal ==================== update irix to deal ==================== Fix some more references to the now-nonexistant cell->index
pull-prototypes-to-head-20020821 pull up prototypes to head
Fix a vcache refcount leak in afs_root() on all platforms.
convert-vcache-casts-to-macros-20020325 convert vcache casting in cache manager to macros should ease further changes later