macos 32 bit platform user address transform

make the ioctl32 translator work as expected, e.g., create
proper user addresses.

Change-Id: Ia690dee5f9978d679e942a9954f2123df4a96bc2
Reviewed-on: http://gerrit.openafs.org/1687
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ec74299c7c0f6e705e6ba2329001b92f9941868e)
Linux: replace invalidate_inode_pages

This helper has been deprecated for a while, and gets removed
with 2.6.34.
Replace it with invalidate_remote_inode, which has been around for
all of 2.6's life, according to Chaskiel in RT #124377.

Change-Id: I8658b454e1c997c041f654ba55d06f713ea25459
Reviewed-on: http://gerrit.openafs.org/1523
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 80481fb14ea9301b0f6b3503d07ecaef39aef0d8)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/1988
Recover from afs_GetVolSlot errors

afs_GetVolSlot can panic in a few different ways, such as failing to
read from or write to VolumeInfo. Instead of panic'ing, return an
error to the application. Adjust callers to deal with getting a NULL
volume returned.

Based on a patch by Mike Meffie.

Change-Id: Ibb301fed795ee9ee5906b8e7973945a06218b8f1
Reviewed-on: http://gerrit.openafs.org/1801
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit 80f05473428969ff71d1791cda8cb09d30223724)

Change-Id: Ie89034cb0fcc8f92868f338996d62edfe150b1b2
Reviewed-on: http://gerrit.openafs.org/2004
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Initialize oldvtix

Initialize the variable to avoid compiler complaints that it
could be used uninitialized.  Use a sentinel value and issue
a warning if we try to use the variable and we haven't set
it to a useful value.

Change-Id: I037be2ad8e0b55d06b50aafdeca5012764640f16
Reviewed-on: http://gerrit.openafs.org/1810
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit 0dac8f93af5262472bc5bdf94dbb605a24da59d0)

Change-Id: I3311ad5a73e21f7fb44f9dcf0cda251bae96eb0f
Reviewed-on: http://gerrit.openafs.org/2008
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
fix other oldtvix typo

i failed to push this to commit 0dac8f93af5262472bc5bdf94dbb605a24da59d0,
and so, well, here's the real fix. sorry.

Change-Id: I6799ecb207f246ac3e4c48b1de55268d2fba4d23
Reviewed-on: http://gerrit.openafs.org/1837
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit 51c1eb362da866e28a9fb9a6f5d9d412aac7e8c2)

Change-Id: If42f31b47d50aecb147fa82040a6c3ab48f7a7ce
Reviewed-on: http://gerrit.openafs.org/2009
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Move non-executable stack assembly code to end of file

The non-executable stack annotation used for Linux works by adding
an additional section to the generated object.  The annotation added
in 9bfd03d723a9cf17673f40513a7adde1d503bcbc was added to the beginning
of each assembly file.  This caused build failures on Linux s390
because the remainder of the assembly code was then put in that
section, which was discarded during linking.

Add the annotation to the end of each assembly file instead, following
the instructions at:

    http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Change-Id: I5bd2d8d0ac31932b59757dcec0a942c459d61cac
Reviewed-on: http://gerrit.openafs.org/1615
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9dbe48ac2d14742d2acefb9cb4138b810a1a128e)
make openafs 1.4.12.1

update configure scripts with new version number

Change-Id: I3d75cdd481369aaaaaa3de343c70360a6e20847a
RedHat: Find krb5-config in /usr/bin

In RHEL6, krb5-config is no longer in /usr/kerberos/bin/, but is in
just /usr/bin/. So, try to use /usr/bin/krb5-config if we cannot find
/usr/kerberos/bin/krb5-config and krb5config was not specified.

This is a 1.4-only change, as the 'configure' on more modern branches
should have the ability to find krb5-config automatically.

Reviewed-on: http://gerrit.openafs.org/2646
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c2eba9d57adc79b05165fc8aebaf751ea89282f5)
Change-Id: I46c6f0e3d7c2ce427eacfbb82366a7da3156d9bd
Reviewed-on: http://gerrit.openafs.org/3514
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: RedHat packaging updates for RHEL6

Update our bundled spec file and related tools so they can be used
to build OpenAFS on the RHEL6 beta.

- Make kmodtool recognise el6 as having "modern" kernel naming
  conventions
- Replace %{PACKAGE_VERSION} (which seems to have disappeared)
  with the standard %{version} macro

Thanks to billings and phalenor on IRC for their testing efforts.

Reviewed-on: http://gerrit.openafs.org/1806
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0d0e7699c9f789214205fe6837cded1a4c95f9c0)

Reviewed-on: http://gerrit.openafs.org/2638
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 41040638e23be43e260f79a4694df528244ef38b)
Change-Id: Ia2d1d1c377d7df0a4e7bdd22ac5f86c7253ffa66
Reviewed-on: http://gerrit.openafs.org/3515
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: Rework statfs super block operations configure test

The configure test to detect if the statfs super block operation
needs a dentry argument is based on vfs_statfs, and assumes that
its signature matches the one of the operation.  In 2.6.36 this is
no longer true and the test fails.

Rework the test to actually test the operation we're interested in.

This change is required for 2.6.36.

Reviewed-on: http://gerrit.openafs.org/2545
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit 08552ad8a94f7cc5908aabe8385711e09a6418e4)

Reviewed-on: http://gerrit.openafs.org/2553
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b8b708fc416aa281fe1d1ce1d498cc381c81679c)
Change-Id: Ib40de2018ecec5e3c82d8fa829364c31d29526b4
Reviewed-on: http://gerrit.openafs.org/3516
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: switch to evict_inode

