Commit Graph

573 Commits

Author SHA1 Message Date
Ben Kaduk
5afe7a882b Add configure option to not install kauth
Per http://www.openafs.org/pages/no-more-des.html the kaserver
suite of utilities is deprecated and is not supposed to be built
anymore in this post-1.6 world.
Not building them at all requires some effort, but not installing
them is pretty easy.  Do the easy part for now, and leave the hard
parts for a follow-up commit.

Change-Id: I1c400a7398b8708e7c9dc6613cd183b9b67e7a7f
Reviewed-on: http://gerrit.openafs.org/8457
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-26 13:48:44 -08:00
Michael Laß
986a854151 Update configure help msg to match actual defaults
The defaults for LINUX_KERNEL_PATH and LINUX_KERNEL_BUILD in
acinclude.m4 were changed in 2cfd611, 94ff565 and 3f9d982 without updating
the output of ./configure --help. Change the description of
linux-kernel-headers and linux-kernel-build to show the correct defaults.

Change-Id: I41331f4d48a555e291a45ca56e788bc418c064d3
Reviewed-on: http://gerrit.openafs.org/8759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-12-18 17:32:18 -08:00
Stephan Wiesand
3f9d982ec2 Linux: Restructure kernel header detection
As of kernel 3.7, version.h has moved, and hence utsrelease.h was
no longer found. Loop over candidate directories and locations
within, and look for the files we're actually after.

FIXES 131525

Change-Id: I686212a283b9e0ce769b1351e3cb75e08f4b110c
Reviewed-on: http://gerrit.openafs.org/8761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-12-18 12:32:11 -08:00
Marc Dionne
aeb2763b74 Linux 3.7: key instantiate API change
Adapt to the new parameters for the instantiate key operation.

Change-Id: I25dea3489b68cad662e962a4973ee98ec7228cd3
Reviewed-on: http://gerrit.openafs.org/8470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-19 04:22:11 -08:00
Marc Dionne
2bafb2f99d Linux: change test for new putname API
Replace the existing test with a more robust one that checks for
the existence of the new filename structure.  Since older kernels
are expected to fail this test, we'll get the correct result even
if there is unrelated failure, for instance a missing/different
header file.

Change-Id: Ie50abce37580eab803e9b07e636a1538f4a91a81
Reviewed-on: http://gerrit.openafs.org/8466
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-19 04:21:52 -08:00
Derrick Brashear
7fe30bd28e configure: check for poll()
if we have code which uses HAVE_POLL, check for poll().

Change-Id: I1baf61541b243f82b3acca112db2cbbca813182b
Reviewed-on: http://gerrit.openafs.org/8357
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-01 20:24:52 -07:00
Simon Wilkinson
3898f4d205 Fix mutex assertion
RX mutexes have two mechanisms for asserting ownership of a mutex:
MUTEX_ISMINE, which returns true if the caller is the owner of the
mutex in question, and osirx_AssertMutex which fires an assertion if
the calling thread doesn't own a specified mutex.

Neither of these work with pthread mutexes on all platforms, and the
kernel support for MUTEX_ISMINE is dubious in places. Because in some
implementations, MUTEX_ISMINE tries to lock the mutex in question, a
failing call to MUTEX_ISMINE can lead to the process holding an
additional, unexpected, lock.

This patch reworks all of this, and uses the new opr mutex framework
so that we can do mutex assertions in userspace, too. We remove the
unsafe MUTEX_ISMINE macro, and replace it with MUTEX_ASSERT which
simply asserts if the specified mutex is not held by the current
thread. osirx_AssertMutex is removed as it is now redundant.
MUTEX_ASSERT will always work in kernel code.

For userspace, we provide opr_mutex_assert, which is implemented using
POSIX error checking mutexes. As error checking mutexes have a runtime
overhead, this is only available when configured with
--enable-debug-locks, the rest of the time calls to opr_mutex_assert are
no-ops.

Change-Id: I285ee2b558389fa3d63b786e4bc4420fa2126c80
Reviewed-on: http://gerrit.openafs.org/8282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-30 04:59:07 -07:00
Marc Dionne
fa3116567e Linux 3.7: putname is no longer exported
putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

Change-Id: I5416067566f6332d77e5d91ce2b9cf7bc0c96dce
Reviewed-on: http://gerrit.openafs.org/8237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-18 00:53:15 -07:00
Derrick Brashear
a28b5e645a configure: make use of native build assist tools possible
provide a way to run native rxgen, config and compile_et

Change-Id: I9d1a2b4a1d4100fdc4a042005586e8fc40f39f7b
Reviewed-on: http://gerrit.openafs.org/8199
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-03 07:38:06 -07:00
Ben Kaduk
c4c51444eb FreeBSD major version numbers are multi-character
Do not assume that there is only a single character before the dot.

Change-Id: I45169a6faa5dbeafc4f9c57deaaad96bef8de613
Reviewed-on: http://gerrit.openafs.org/8106
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-14 04:53:33 -07:00
Andrew Deason
e5ba359f64 LINUX: Detect non-vectorized aio functions
In kernels before 027445c3, the functions generic_file_aio_read and
generic_file_aio_write, as well as the fs operations aio_read and
aio_write, do not deal with iovecs but rather just use a single
buffer. Detect this, so our aio_read and aio_write implementations
have the correct signatures.

This removes several warnings on such kernels.

Change-Id: I70aa0d43bac5545d83710806b58f36d13d7f6cc8
Reviewed-on: http://gerrit.openafs.org/8020
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-30 09:03:09 -07:00
Andrew Deason
74c1881dff LINUX: Use struct vfs_path on RHEL5
Some revisions of the kernel from RHEL5 (2.6.18-308.* and possibly
others) renamed 'struct path' to 'struct vfs_path'. So, use
'struct vfs_path' when it exists.

This introduces the afs_linux_path_t typedef, which is defined as
either a struct path, or struct vfs_path.

Change-Id: I88c31125dbc1ab2998a521e3c57ed532bf2d5bb7
Reviewed-on: http://gerrit.openafs.org/8019
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-30 09:01:37 -07:00
Marc Dionne
ec48dca871 Linux 3.6: lookup inode operation API change
The nameidata argument is replaced with an unsigned int flags
argument.

Change-Id: Ife07bb50ae7d747bd6256ea8238c4e19dbb5ee3f
Reviewed-on: http://gerrit.openafs.org/7987
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:15:41 -07:00
Marc Dionne
7413cd09a5 Linux 3.6: revalidate dentry op API change
The nameidata argument is dropped, replaced by an unsigned flags
value.  The configure test is very specific; kernels with the
older API with a signed int flags value should fall through.

Change-Id: I5939b089b023fe81e3824ac3f920c4b6a261d39a
Reviewed-on: http://gerrit.openafs.org/7986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:15:21 -07:00
Marc Dionne
020e32779c Linux 3.6: create inode operation API change
The nameidata argument is dropped and a flag is added.

Change-Id: I33692fc506e7eb9b8935a27ff3d10b713dfa6e5e
Reviewed-on: http://gerrit.openafs.org/7985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:14:54 -07:00
Marc Dionne
6bea047fb4 Linux 3.6: d_alias and i_dentry are now hlists
The d_alias pointer is now the head of an hlist.  This means the
iterator is a different macro and has no "reverse" version since
hlists have no direct pointer to the list tail.

inode->i_dentry gets the same treatment.  Adjust where we use it.

Change-Id: Ibcdd8ab6f8a571a8f94c646949ebe0503f075574
Reviewed-on: http://gerrit.openafs.org/7983
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:14:02 -07:00
Marc Dionne
8766a65e97 Linux 3.6: dentry_open API change
dentry_open now takes a path argument that combines the dentry and
the vfsmount pointers.
Add a configure test and a new compat inline function to keep things
cleaner in the main source file.

Change-Id: Ia29422d60d438cf4c795840566d4610649aa1f10
Reviewed-on: http://gerrit.openafs.org/7982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-16 22:29:37 -07:00
Marc Dionne
049c485b4a Linux 3.6: kmap_atomic API change
kmap_atomic no longer requires a KM_TYPE argument.  Test for this
and adjust the affected code.

Change-Id: I3a9e0018124d40be51cc509ac00d9250a5e8e76d
Reviewed-on: http://gerrit.openafs.org/7981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-16 22:28:52 -07:00
Simon Wilkinson
6f6bfb31ac opr: Add UUID handling functions
Add a set of functions to the opr library to handle creating and
manipulating UUIDs.

The opr_uuid_t type is held as a 16 octet character string, which
comprises the UUID encoded into network byte order. This is the
primary form for manipulating UUIDs with this library, as it avoids
any nbo/hbo problems.

For applications which require raw access to the UUID components,
the opr_uuid_unpacked structure is provided, and
opr_uuid_pack/opr_uuid_unpack can be used to convert to and from
this format.

Finally, functions to print the UUID as a string, and parse a UUID
from a string, are provided. When printing, we use the standard UUID
format of 000000-0000-0000-0000-00000000. However, the afsUUID library
used to print UUIDs as 000000-0000-0000-00-00-00000000, so we also
accept this format.

Change-Id: I78ef79b7ab8ae15fb955c6495118722875c94f8d
Reviewed-on: http://gerrit.openafs.org/7977
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-14 12:53:08 -07:00
Tom Keiser
b440d8ffcb libafs: use kthread_run when available
Use the kthread_run interface on linux to create kernel
threads.  This interface allows all the cpus to schedule
afsd threads, instead of just inheriting the cpu affinity of
the main afsd thread.

Written by Tom Keiser.

Change-Id: I69eb852d168bd85e9aa7ec075013c0346207dbcf
Reviewed-on: http://gerrit.openafs.org/7915
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-08-14 06:21:00 -07:00
Andrew Deason
403f72ec76 rx: Create AFS_ADAPT_PMTU and AFS_RXERRQ_ENV
Currently we have the ADAPT_PMTU define, which turns on functionality
in Linux to detect PMTU-related ICMP errors for Rx. However, this is
really turning on two separate pieces of functionality: the PMTU
processing, and the processing for ICMP errors in general.

So split this out into two defines: AFS_ADAPT_PMTU, and
AFS_RXERRQ_ENV. The former is for processing PMTU discovery, and the
latter is for processing ICMP errors. Both of these are left disabled
due to issues in the error processing. Although PMTU discovery is the
only functionality which makes use of ICMP errors, this will change in
the future.

Change-Id: Ia334c68ce5eb3fa01c01a8a1c52a0e0a2e41b2c0
Reviewed-on: http://gerrit.openafs.org/7925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-09 08:03:53 -07:00
Andrew Deason
de381aa0d3 Linux: Make dir dentry aliases act like symlinks
Currently, we try to invalidate other dentries that exist for a
particular dir inode when we look up a dentry. This is so we try to
avoid duplicate dentries for a directory, which Linux does not like
(you cannot have hardlinks to a dir).

If we cannot invalidate the other aliases (because they are being
used), right now we just return the alias. This can make it very easy
to panic the client, due to the sanity checks Linux performs when dong
things like 'rmdir'. If we do something like this:

mkdir dir1
fs mkm dir1/mtpt vol
mkdir dir1/mtpt/dir2
fs mkm dir1/mtpt/dir2/mtpt2 vol
cd dir1/mtpt
rmdir dir2/mtpt2

For the 'rmdir', we will lookup 'mtpt2'. Since 'mtpt' and 'mtpt2'
are mountpoints for the same volume, their dentries point to the same
directory inode. So when we lookup 'mtpt2', we will try to invalidate
the other dentry, but we cannot do that since it is the cwd. So we
return the alias dentry (for 'mtpt'). The Linux VFS layer then does a
sanity check for the rmdir operation, checking that the child dentry's
parent inode is the same as the inode we're performing the rmdir for.
Since the dentry we returned was for 'mtpt', whose parent is 'dir1',
and the actual dir we're performing the rmdir for is 'dir2', this
sanity check fails and we BUG.

To avoid this, make the dentry alias act like a symlink when we
encounter an uninvalidateable dentry alias. That is, we allow multiple
dentry aliases for a directory, however, when the dentry aliases are
actually used, we redirect to a common dentry (via d_automount where
possible, and follow_link elsewhere).

This means that such mountpoints will behave similarly to symlinks, in
that we 'point' to a specific mountpoint dentry. This means that if we
have multiple different ways to get to the same volume, and all are
accessed at the same time, all but one of those mountpoints will
behave like symlinks, pointing to the same mountpoint. So, the '..'
entries for each path will all point to the parent dir of one
mountpoint, meaning that the '..' entry will be "wrong", but for most
cases it will still be correct.

In order to try to make the 'target', pointed-to directory consistent,
we add a new field to struct vcache: target_link. This points to the
dentry we should redirect to, whenever that vcache is referenced. To
avoid (possibly not-feasibly-solvable) problems with refcounting, this
pointer is not actually a reference to the target dentry, but just
serves as a pointer to compare to.

FIXES 130273

Change-Id: I990131ce95cefe8336e83c7ebfb48aed1d685109
Reviewed-on: http://gerrit.openafs.org/7741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-07-31 09:29:04 -07:00
Derrick Brashear
73ff095130 macos: next version support
support things beyond 10.7

Change-Id: I7a50f569fd43e0e1ed3c74f0480a8e2521df1bc5
Reviewed-on: http://gerrit.openafs.org/7763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-07-16 09:29:49 -07:00
Derrick Brashear
a08604b78f uss: allow disabling by configure switch
provide an option to disable building uss. current heimdal
when built static can leak symbol names for its flex/bison parser
causing symbol conflicts. this is but a workaround, but
sites not needing uss can at least use it.

Change-Id: Ibab1dd189e7fbc41ca01e7ef7479421c056999f5
Reviewed-on: http://gerrit.openafs.org/7553
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-13 15:19:44 -07:00
Derrick Brashear
5d53c12b95 gtx: add configure switch to force not building
allow gtx and associated software to be turned off.

Change-Id: If02427311c79e0784fcc5fb1816a449f7dcdd879
Reviewed-on: http://gerrit.openafs.org/7552
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-13 15:19:28 -07:00
Marc Dionne
5227148ae1 Linux 3.5: encode_fh API change
The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804
Reviewed-on: http://gerrit.openafs.org/7523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-07 05:13:50 -07:00
Marc Dionne
2b33384a4a Linux 3.4: replace end_writeback with clear_inode
end_writeback() is renamed to clear_inode().  Add a configure test
and cope.

Change-Id: Icaf5b6b54d0ee377fabcf0b295d690eaa6b4be5e
Reviewed-on: http://gerrit.openafs.org/7503
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-28 20:06:39 -07:00
Michael Meffie
fbc9599484 configure: solariscc check update
Add checks for recent versions of sunstudio for solaris.  The
installation paths are documented in the release notes of versions
12.1, 12.2, and 12.3.

Change-Id: Ic28f40a061f288a1c39acb6a5d11e81876631d7f
Reviewed-on: http://gerrit.openafs.org/7253
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-22 06:19:24 -07:00
Simon Wilkinson
db733e325e roken: Add setprogname
Add setprogname to the list of functions that we test for, and replace
with a libroken alternative if it is missing.

Remove setprogname and getprogname from the AC_CHECK_FUNCS list, as
AC_REPLACE_FUNCS is a superset of this test.

Change-Id: If81dc8ba6d9245329f3abae6a6f062e3827dcfab
Reviewed-on: http://gerrit.openafs.org/7250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-19 05:06:59 -07:00
Michael Meffie
f8b759b63f auth: local realms configuration
Add krb.conf and krb.excl support to the auth cell configuration
library.  Provide a function to determine if the user is local to the
cell.  Provide a function to set the local realms during application
initialization.  These changes are intended to replace the functions
afs_krb_get_lrealm and afs_is_foreign_ticket_name.

Change-Id: Iba57e9ffc2c958f3a4565a9352ce172189276ce9
Reviewed-on: http://gerrit.openafs.org/5744
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-04-16 10:31:04 -07:00
Michael Meffie
c11d1c0319 Build: error if solariscc is not found
Fail configure if the solariscc is not found and give the builder
a message to cope with non-standard installation paths for
sunstudio.

Change-Id: I64c1e752833f2aa824f4a15cc144e54bb03a1ec8
Reviewed-on: http://gerrit.openafs.org/7204
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-04-13 17:46:30 -07:00
Chas Williams (CONTRACTOR)
29cb3b9f83 Finish removing sunos 4.x references and build cruft
Also, fix afsxbsa.h to always include <time.h> since this should get
struct tm on any fairly modern operating system.

Change-Id: Idfb39f12d28a2a0aa470c8549e4149d0b2ccde9e
Change-Id: Ia1c563e5954c533f18bd56155f2ae1825813efe3
Reviewed-on: http://gerrit.openafs.org/6923
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-03-25 18:41:24 -07:00
Marc Dionne
f246aa5f84 Linux 3.4: Switch to d_make_root
If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

Change-Id: I39aaa6fd14d04c05ad9cb5b610e7f12f70fe0c94
Reviewed-on: http://gerrit.openafs.org/6931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-22 07:05:06 -07:00
Andrew Deason
80592c53cb Disable kernel opt by default on Solaris 10 and 11
With newer Solaris Studio (sometime in the 12.* series), cc started
adding SSE instructions to optimized x86 code, which is invalid for
kernel code and can generate panics. There appears to be no way to
turn this off currently (-xvector=%none is non-functional), so default
to not optimizing kernel code.