In 2.6.36, the delete_inode and clear_inode inode operations
are replaced by evict_inode.
Rename our current clear_inode to evict_inode, and add a few
things that were previously handled by the generic delete_inode.

This is required for 2.6.36.

Reviewed-on: http://gerrit.openafs.org/2544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit fb01fbd7cd2d396df8a4605eaad9febc52ef3b61)

Reviewed-on: http://gerrit.openafs.org/2552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e05b5937201ec313d2c8fa863f4dacec87ab687d)
Change-Id: I42a22dbea4f880f5c8bb1cd0904f1711b3a48292
Reviewed-on: http://gerrit.openafs.org/3517
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: use %pI4 if NIPQUAD is not available

The definition of NIPQUAD has been removed from the kernel headers
in the mainline kernel.  Replace it by using the %pI4 format
specifier which takes the IP address as a single argument.

There should be no change in the output.

This fix is required for 2.6.36.

Reviewed-on: http://gerrit.openafs.org/2542
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit d4018b2673e6532543984838290ffb891b970fea)

Reviewed-on: http://gerrit.openafs.org/2551
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e2e8881db7757ccac5ce3d5fc5603c40c5b47a43)
Change-Id: I1bbe4f8f24f18d29fb6af98fc6e6f4707def547f
Reviewed-on: http://gerrit.openafs.org/3518
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: adapt to truncate sequence changes

As part of changes to the truncate sequence, inode_setattr() no
longer exists, and all filesystems have to define the setattr op
so we can assume that it is not NULL.

Introduce a compat inline function afs_inode_setattr that hides
the tests and the different versions from the main code.

Note that the existing test for the inode_setattr() return type
will fail, but the value is no longer used in that case.

This is required for 2.6.36

Reviewed-on: http://gerrit.openafs.org/2543
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit eaf3378f537935f6b9843886b43d)

Reviewed-on: http://gerrit.openafs.org/2550
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 58e56d080b8d19117b60f04ecb37af0c6dcafc1a)

Change-Id: I4cfdd191c60d7672c80aa3b3789e52c3e5e87666
Reviewed-on: http://gerrit.openafs.org/3519
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Linux: 2.6.35 - fsync no longer takes a dentry

In 2.6.35, the fsync file operations drops the dentry argument.
Add a configure test and cope.

Reviewed-on: http://gerrit.openafs.org/2064
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>

(cherry-picked from commit 4d89ce0a89e9b9e2709e6f6d730f245b5bce744b)

Reviewed-on: http://gerrit.openafs.org/2549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 58bffd741cdc917f164f19b4621aa2567e6a5b3e)
Change-Id: Ibeb609a57003fc863568e4fc619db9746aa9462f
Reviewed-on: http://gerrit.openafs.org/3520
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Linux: fix statfs configure test

The change to the statfs configure test that was made for 2.6.36
broke the test for older kernels.  The new test is based on a call,
and that will generate a warning but not an error when the arguments
don't match the prototype.

Take another tack, and revert to the old style test, but with the
simple_statfs function instead of vfs_statfs.

Reviewed-on: http://gerrit.openafs.org/2975
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 59927e20052c3f075e0269e46691bc94c3974f86)

Change-Id: Iaee4e3d62ce95c33539ba57c19ddc916b097deb2
Reviewed-on: http://gerrit.openafs.org/3521
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
CellServDB update 13 Dec 2010

Reviewed-on: http://gerrit.openafs.org/3505
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Change-Id: I6c27922b7877041d5f74751aa06fad469d5e92cd
Reviewed-on: http://gerrit.openafs.org/3526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Linux: define llseek operations

With kernel 2.6.37 it is now mandatory to define the llseek operation
for files and directories.  If these are not defined, no_llseek is
called, and any attempt to seek returns ESPIPE.

Most file systems use generic_file_llseek, but it seems safer to use
default_llseek which is what the vfs used to call for us by default.
In 2.6.37 these two functions are actually functionally identical.

Reviewed-on: http://gerrit.openafs.org/3292
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

(cherry-picked from commit fb6b22cf77039962f22f462ee602f0e4a8153817)

Reviewed-on: http://gerrit.openafs.org/3512
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d0e31ec418555354ac30516269a9748ee01fc36f)
Change-Id: If90a5ac65a9ccd1d1301884065e9583ad25f5af4
Reviewed-on: http://gerrit.openafs.org/3527
make openafs 1.4.13

update versions for openafs 1.4.13

Change-Id: Ifdaa32de6896afc9efa9b05da10182a737ce1f0e
Reviewed-on: http://gerrit.openafs.org/3531
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
update ticket5 from heimdal

includes updated instructions for updating.
note that gen_glue.c in lib/asn1 has a bug which omits
a needed newline in the "const struct units * asn1_%s_units(void);",
line.

FIXES 127554

Reviewed-on: http://gerrit.openafs.org/2306
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 582878a75858a341f674f833609f08b6d3bf839a)

Change-Id: I8a7eefb19d353469376a799614005245aeb91b1f
Reviewed-on: http://gerrit.openafs.org/3522
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
LINUX: Use correct type of error in flock code

The flock code gets a kernel error code from afs_posix_lock_file()
but then passes this error code through afs_convert_code (which sees
that it is already negative, and returns EIO). Instead, we should just
return afs_posix_lock_file()'s code direct to our caller.

Reviewed-on: http://gerrit.openafs.org/2534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5abe706a7e237d3872db3638d947a14c935370d5)
Change-Id: I8e12c9804cc81c8c88f820f55abd4ce863525c9a
Reviewed-on: http://gerrit.openafs.org/3533