Change-Id: I5fdedb11219df68e0146b8e0cee9010c2eb4067e
Reviewed-on: http://gerrit.openafs.org/6671
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-02-07 06:42:07 -08:00
Christof Hanke
20e82cecd9 linux: fix probing for noop_fsync
Commit 267934d0e6 introduced
probing code to deal with the renameing of simple_fsync
inside the linux-kernel.
This test does not take different parameter-lists
for noop_fsync or simple_fsync resp. into account.
Fix this.

Change-Id: Ib490f0bb7e8098acc83fce001a43c08f478ad582
Reviewed-on: http://gerrit.openafs.org/6628
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-02-01 04:18:19 -08:00
Marc Dionne
beafc7f742 Linux 3.3: use umode_t for mkdir and create inode ops
The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

Change-Id: Ib8bbf6eaa6e87d6a9692c45b1a3fe93fcc3eff7a
Reviewed-on: http://gerrit.openafs.org/6567
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-01-18 10:12:40 -08:00
Marc Dionne
64bd0b728c Linux: use standard macro for set_nlink configure test
A generic macro exists to test for functions in the kernel, use
it for set_nlink.

Change-Id: Iaec2b29e48f500bcf7a1ef80a3f2a1305e5dbb8f
Reviewed-on: http://gerrit.openafs.org/6566
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-01-18 09:28:23 -08:00
Geoffrey Thomas
267934d0e6 linux: fsync on a directory should return 0, not EINVAL
Directory writes are synchronous, so this is fine. There's a
mostly-convenient function in fs/libfs.c that returns 0 that we can use
to do what we want ("mostly" because it was renamed in 2.6.35).

FIXES 130425

Change-Id: I9a2af60ed3152be036f0145c94152d8cff2e1242
Reviewed-on: http://gerrit.openafs.org/6491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-01-03 07:26:06 -08:00
Anders Kaseorg
f1dd2d696f Linux: 3.2: Use set_nlink to update i_nlink
As of v3.2-rc1~84^2~1, struct inode.i_nlink is now const to prevent
direct modification.

Change-Id: If0a38ffb7f9964e23f5e64c900ae92f56fb77def
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 18:02:11 -08:00
Andrew Deason
70e8451acd Add setenv/unsetenv to roken
Add the replacement setenv and unsetenv functions to roken, for use on
(at least) HP-UX and older Solaris.

Change-Id: Id05137b6e6c88eb6648bd6a6e649f9ef311e32a4
Reviewed-on: http://gerrit.openafs.org/5801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-08 19:37:46 -08:00
Andrew Deason
353aa7ef2c Do OPENAFS_OSCONF before compiler autoconf tests
OPENAFS_OSCONF can set the C compiler we use, as well as changing
various compiler flags. These changes can alter autoconf tests, so
allow OPENAFS_OSCONF to change these before various autoconf tests are
performed which require the C compiler.

Change-Id: I8da7d10b227f230d1467c77845c0dbd4b48fa966
Reviewed-on: http://gerrit.openafs.org/5785
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-11-03 13:14:55 -07:00
Derrick Brashear
955bab670d ukernel: output dataversion in stat struct if possible
we already have this data; if we can output it, do so.

Change-Id: Ibc445a152e4e1e61be50003dd8683d2a4b32d190
Reviewed-on: http://gerrit.openafs.org/5510
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-28 11:53:26 -07:00
chas williams - CONTRACTOR
440943e96b autoconf: use $XCFLAGS from OPENAFS_OSCONF when making tests
Certain platforms (like ppc64_linux26) compiler options might
affect some autoconf tests.  In particular, the ones related to
the size of certain primitive types.

Change-Id: I20c3f737ee4623451bc6cab3f97e86d152cb397f
Reviewed-on: http://gerrit.openafs.org/5366
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-09 12:11:42 -07:00
Marc Dionne
def00ae8ba Linux: d_delete now takes a const argument
The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Change-Id: I621f54d8e8182b29ccfdf82798773800f5870064
Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-05 07:04:27 -07:00
Marc Dionne
cbaefa266d Linux: 3.1: adapt to fsync changes
The fsync file operation gets new arguments to specify a range.
Add a configure test to check for the API change.

The inode lock is also pushed down into the operation, so we need
to take it ourselves to keep the original behaviour.

Change-Id: Icf4e152ce52f2b32c99920f83a5cc3136c05d2cd
Reviewed-on: http://gerrit.openafs.org/5332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:04:00 -07:00
Russ Allbery
0754537c11 Don't fail to build documentation if kindlegen doesn't exist
Check for kindlegen in configure and do nothing in the MOBI build
rule if the binary didn't exist.

This is still a bit of a hack since the rule will run with every
invocation of make.  The target needs to be made conditional.  But
at least this way make all in the documentation directory doesn't
fail.

Change-Id: I57f158929b3907678b9848a60edb9765136f7dbb
Reviewed-on: http://gerrit.openafs.org/5090
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-23 09:36:41 -07:00
Russ Allbery
bec9c12859 Prefer dblatex to docbook2pdf
docbook2pdf, at least in version 0.6.14-1.1 in Debian, dies while
attempting to build the Admin Guide with an error about TeX capacity
exceeded.  dblatex seems to work reliably.  If both are installed,
prefer dblatex to docbook2pdf.

Change-Id: I7cf594c677cde84410bfefacf07cbbf398026ff3
Reviewed-on: http://gerrit.openafs.org/5091
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Russ Allbery <rra@stanford.edu>
2011-08-15 23:55:26 -07:00
Garrett Wollman
3d6f6e0043 configure: provide some necessary prerequisites in header checks
<netinet/in.h> is a prerequisite for <resolv.h> and <netinet/if_ether.h>.
<sys/socket.h> is a prerequisite for <net/if.h>.

Change-Id: I2c974ad863c6ff7eedb3702159399118af8de074
Reviewed-on: http://gerrit.openafs.org/5107
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:15:08 -07:00
Garrett Wollman
74e8bec7be configure: spell the "=" operator to test(1) correctly
Equality in the test(1) utility is represented by "=", not "==".
Some, but not all, versions of test accept the latter as an extension.

Change-Id: I25380f77e1c621965e0610318c9793874154cf15
Reviewed-on: http://gerrit.openafs.org/5106
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:14:48 -07:00
Garrett Wollman
8adf4cd0b0 util: introduce a common interface for setting thread names
A previous change added support for setting thread names/titles to
viced; this change moves the #ifdef spaghetti to src/util in
preparation for calling it from other places where it would be
useful.  Two functions are defined, one for setting an arbitrary
thread's name (as might be done by the spawning thread) and one
for setting the current thread's name; the latter is also defined as
a macro for non-pthreads compilations so that it can be called
unconditionally (the interface does not reference any
pthread-specific data types).  Note that some platforms, Mac OS X
in particular, do not allow setting the name of a different thread.

The two functions are defined as no-ops for Windows as our pthreads
emulation layer for Windows does not provide the needed mechanism.

Make viced use the new interface.

Change-Id: I58c65a28772d8d188c03d6ff3a6f052889362fb7
Reviewed-on: http://gerrit.openafs.org/4966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:55:22 -07:00
Garrett Wollman
ee05a1b086 viced: If platform supports setting a thread title, do so
Some pthread libraries support setting a name or title for individual
threads (analogous to setproctitle() for processes).  This can be useful
for debugging and is sometimes published for use by utilities like ps
(again like setproctitle() for processes).  The two most common variants
of this have the same signature with slightly different function names.
If either one is present, use it in viced (which already assigns a thread
name when compiled for LWP but ignores it in pthreads compilations).

Change-Id: I5486aa6a21dbc3c8885b94ad52c2b1a66baae81f
Reviewed-on: http://gerrit.openafs.org/4950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-11 11:32:11 -07:00
Andrew Deason
3505c444f6 Add AFS::ukernel libuafs perl bindings
Add the SWIG-generated AFS::ukernel perl module, which provides perl
bindings to libuafs calls.

Change-Id: I5ce480944a8c97cbca72c80e79fc40c0edb0962f
Reviewed-on: http://gerrit.openafs.org/2048
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-08 22:20:06 -07:00
Anders Kaseorg
34bdd979fc Treat Linux 3 as Linux 2.6
Linux 3.0 is just a rebranded Linux 2.6.40, so we can use the same
sysname and the same code.

Change-Id: I154334dc5b73980a0d9b8abd9fd6645994f63829
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4843
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-07-06 11:52:03 -07:00
Andrew Deason
e4c2810f41 Remove support for Solaris pre-8
Remove support for all Solaris and SunOS platforms prior to Solaris 8,
since Solaris 7 reached end-of-life in August of 2008. Remove all
non-documentation references to sunx86_57 and earlier, sun4x_57 and
earlier, and AFS_SUN57_ENV and earlier.

References to AFS_SUN58_ENV have been changed to AFS_SUN5_ENV where
appropriate, and AFS_SUN5_ENV now implies Solaris 8.
AFS_SUN57_64BIT_ENV has been renamed to AFS_SUN5_64BIT_ENV.

Change-Id: Ia64ce7da7bfc685fa28a5119c51ec740625456e3
Reviewed-on: http://gerrit.openafs.org/4888
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-06-30 07:27:39 -07:00
chas williams - CONTRACTOR
137dd23494 doc: prefer fop to generate pdf from docbook
It would seem xsltproc -> fop -> pdf is the "modern" way to generate
pdf from docbook now.  The hard part is finding the stylesheets.
This should work for fedora, sles and debian.  Additionally, it brings
some consistency--xsltproc for all the conversions.  You can still
override via configure options if you prefer something else.

Change-Id: Id779e9473a6759daddc9a61be714109b27da980e
Reviewed-on: http://gerrit.openafs.org/4821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-06-22 11:01:53 -07:00
Chas Williams (CONTRACTOR)
cc2bc3e17f doc: let configure find the XML tools if possible
configure should attempt to find the XML tools we need to process
the documentation.  if it can't, it should provide a safe default.
still allow the user to override via command line.

Change-Id: Ifaf3a5b090e93858c3d3c88363760c508030db90
Change-Id: Ib9558c37b04a4533e91b172a2a62039e4ed06d6f
Reviewed-on: http://gerrit.openafs.org/4766
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-05 08:15:55 -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
Russ Allbery
dc3da06772 Resync Autoconf macros from rra-c-util 3.3
This includes the following fixes:

* Include krb5.h before probing for the IBM-specific header file for
  obtaining error strings to avoid Autoconf warnings on AIX.

* Use [] to mark empty arguments to Autoconf macros.

* Add an explicit license statement to these Autoconf macros, matching
  the normal Autoconf macro license.

* Ensure rra_use_kerberos is always set so that other parts of configure
  can rely on it.

Change-Id: I521d38ad6834808cf09c798aeba0efc0dd741fd6
Reviewed-on: http://gerrit.openafs.org/4588
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 16:36:33 -07:00
Derrick Brashear
a33f77b6e1 macos: further next version support
try to optimize out things which will be missing

Change-Id: Ibee45ae75fa0a5cbdad9eb7a83b12cfaba85b201
Reviewed-on: http://gerrit.openafs.org/4569
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 10:46:30 -07:00
Simon Wilkinson
d7b1e6a1ad autoconf: Add required headers to net/if.h test
On Darwin, net/if.h is only usable if sys/socket.h is included first.
Do so, to stop autoconf from warning about this test.

Change-Id: I9e7a2642cce86c5ad6ebb3ae3cb60401dd9c26cf
Reviewed-on: http://gerrit.openafs.org/4535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 07:29:15 -07:00
Jonathan A. Kollasch
9fd238ea05 Add nbsd60 param files and autoconf logic
Change-Id: I7fa40455315325f75d0fb754fc23620f12fd634a
Reviewed-on: http://gerrit.openafs.org/4512
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-21 22:29:41 -07:00
Andrew Deason
80df5096e7 Fix some configure header prereqs
On at least Solaris, the configure tests for netinet/if_ether.h and
security/pam_modules.h issued warnings because they existed but were
not compilable. Perform the tests with the prerequisite headers of
net/if.h and security/pam_appl.h, respectively, so autoconf will stop
yelling at us.

Change-Id: I05d637784954c10af468b6065acd78139fc45245
Reviewed-on: http://gerrit.openafs.org/4467
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-13 11:04:22 -07:00
Derrick Brashear
81c2416d8e add tsearch to Windows
roken now has tsearch for windows. add it.

Change-Id: I73f609d6285f52bb2b52f580b95ca4510204efa1
Reviewed-on: http://gerrit.openafs.org/4451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-10 20:48:13 -07:00
Simon Wilkinson
f1e04bedb2 Windows: Use roken gettimeofday implementation
Use the gettimeofday implementation from roken, rather than brewing
our own on Windows.

Change-Id: I02fc1a7f0f6aded2e16e2ed53e04054546fc0535
Reviewed-on: http://gerrit.openafs.org/4433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-08 05:21:12 -07:00
Simon Wilkinson
e0bdc5d652 configure: Check for localtime_r properly
Fix our check for localtime_r so that it actually picks up if it's
missing on Unix platforms, and gets libroken to build it.

Change-Id: Ibf6e3a0272b08aa55e0ee9493f68b3c53a5b6938
Reviewed-on: http://gerrit.openafs.org/4425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-04 15:58:29 -07:00
Simon Wilkinson
bda87d7943 viced: Tidy header includes
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

Also add a selection of headers to the list that autoconf checks for

Change-Id: Ic76bb02ff5353ceba380b78abc294251ecc66267
Reviewed-on: http://gerrit.openafs.org/4418
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-04 06:54:16 -07:00
Simon Wilkinson
cb87e0834c roken: Add env functions to configure checks
Add the putenv, setenv and unsetenv functions to the list of
functions that configure checks for. This avoids the roken header
redefining them to rk_*, which we're then not providing an
implementation of.

Change-Id: I63bd88326e933f0afed399233c38489cd2aea46b
Reviewed-on: http://gerrit.openafs.org/4406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-04-03 09:37:27 -07:00
Simon Wilkinson
12ea4a6f7a libwp: Tidy header includes
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.

Change-Id: I4952f8d115d38a3bd1dfe86478cd4a30f533e86f
Reviewed-on: http://gerrit.openafs.org/4386
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-02 12:40:36 -07:00
Marc Dionne
f2e91cc3fe Linux: Fix fallout from path_lookup commit
Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

Change-Id: I6251a96a371a50548dcafc70d94e91b52fc2922a
Reviewed-on: http://gerrit.openafs.org/4382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-01 05:54:56 -07:00
Simon Wilkinson
75c14f9d69 libadmin: Tidy header includes
Remove headers which are provided by libroken, and reorded header
includes so that they're a bit a more legible.

Add math.h to the list of headers that configure will check for

Change-Id: I530afa77866a0aa3a33f8684ce9cf630aa347812
Reviewed-on: http://gerrit.openafs.org/4384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-01 05:51:43 -07:00
Simon Wilkinson
c40be93362 kauth: Tidy header includes
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

This adds arpa/inet.h to the list of headers that configure checks for

Change-Id: I1792ede4be761238bb05567c1d763ed63f50051e
Reviewed-on: http://gerrit.openafs.org/4330
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-29 05:17:28 -07:00
Simon Wilkinson
69b37fb3a7 AIX: Add flock to roken
Add the rk_flock() emulation function to roken, primarily for use
on the AIX build, but it will also be used for WIN32

Change-Id: Ia8f11e19bbe9fdf721a7b72660d860624139d9b1
Reviewed-on: http://gerrit.openafs.org/4368
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-29 05:14:38 -07:00
Marc Dionne
7d162266c4 Linux: 2.6.39: replace path_lookup with kern_path
path_lookup is no longer available, use kern_path instead.

Change-Id: I42ae43114fe257fc65452f1b0a35d43595b0044b
Reviewed-on: http://gerrit.openafs.org/4360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-28 06:36:31 -07:00
Simon Wilkinson
e922ac7092 autoconf: Add tests for resolver headers
Add tests for arpa/nameserv.h and resolv.h, so that roken will look
after including these files for us.

Change-Id: Ifa6b7d877d67c967811017a25c98fab6bd571d4c
Reviewed-on: http://gerrit.openafs.org/4364
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-28 05:38:21 -07:00
Simon Wilkinson
8b88debf01 volser: Tidy header includes
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also, add sys/uio.h to the list of libraries that we check for.

Change-Id: I03d9c143db42a1ec415ab5624e2cbede0d34e310
Reviewed-on: http://gerrit.openafs.org/4318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-03-27 18:12:59 -07:00
Simon Wilkinson
96916c8fcf HP/UX: Make more use of roken
Make more use of roken on HP/UX by letting it provide definitions
for random and srandom, and using its implementation of
getdtablesize

Change-Id: I1212c77ea9cc6ef436cfc5c16e893aefbc33d31b
Reviewed-on: http://gerrit.openafs.org/4341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-26 22:18:58 -07:00
Simon Wilkinson
2d754dfd37 aklog: Tidy header includes
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Also add pwd.h to the list of headers that we check for in configure,
and that roken will include if they are available

Change-Id: I61ab95eeca11127a33bb668dddfc24ec6ce7f8f1
Reviewed-on: http://gerrit.openafs.org/4303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-26 22:17:56 -07:00
Simon Wilkinson
98a0c2f47b Disable vectored positional IO if no 64bit support
In order to support vectored positional I/O, and large files, we
need there to be an implementation of preadv64 and pwritev64. If
this isn't present, then just disable HAVE_PIOV.

Change-Id: I78b1e09f8a836534f49594300b4f58d661eebd46
Reviewed-on: http://gerrit.openafs.org/4153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-06 10:06:36 -08:00
Simon Wilkinson
7cd992d703 roken: Fix out-of-tree libroken builds
The libroken configuration script is supposed to support using a
libroken which is installed out of the OpenAFS tree, but which isn't
in the standard search paths, by using --with-roken=/path/to/base

This didn't previously work. Fix this so that it works correctly,
and also fix a few problems with libafshcrypto, which assumed that
LDFLAGS_roken would always be -L$(TOP_LIBDIR)

Change-Id: I1219692f601a621e6c08ae26516136ed0cc03845
Reviewed-on: http://gerrit.openafs.org/4096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-01 19:54:53 -08:00
Andrew Deason
839b62ab41 LINUX: Replace dcache.h for fs.h in config tests
When detecting if we have certain Linux kernel features, we only
include dcache.h. On some kernel versions (at least 2.4.27),
compilation fails if we include dcache.h directly (due to e.g.
list_head not being defined), which causes false negatives in tests
such as the test for dcache_lock. If we instead include fs.h, which
includes dcache.h, the tests succeed when they should succeed. So, use
fs.h instead of dcache.h.

Change-Id: I43fbbc7e5a952d9effbbac16adb9891c36f729bd
Reviewed-on: http://gerrit.openafs.org/3989
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-20 05:57:53 -08:00
Andrew Deason
11b2c6d6fe HPUX: Disable positional I/O
Some versions of HP-UX have the pread() and pwrite() functions, but
they behave in odd ways; most notably, ignoring the offset argument
when _FILE_OFFSET_BITS is defined to 64.

This is noted in recent gnulib documentation
<http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/posix-functions/pwrite.texi>,
and slightly less clear references to pread() being broken can be
found on the development mailing list for git itself.

It is not completely clear what specific HP-UX versions are affected
by this. An autoconf run-time test may also be insufficient, because
the same binaries should be usable on machines with broken and
non-broken pread() implementations. So, to be safe, disable positional
I/O on HP-UX unconditionally.

Change-Id: I09b8d9c441622c961d1df90fe27eeccaa948f5c4
Reviewed-on: http://gerrit.openafs.org/3949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-14 21:56:40 -08:00
Marc Dionne
281f5bf5fb Linux: 2.6.38: dentry->d_count is not an atomic
d_count is now an int protected by the dentry's d_lock.
Take the lock when we use it, instead of using an atomic_*
function.

Change-Id: Ib70e4a5315cc343518fa983e47bc7ff925acfc7f
Reviewed-on: http://gerrit.openafs.org/3883
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-12 14:38:28 -08:00
Marc Dionne
2eca7aef7b Linux: 2.6.38: deal with dcache_lock removal
dcache_lock is gone in 2.6.38, and some of the vfs locking rules
have changed.

Of interest for openafs:
- inode->i_lock protects the d_alias list
- dentry->d_lock protects d_unhashed()

Add a new configure test for dcache_lock, and replace its use by
the appropriate new lock(s).

Change-Id: Ic8d860d4f9f6438e966c15f5178c0d82343e3e1c
Reviewed-on: http://gerrit.openafs.org/3771
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-08 18:58:56 -08:00
Marc Dionne
5bcc0ea735 Linux: 2.6.38: Adjust for permission inode operation changes
The permission i_op has a new signature with a flags argument, and
must now deal with RCU path walking.
- Fix existing configure test for this i_op, it succeeds when it
shouldn't
- Add a new configure test for the new signature
- Make our permission i_op "RCU-walk aware" - return ECHILD if
called in that mode

Change-Id: I42a171694717f4621f29f9f59e4f6049926862a3
Reviewed-on: http://gerrit.openafs.org/3770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-08 18:58:38 -08:00
Marc Dionne
08bb83d950 linux: 2.6.38: New d_op handling
In 2.6.38, the super block structure has a new field to hold the
default dentry ops.  The vfs will automatically set it for new
dentries in most cases.

Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).

Change-Id: I9d738bdd528577d0a7ccd307246b5e935379c84d
Reviewed-on: http://gerrit.openafs.org/3758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-27 08:01:01 -08:00
Antoine Verheijen
be0e9fb703 OpenBSD: Add support for OpenBSD 4.8
Add param headers and other config info for OpenBSD 4.8
support.

Change-Id: I3af37dd79260d29bb7f3793c9a965bb84faab31f
Reviewed-on: http://gerrit.openafs.org/3748
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-24 09:07:57 -08:00
Antoine Verheijen
cd6bd75d1c OpenBSD: Make OpenBSD 4.7 param headers consistent
OpenBSD follows the policy of using a separate common
param file (post 1.4.x). However, when introducing support
for i386 OpenBSD 4.7, this was not done and a single param
config header file was created instead. This patch changes
the param files for OpenBSD 4.7 so that they are
consistent with the other OpenBSD versions by using a
separate common param header file.

Change-Id: I9d828d2447a2d018eeea0fbe9f4c047ac819d209
Reviewed-on: http://gerrit.openafs.org/3725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-22 12:58:45 -08:00
Simon Wilkinson
bf163cbebf roken: Check for bswap16 and bswap32 defines
Our imported roken.h provides definitions for bswap16 and bswap32,
but configure doesn't check to see if those functions already exist.
On operating systems where they do, and where the header containing
them is included in our build, this results in compilation errors.

Add a configure test for bswap16 and bswap32, which is complicated
by the fact that they may be macros, or static inline functions, so
a simple CHECK_FUNCS won't work.

Change-Id: Iae3411bf4bb22af8cfd770e01026a28e1863e078
Reviewed-on: http://gerrit.openafs.org/3613
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-03 06:38:42 -08:00
Simon Wilkinson
c8fc94fb86 autoconf: Tidy up header includes
Tidy up our list of header includes so it's easier to see what
we're testing for. The list is now one-per-line, in alphabetically
sorted order.

Note that this won't affect our use of the default include set, as
autoconf will already have tested for all of those before it starts
this CHECK_HEADERS run.

Change-Id: Iffc8c3bc7cbd56d87508ebdde38e61f8747d0501
Reviewed-on: http://gerrit.openafs.org/3612
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-03 06:37:45 -08:00
Andrew Deason
651f66b0ff Prefer libHcurses over libcurses
Use the HP-UX-specific libHcurses instead of libcurses, like we used
to. Otherwise we fail to link some gtx programs.

Change-Id: I7b8a012d5d263c611a144e05466c5435b5ff310a
Reviewed-on: http://gerrit.openafs.org/3583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-22 20:32:29 -08:00
Simon Wilkinson
f0f4770ab2 Build and use roken's mkstemp
Add roken's mkstemp to the build on all platforms, either through
configure (Unix) or explicitly (Windows). Change all callers so
that mkstemp is used unconditionally, rather than falling back
to more risky alternatives.

This is based on original change from Russ Allbery submitted as
http://gerrit.openafs.org/2146

Change-Id: Ia1def41e438e6517b3e7cd5790df3c99eddb8ef6
Reviewed-on: http://gerrit.openafs.org/3398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-01 13:09:27 -08:00
Christof Hanke
4a6a00d6f4 check curses-libs by configure
Presently, the used curses-library are determined by OS.
The leads to a build error when no curses-headers are installed.
Use configure to test if curses.h or ncurses.h is present.
ncurses takes precedence over curses.h.
If neither the curses- nor ncurses-libs are available, do not build
afsmonitor and scout.
A summary at the end of the configure should make this clear to
everyone.
The variable TXLIBS has been renamed to LIB_curses.

Change-Id: I3f661e0b6199be41818dc22149b061e3d599b77f
Reviewed-on: http://gerrit.openafs.org/3345
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-27 07:45:30 -08:00
Simon Wilkinson
7c4ee52c1a roken: Add the strsep function
Add the strsep function (as rk_strsep) to the OpenAFS roken build.
This function is required by Windows, and is now checked for on Unix.

Change-Id: I71d8e11a30c34aaa89d85d1e6e527d594d5734af
Reviewed-on: http://gerrit.openafs.org/3371
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-11-23 21:32:19 -08:00
Simon Wilkinson
ccb6e3a5d6 Add snprintf to roken for Unix builds
vsyslog on AIX (added to rokenafs by commit
f21fbf6b9c) requires rk_*printf,
add them to the libroken build.

Change-Id: I243cb89b5715be03920c562559b326786a9e9518
Reviewed-on: http://gerrit.openafs.org/3320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-17 07:44:06 -08:00
Derrick Brashear
f21fbf6b9c roken build vsyslog
in order to make aix happy, build vsyslog if we have it.

Change-Id: I78e7870ed4fef7ee9d41b0ae6096e6c2b1c6cc19
Reviewed-on: http://gerrit.openafs.org/3316
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-16 17:04:00 -08:00
Michael Meffie
aac929badb avoid private stdio fields in waitkey
Use the stdio_ext functions provided by solaris and glibc
instead of directly accessing private stdio FILE structure
members. This is needed for 64-bit solaris builds and is more
portable in general since the FILE structure is meant to be
opaque.  Remove the duplicated code in the pthreaded butc
package.

Change-Id: Idbefa88e2563bb117322e818b1300b324fc3626d
Reviewed-on: http://gerrit.openafs.org/3257
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-11-06 05:04:46 -07:00
Andrew Deason
3f4460e1e9 Use termios.h for winsize test where available
The configure test for 'winsize' existence was using sys/termios.h,
but some platforms (AIX) have termios.h but no sys/termios.h. So, use
termios.h instead where available.

Change-Id: I284b7fa27ceeed84d9e14b62032176846d764bf2
Reviewed-on: http://gerrit.openafs.org/3258
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-11-04 10:36:26 -07:00
Marc Dionne
2ea841feac Linux: 2.6.37 - replace get_sb with mount
With kernel 2.6.37 the new entry point for mounting a filesystem
is the mount() operation instead of get_sb().

Replace afs_get_sb with afs_mount if the new operation is
available, and use mount_nodev instead of get_sb_nodev.

Note that this is not strictly required for 2.6.37 since the old
interfaces are still around, but we might as well switch now.

Change-Id: Icc73a552fd53148bdd7b84e6d3266491488d9ed2
Reviewed-on: http://gerrit.openafs.org/3245
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-03 05:46:03 -07:00
Simon Wilkinson
5e47d03ed3 Add libroken as its own library
Include libroken as a library in its own right, so that the whole
of the code can benefit from it. This change purely adds libroken
for the Unix build system. It doesn't replace those pieces of
libroken in hcrypto or util, or enable it for Windows.

There is also the option of using a system-install libroken, if one is
found at configure time.
  *) If --with-libroken=yes, or is not supplied than a system library
     will be used if suitable. Otherwise, we'll use the internal
     libroken
  *) If --with-libroken=/path/to/installation then the libroken at
     that path will be used. If there is no libroken there, or it
     is not suitable, an error will be returned
  *) If --with-libroken=internal then the internal libroken is used,
     regardless of what is present on the system.

We deliberately do not provide installed headers for the internal
libroken. If other applications wish to make use of libroken, then
they should use the Heimdal one, rather than piggybacking on ours.

Change-Id: Iff01e1e17090404cc8e4783108ae8a8784170918
Reviewed-on: http://gerrit.openafs.org/3191
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-31 19:00:23 -07:00
Marc Dionne
1a6d4c162a Linux: fix aklog -setpag to work with ktc_SetTokenEx
The bit of code that allows aklog -setpag to work with recent
linux needed to be moved along with the change from ktc_SetToken
to ktc_SetTokenEx.

While we're in this bit of code, make it depend on the definition
of the syscall in the user space headers instead of relying on a
kernel configure test.

Change-Id: I0e556b514986b5d06daabcff67ecd51b0e4becdd
Reviewed-on: http://gerrit.openafs.org/2976
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-13 20:33:38 -07:00
Simon Wilkinson
e395c9f336 hcrypto: Fix builds on Irix
The recent hcrypto pullup added a depedence on the errx() function,
which isn't present on Irix. Solve this by pulling in a load more
of libroken, in order to provide this function.

In the long term, libroken should get split out into its own
directory, and the ability to use a previously installed
libroken should be added. For now, this will hopefully get Irix on
its feet again.

Change-Id: I0642f80079e113403cbef6eca03ca652616ddc61
Reviewed-on: http://gerrit.openafs.org/2904
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-05 06:48:46 -07:00
Chas Williams (CONTRACTOR)
87e96c30e0 configure: --with-linux-kernel-packaging should default to disabled
the test for this build feature is reversed.  by default, the value for
with_linux_kernel_packaging will not be defined which makes the existing
test pick MPS='SP' instead of LINUX_WHICH_MODULES.  based on the configure
help messages, this would appear to be an opt-in not an opt-out.

...
Optional Packages:
...
  --with-linux-kernel-packaging
                          use standard naming conventions to aid Linux kernel
                          build packaging (disables MPS, sets the kernel
                          module name to openafs.ko, and installs kernel
                          modules into the standard Linux location)
...

Change-Id: Ie16fba165e6c85b7ecbce887badb9ffc06a3a7a8
Reviewed-on: http://gerrit.openafs.org/2869
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-09-30 16:47:30 -07:00
Simon Wilkinson
513d6a3e35 rx: Add atomic operations code
Add support for an atomic type, and atomic operators for RX. This
builds on work which has already been done for Windows, where
InterlockedOperations are used for statistics gathering.

A new opaque type, rx_atomic_t is introduced so that normal arithmetic
operations will fail on atomic data.

An implementation using native atomic methods is provided for Darwin,
Solaris and Windows. A native kernel implementation is used for Linux.
Where OpenAFS is built with a sufficiently modern gcc, gcc's atomic
primitives will be used. Sadly, gcc's builtin operations are not
available for i386, they will only be used with builds the set
-march=i486 (or later).

Otherwise, we fall back to a single mutex which protects all atomic
operations.

Change-Id: I5f69677a80617e3936f82b177cd58250a6dbf31f
Reviewed-on: http://gerrit.openafs.org/2858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-09-30 06:07:04 -07:00
Simon Wilkinson
f73c085755 hcrypto: Add dirfd definition for solaris
Add an implementation of dirfd to our local roken implementation for
platforms that don't have one.

Code taken from Heimdal.

Change-Id: I4284c18430b6f49200886f5340191a14dcf34b57
Reviewed-on: http://gerrit.openafs.org/2608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-09-23 02:11:15 -07:00
Michael Meffie
335ccb4082 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>
2010-08-31 10:41:10 -07:00
Matt Benjamin
239a62034b DFBSD update dfbsd userland
Add new sysnames.  Fix some userland header inclusions,
defend against kernel-mode ioctl interpretation when
building UKERNEL.  Add fragments missing from DFBSD
MakefileProto template.

Change-Id: I56659bfe43dc24ef8a158aaf486c9a6f23643002
Reviewed-on: http://gerrit.openafs.org/2619
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-29 17:22:40 -07:00
Simon Wilkinson
3fc5863f06 Configure: Tidy up AC_CHECK_FUNCS
Move all of our AC_CHECK_FUNCS calls into a single, ordered, list
so that it's easier to see what's being checked for and what's not.

Change-Id: Ib8e356ada469d4b3be8cc6387df91de21a2d1e8a
Reviewed-on: http://gerrit.openafs.org/2598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-20 05:35:31 -07:00
Simon Wilkinson
10ff668dcb hcrypto: Check for arc4random
Add a configure test for the arc4random function which hcrypto can
use as an entropy source

Change-Id: If1ae243d2f2850be0efd0030a37ac026cdb0e7ba
Reviewed-on: http://gerrit.openafs.org/2597
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-20 05:35:20 -07:00
Simon Wilkinson
f6d1f17f48 Add OpenAFS build machinery for libhcrypto
Add an OpenAFS build environment for the symmetric algorithms in
libhcrypto.

Change-Id: I0d971433fe0130854a7c50cd9107af02893b1d58
Reviewed-on: http://gerrit.openafs.org/2575
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-19 09:23:26 -07:00
Chaz Chandler
e8bb948db1 autoconf detection of label support
acinclude.m4 now has struct label support detection and sets
HAVE_STRUCT_LABEL_SUPPORT in afsconfig.h.  Obviates complicated
ifdefs in various src/afs/ and src/rx/ files.  Must run regen.sh
to generate new configure and afsconfig.h.in, then configure will
detect label support and set afsconfig.h appropriately.  Not sure
what to do for Windows, but should be a step in the right
direction.

Fixes issue with compilation of libuafs on IRIX and sunpro by accurately
detecting label support.

Change-Id: I092eda47c4cfcc2517dc39f5e48b5038c413cb01
Change-Id: I2ff8449b28db645d9cfd27796b5f89e5c328a2b2
Reviewed-on: http://gerrit.openafs.org/2516
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-12 15:07:21 -07:00
Marc Dionne
fb01fbd7cd 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.

Change-Id: I68d75830b43df710ccce173ab36f3bb39074c59e
Reviewed-on: http://gerrit.openafs.org/2544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-12 13:46:04 -07:00
Marc Dionne
eaf3378f53 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

Change-Id: I2f5e8a0b660b48453d0152b6c4db64e57539f91a
Reviewed-on: http://gerrit.openafs.org/2543
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-12 13:43:53 -07:00
Derrick Brashear
3121a07fbf disable pmtu error gathering
don't enable kernel pmtu, don't collect errors.

a report from Marc Dionne suggests there are still issues here

Change-Id: Ib54fa522ba53efe50e8f08b27422ebfc8af7f9e5
Reviewed-on: http://gerrit.openafs.org/2538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-11 22:54:54 -07:00
Andrew Deason
1ad26bc193 autoconf: Force absolute INSTALL
Force using an absolute path for install-sh. Autoconf normally prefers
using a relative path, which confuses (at least) part of the libafs
build system.

Change-Id: I6962e61bb866362f674708e611ff22eb190a771a
Reviewed-on: http://gerrit.openafs.org/2461
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-22 11:51:38 -07:00
Simon Wilkinson
c3fc948e34 Check for crypt in external library
Check to see if we need to explicitly include a library in order
to get the crypt() function

Change-Id: I9bd1d70e420d4d1656bd86cd3215525102fa6259
Reviewed-on: http://gerrit.openafs.org/2404
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 21:45:18 -07:00
Derrick Brashear
95f51b8670 enable pmtu in configure by default
if we can get a socket error to let us get pmtu discovery info,
use it.

Change-Id: I7756c1a00e6cb018146a5b0545bed828446e5483
Reviewed-on: http://gerrit.openafs.org/2400
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 21:25:25 -07:00
Derrick Brashear
3610ba191f demand attach build always
always build demand attach. includes doubtless-broken
windows support. installs dafileserver, dasalvager, davolserver.
salvageserver keeps its (unique) name.

Change-Id: Ia272dd2b0f72789b9e0f2a7712f9c206bb922095
Reviewed-on: http://gerrit.openafs.org/2403
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 21:22:30 -07:00
Derrick Brashear
b666166b6d simple is-lex-flex autoconf test
if we're flex, we may need to be lex-compatible. engage
it if we're flex

Change-Id: If9a39ca0bce3f4a68b742d1e8f0c679d3f79896e
Change-Id: I7f245d579bcc46fdd0aa7202bbd45f3f9f647ebc
Reviewed-on: http://gerrit.openafs.org/2399
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 19:27:46 -07:00
Derrick Brashear
52fe3b2748 64bit macos new config.guess support
new config.sub/config.guess call 64 bit macos something
new. update our handling so we deal.

Change-Id: Ieadd71b66e879ff58bf2c7f77173284c570e4252
Reviewed-on: http://gerrit.openafs.org/2398
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 11:35:21 -07:00
Derrick Brashear
d29643b055 unix disconnected mode always
per 1.6 release plan, enable disconnected always. eject ifdefs
(and a stray printf that was hidden in one)

Change-Id: I6a68cb8506878c28502e1742a48858f2e84958f5
Reviewed-on: http://gerrit.openafs.org/2397
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 11:35:09 -07:00
Derrick Brashear
27d415d2b8 linux cache bypass by default
can't eject the ifdef yet as this is not fully portable now.
however, just enable it always.

Change-Id: Ia7a49a10377f308740ebd42027ac9748b073016e
Reviewed-on: http://gerrit.openafs.org/2396
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 11:34:53 -07:00
Ken Hornstein
cdef1c67ae fix dumptool on macos
make dumptool in test suite compile on macos again

Change-Id: Id60f625ce53bc9695673b68c733fa653521a8122
Reviewed-on: http://gerrit.openafs.org/2387
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-12 12:17:17 -07:00
Derrick Brashear
bdf6192509 bosserver force corefiles
override system resource limits so we get corefiles

Change-Id: I50f228d709090c8275bed2fc2958653c43a0a026
Change-Id: I5b5e8c6a5e02ed0b28610949eb81f6345357969e
Reviewed-on: http://gerrit.openafs.org/1959
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-02 09:35:36 -07:00
Andrew Deason
e61800b992 Remove --enable-fast-restart configure option
FIXES 127526

Change-Id: I80a18fe083a0d52dad9d4e2d5b14bf667c44630b
Reviewed-on: http://gerrit.openafs.org/2278
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-01 08:32:19 -07:00
Marc Dionne
b59af55f80 Linux: Use filehandles for all 2.6 kernels
This generalizes the use of the exportfs API and file handles
to open disk cache files for all 2.6 kernels.

Code outside of src/afs/LINUX (ex: afsd) can assume that file
handles are used for all 2.6 kernels and can use AFS_LINUX26_ENV
to check.

Within src/afs/LINUX/osi_file.c, NEW_EXPORT_OPS can be used to
determine if the old exportfs API (pre 2.6.24) or the new one
applies.

All traces of the LINUX_USE_FH define are removed.

FIXES 127530

Change-Id: I6803101c56981f9f674cef581f7299656723fdf3
Reviewed-on: http://gerrit.openafs.org/2260
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-27 20:33:12 -07:00
Andrew Deason
5e4c33f563 Indicate that fssync unix sockets are the default
Using unix domain sockets for FSSYNC has been the default for some
time now; make it clear from the configure help output that this is
the case.

Change-Id: Ibe8b41361242d6cea035b7710910d7d693f60a85
Reviewed-on: http://gerrit.openafs.org/2241
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2010-06-23 15:57:26 -07:00
Russ Allbery
77ebaaf639 Remove configure remnants of Digital UNIX / Tru64 client
Remove the configure flag to specify the location of the Digital
UNIX kernel headers and some setup for the kernel module build.
Note in README that Digital UNIX / Tru64 is supported for servers
only.

Change-Id: I983f74068b1a1ae76d9a2b2549a8a141dba4e075
Reviewed-on: http://gerrit.openafs.org/2207
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-16 06:12:58 -07:00
Russ Allbery
9784847fed Rework the Kerberos Autoconf probes
Previously, building with Kerberos support required either passing a
flag to configure giving the location of a krb5-config script, or
manually setting variables specifying the Kerberos libraries and
header path.  Replace that code with code that checks for Kerberos
libraries automatically and builds the Kerberos code if any were
found, with support for doing direct library probing if there is no
krb5-config script.

Add several platform-specific overrides directly into the configure
support, so we should be able to build out of the box on Mac OS X 10.3,
HP-UX, and AIX Kerberos with the new probes.

The Kerberos Autoconf macros are now the versions that come with
rra-c-util and are tested with multiple other packages, so both
OpenAFS and those packages will be able to benefit from further
portability improvements.

Update README for the new building instructions, documenting how to
configure the Kerberos probes if they can't automatically figure out
the location and flags for Kerberos on your system.

Change-Id: Ia35bb0dbc6b94c6b4dfe8165388447dbfcb31a29
Reviewed-on: http://gerrit.openafs.org/2026
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-15 16:30:04 -07:00
Derrick Brashear
f790747143 ktc newpag stub when environ is not supported
on macos systems where we can't get the environment,
just return from ktc_newpag

Change-Id: I9a169d0bf035c40d727a386bb3d2070eea225ed4
Reviewed-on: http://gerrit.openafs.org/2150
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:22:01 -07:00
Marc Dionne
4d89ce0a89 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.

Change-Id: Iaf660808d52688a4a8fd53a76d8d055602f746b9
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>
2010-05-29 21:46:22 -07:00
Rainer Toebbicke
e4596a9d07 Typo made sysctl table invisible
AC_CHECK_LINUX_STRUCT for the check for ctl_name in ctl_table instead
of AC_CHECK_LINUX_FUNC.

Change-Id: Ia0e0de5d62ce7f702a3f1d7a5cd4d19ef726095c
Reviewed-on: http://gerrit.openafs.org/2057
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 08:42:29 -07:00
Simon Wilkinson
5219a6b33b Linux: Disable syscall probes if we have keyrings
If we are building for are kernel with keyrings, and we can
guarantee that we can make use of those keyrings, then we no longer
need to probe for the syscall table at all. Change our default
behaviour so that when these two conditions are true, syscall probing
is disabled. Both --enable-linux-syscall-probing and
--disable-linux-syscall-probing can be used to override the
autodetection and force things one way or the other.

We have to check that we can use the keyrings because there was a
window in the 2.6 kernel series where keryings were available, but
the key_type_keyring definiton (which we use to create the session
keyring) wasn't exported. In that situation, we attempt to traverse
the process table and use the type of init's session keyring. This
traversal is fragile, and if it fails, keyring PAGs will be disabled.
So, we still want to be able to fall back to patching the syscall
table, if we can, in this case.

FIXES 125215

Change-Id: I11ba5c68fe37609bbd6b9c9f7e7c699334f42ebc
Reviewed-on: http://gerrit.openafs.org/2002
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-05-24 21:15:26 -07:00
Russ Allbery
8aa5328bd5 Postmoderize use of AC_CHECK_TYPE
Use AC_TYPE_SSIZE_T to handle the ssize_t check (introduced in Autconf
2.60).  Use AC_CHECK_TYPE, not AC_CHECK_TYPES, to check for sig_atomic_t
and socklen_t, and define them in afsconfig.h if they're not present on
this platform.  Do not define them in stds.h, since stds.h is an installed
header file and cannot rely on Autoconf defines.

Change-Id: I80e1a00efc84420002a95d6cafc25ea70befa49d
Reviewed-on: http://gerrit.openafs.org/2018
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-24 20:24:37 -07:00
Simon Wilkinson
bf2e4dd23e Linux: Use positional r/w, not llseek
The Linux read/write file operations take a position. Use this
position to determine where we're reading or writing in a file,
rather than using the vfs_llseek() operator to set the file
position argument. This avoids a potential race condition, as
well as simplifying this code.

Change-Id: I82b4a109f9871fa2ce5b308bc32923b1bf910920
Reviewed-on: http://gerrit.openafs.org/1993
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-19 11:21:27 -07:00
matt@linuxbox.com
c433f3d8ee linux PageCheck may be PageFsMisc
Define the PageCheck family of functions using PageFsMisc
equivalents if those are found.  I encountered a need for this
on Centos 5.5 (2.6.18-8.el5xen), but it may be more general.

Change-Id: I365a769614fd7514e0c0223bf1854cce09f759f7
Reviewed-on: http://gerrit.openafs.org/1982
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-18 10:47:20 -07:00
Simon Wilkinson
af6b80f257 Autoconf: Use AC_CACHE_CHECK
AC_CACHE_CHECK has been available since Autoconf 2.5 (released in
1995), and provides a simpler mecahnism for performing cached checks
than AC_CACHE_VAL does. Modify all of our simple AC_CACHE_VAL calls
to use AC_CACHE_CHECK.

Change-Id: I490f5e6ae5a3fdc1ada88aba9cd22c89d415a376
Reviewed-on: http://gerrit.openafs.org/1974
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 09:34:16 -07:00
Ben Kaduk
ed2f4f8d3d Kill FBSD4X with fire
We haven't even pretended to work on the 4.X series for quite some
time, and keeping this code around just makes things (slightly)
harder to read.
AFS_FBSD_ENV is now equivalent to AFS_FBSD50_ENV (though the
latter should not be used).
Leave the fbsd_4 sysnames in afs_sysnames.h for archival purposes.

Change-Id: Ibebda92967ca26c3dd4bf0b2cc6a66ae3a94d0ff
Reviewed-on: http://gerrit.openafs.org/1968
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 05:36:29 -07:00
Simon Wilkinson
aa7273233d Autoconf: Use a standard test for socklen_t
Use the standard AC_CHECK_TYPES mechanism to check for the existence
of socklen_t, and to typedef it as an int if it's not found, rather
than growing our own.

Change-Id: Ib5aeb600750558167f63833dd4a7480dbe312b8a
Reviewed-on: http://gerrit.openafs.org/1972
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 04:48:10 -07:00
Michael Meffie
dea064a509 Linux: missing configure test
Add the kmem_cache_create test for dtor to the configure to
build again on older versions of linux. Fixes,
osi_vfsops.c:264: error: too few arguments to function
‘kmem_cache_create’

Change-Id: I1c1aa63e8dbe2df6c9b889edaa66708d7db01847
Reviewed-on: http://gerrit.openafs.org/1948
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-11 13:27:59 -07:00
Russ Allbery
fd9ab5cb7c Include common param file for Linux alpha builds
The sysname for Linux Alpha is alpha_linux_26 (or 24 or 22) with an
extra underscore before the version, unlike all the other Linux sysnames.
Allow for that case when deciding whether to include the common Linux
param header.

Change-Id: Icab3a9214d0bd020b846734cce27da6c1bdeab56
Reviewed-on: http://gerrit.openafs.org/1915
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-07 11:24:43 -07:00
Simon Wilkinson
07098dc670 Modernise use of AC_CHECK_TYPE
Prior to autoconf 2.13, AC_CHECK_TYPE took two arguments, the type
to check and the a default type to use if that type wasn't defined.
This usage has been deprecated since 2.13, and the AC_CHECK_TYPE
macro itself now behaves differently. Whilst there is a compatibility
mode, the autoconf documentation discourages its use.

We also have an occurence of a slightly more modern AC_CHECK_TYPE,
where we explicitly #define a default value if one isn't provided.
The autoconf manual also discourages this form, however, in favour
of using AC_CHECK_TYPES, and placing suitable typedefs in an
external header file.

Modify our code so we do things in the recommended way.

Change-Id: Ie28067f2c90e9a3aa25cfde45ef081da2d380ee1
Reviewed-on: http://gerrit.openafs.org/1914
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-06 12:23:22 -07:00
Jonathan A. Kollasch
fb50f2478c NetBSD 5.0 support.
Change-Id: I5b9c5b8204ef729d9719f195ddbaf83c5f9cb4b5
Reviewed-on: http://gerrit.openafs.org/1738
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 19:55:30 -07:00
Antoine Verheijen
0ec2239b73 Fix pattern to detect i386-based OpenBSD system type
When the pattern to detect OpenBSD system types (via MKAFS_OSTYPE) was split
into two separate ones for amd64 and i386 architectures, the pattern for
i386-based systems was not set quite right. As a result, i386-based OpenBSD
systems are no longer detected properly at this stage, resulting in an error
of "cannot find input file: src/libafs/MakefileProto..in" during configure.
This patch corrects the pattern.

Change-Id: I67079af74117fa3cdc765f19944e23223709ae6b
Reviewed-on: http://gerrit.openafs.org/1897
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-03 17:02:25 -07:00
Matt Benjmain
94c15f62d3 netbsd: rebase cm at NetBSD 4.0
Rebases the NetBSD client port at OpenBSD, which was originally
based on an original NetBSD client port by John Kohl.  The
platforms remain closely connected.

At latest milestone, the port builds as a NetBSD LKM, which was
loadable and can mount /afs (but much work remains past this
point).

Change-Id: I1381a60078794da03a82e7bf6e78127da82d61ee
Change-Id: I8e07e82796f6981c99d22ff50dd5b284aad88a9f
Reviewed-on: http://gerrit.openafs.org/1874
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-04-28 13:47:20 -07:00
Simon Wilkinson
d02f9a0b0b Linux: Register number sysctls only when desperate
The AFS sysctl interface was trying to register numeric system
calls whenever the kernel would let it. This is anti-social, as
we've never had sysctl numbers allocated to us. In kernels newer
than 2.6.24, this misbehaviour is detected and punished. In recent
kernels, the binary interface has gone away entirely.

Since 2.6.19, the kernel has supported allocated unnumbered system
calls. These are only available via /proc/sys (and not the using
the legacy, binary, API), but they're really the only interface
available to us.

Change the sysctl registration code to use unnumbered calls whenever
they are available. Unnumbered calls aren't available in 2.4.x, so
completely remove that code there.

Change-Id: I882117ca2250894f479292026fed84ff0b5e7972
Reviewed-on: http://gerrit.openafs.org/1871
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 21:43:15 -07:00
Simon Wilkinson
b7a94ae11d Linux: autoconf fallout
grap != grab - fix spelling of grab_cache_page_write_begin

Change-Id: I4032bff80b6d1d7568af8f9de59a56c0bd6a661a
Reviewed-on: http://gerrit.openafs.org/1859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 14:36:04 -07:00
Simon Wilkinson
0c7cb6051f Linux: Reorder the tests
As a final change to the Linux autoconf stuff, reorder the list of
tests so that it's more easy to see what's being checked for, and to
prevent multiple copies of the same thing being added.

Change-Id: I84ca132e178b45ac25ebd48e71193bdd84965770
Reviewed-on: http://gerrit.openafs.org/1857
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:27:54 -07:00
Simon Wilkinson
2ce28370cf Linux: Don't preprocess osi_vfs.h
Before we did inodes properly, we needed to pre-process osi_vfs.h,
in order to merge our inode structure with the Linux one. Ever since
we moved to native inodes, that preprocessing has been disabled, and
we've just copied osi_vfs.hin to osf_vfs.h Skip this pointless step,
permanently rename osi_vfs.hin to osi_vfs.h, and remove the unused
support scripts.

Change-Id: I5e21eccf2242080cd8b994bd1654260bfb531420
Reviewed-on: http://gerrit.openafs.org/1856
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:27:32 -07:00
Simon Wilkinson
a8cc8dbbe5 Linux: Don't waste autoconf checks on cpp defines
If something is a #define, then there's no point in doing a test
compile to check for its presence. Instead, just do #if defined(X)

Remove the tests for for_each_process and prev_task.

Change-Id: Id8a9fddf2571cccd5d61982d4662bce2009c8f43
Reviewed-on: http://gerrit.openafs.org/1855
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:27:12 -07:00
Simon Wilkinson
a89d6b029d Linux: Add general autoconf macro for Linux kernel
Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
takes a "checking" message, the autoconf variable to use to cache
the results, headers and code to run, preprocessor variable to
define, and a description of that variable.

Reimplement all of our existing check macros in terms of this one,
resolving many typos along the way.

Change-Id: I41988c83fcdbfbf8152f6dd0e7c4bd16c7a04240
Reviewed-on: http://gerrit.openafs.org/1854
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-27 12:26:46 -07:00