right now we compare against /etc/services, and a hardcoded array.
but since there's no guarantee /etc/services will be useful, this
can mean inconsistent behavior. hardcode the iana names in the table,
and take the internal structure used private at the same time.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/577
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>
prints 'fs setacl' commands necessary to create the current
ACLs. This is useful for backup scripts using TSM (or others)
to save the ACLs into a file to allow for later restore.
Reviewed-on: http://gerrit.openafs.org/556
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
As we're being built by the standard Linux module build system, we
can use the normal #include <linux/blah.h> convention from including
kernel headers.
Reviewed-on: http://gerrit.openafs.org/582
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
OpenAFS preference pane has been updated to manage the new launchd startup mode. Has been delete the custom startup and shutdown file now is user the /Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.rc
OpenAFS.postinstall has been modified to remove the old existing /Library/StartupItems/OpenAFS directory
OpenAFS.pre_upgrade has been modified to shutdown daemon, if it is runnig, and remove the old preference pane to permit the one to be installed
Reviewed-on: http://gerrit.openafs.org/578
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
afsio bypasses the cache manager to achieve higher throughput.
However, it uses the cache manager to stat or create files over the
AFS path.
Besides 'apropos' and 'help' there are 3 subcommands:
'write' pipes data into a new or empty AFS file
'append' pipes data at the end of an existing AFS file
'read' pipes data out of an AFS file
for 'write' there is an option '-md5' which calculates on the fly
the md5 chscksum and prints it to stdout. (Useful when you create
long time archives to keep it separately for later ...)
for 'write' there is also an option '-synthesize <size>' to do just
performance tests. It creates a file which contains at the
begin of each 4 KB block the offset printed in ascii.
for all subcommands exists a '-verbose' option which writes to
stderr data rate and timing information.
All three subcommands may also be used prefixed with 'fid' accepting
then a Fid instead of an AFS path. With the 'fid' prefix also a '-cell'
option is allowed.
Reviewed-on: http://gerrit.openafs.org/555
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Adapt to the writeback changes in kernel 2.6.32
- Since we define our own backing_dev, it needs to be registered with
the writeback code and attached to the super_block. Otherwise it
might get ignored when writeback is needed.
- Each backing_dev now gets its own kernel thread. The name of the
thread is based on the registered name - the openafs one will appear
as "flush-afs".
Reviewed-on: http://gerrit.openafs.org/574
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On success, storePadd should return 0, not the number of bytes
written by the last rx_Write call. In some cases this return
value would leak all the way out to the close() system call,
causing it to fail.
Reviewed-on: http://gerrit.openafs.org/573
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The readpage call on Linux was becoming horribly complex.
This patch refactors it into three main components - a function which
fills a locked page (without unlocking it), a function which triggers
a cache bypass operation on a page, and a function which does
conditional prefetch, based on the properties of the page that was just
read.
In addition, we abstract out the cache bypass code further, and provide
static inline variants which are simply stubbed out when cache bypass is
disabled.
Reviewed-on: http://gerrit.openafs.org/569
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Introduce osi_compat.h, a place to hide compatibility #ifdefs. Make
a start on using this by purging #ifdefs from osi_vnodeops, and pushing
changes into inline compatibility functions.
The general idea here is to create a single location where we can do our
multiple version compatibility magic, and by doing so reduce the
complexity of the rest of the code. The approach is that where the
kernel introduces a new interface, we should switch to using it in the
rest of the code, and add a compatibility function (in osi_compat.h)
which implements the new interface in terms of the old one, suitably
protected by #ifdefs.
Where an interface changes signature, but not name, we should implement
an afs_<blah> version of the function which has the signature of the
newest version, and within that call out to the real kernel versions,
mapping between the different parameters as appropriate.
Reviewed-on: http://gerrit.openafs.org/568
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This change removes support for kernels before Linux 2.6.0 from
src/afs/LINUX. Older kernels should be supported by the src/afs/LINUX24
code.
Reviewed-on: http://gerrit.openafs.org/567
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
shadow src/afs/LINUX into .../LINUX24, removing 2.6 code from it
same for rx/LINUX
cheat and simply modify MKAFS_OSTYPE in MakefileProto.LINUX.in
Reviewed-on: http://gerrit.openafs.org/565
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The cache manager has two implementations of md5 - one in afs_md5.c
(used by afs_NewCell) and one in afs_util.c - used by Linux's MD5-inode
code.
Remove the one in afs_util.c in favour of using the common
implementation in afs_md5.c
Reviewed-on: http://gerrit.openafs.org/572
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
the changes needed to switch from a StartupItem to a LaunchDaemon for
the MacOS OpenAFS client
Reviewed-on: http://gerrit.openafs.org/564
Tested-by: Claudio Bisegni <Claudio.Bisegni@lnf.infn.it>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Claudio Bisegni <Claudio.Bisegni@lnf.infn.it>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The kernel checks itself for read() calls which attempt to fetch
pages past the current file extents. Remove ours.
Reviewed-on: http://gerrit.openafs.org/566
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Make FSYNC_sync wait until VInit == 2 before serving FSSYNC requests.
This follows the existing similar behavior of waiting until after volume
preattachment is completed before serving RPC requests in DAFS. This
prevents FSSYNC clients from being denied requests simply due to a
volume not having been preattached yet, at the small cost of delaying
how soon we can serve FSSYNC requests.
This does not alter the behavior of non-DAFS, which still only waits
until VInit == 1, since volume attachment takes significantly longer
than preattachment.
Reviewed-on: http://gerrit.openafs.org/563
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
It is possible for GetVolObject to return success, but result in a NULL
fs_tv. In particular, when the fileserver responds with FSYNC_WRONG_PART
or FSYNC_UNKNOWN_VOLID. It is possible, though difficult, for the
fileserver to respond with FSYNC_UNKNOWN_VOLID if the requested volume
hasn't been preattached on the fileserver yet.
So, in GetVolInfo, also check fs_tv, so we don't try to dereference it
later.
Reviewed-on: http://gerrit.openafs.org/562
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
pagevec_lru_add_file isn't available on all Linux kernels.
Fallback to using pagevec_lru_add where necessary.
Reviewed-on: http://gerrit.openafs.org/558
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
VLRU_Add_r() places a volume into VOL_STATE_VLRU_ADD before
calling VLRU_Wait_r(), which drops VOL_LOCK while waiting
for the required VLRU queue to quiesce. Thus, it is essential
that state VOL_STATE_VLRU_ADD be marked exclusive so that
another thread cannot mutate state until the VLRU generation
add transaction completes.
Reviewed-on: http://gerrit.openafs.org/554
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If the service is shutting down or the machine is entering
a suspend state, short circuit the background volume checks
to permit faster shutdown.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
LICENSE BSD
This patch adds support for backgrounding the page copies which are
caused by a call to readpages() In theory, this should improve the
throughput of the AFS kernel module as it permits processes to start
work whilst data is still being read into the page cache for later
pages.
Reviewed-on: http://gerrit.openafs.org/537
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This patchset adds support for the readpages() system call, and enables
readahead on Linux. At the moment each page read causes readpages to
block, so the client won't see much benefit from readahead, beyond the
reduction in call overhead.
Reviewed-on: http://gerrit.openafs.org/536
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Fix a whole host of warnings in the demand attach code.
Make a broken tvolser build stop the build, rather than carrying on
regardless.
Reviewed-on: http://gerrit.openafs.org/551
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The demand attach code defines volume pointers as volatile in
a number of places, despite the fact that the values in question
aren't being shared between multiple threads. It then also passes
these volatile pointers into functions which don't treat them as
volatile (and even to some which assign them to registers).
This patch simply removes the use of volatile in this situation.
Reviewed-on: http://gerrit.openafs.org/550
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
some kernels don't have e.g. uintptr_t; revert this hunk for now.
also, autoconf as recent as what's in rhel5 has no macros. provide
some.
Reviewed-on: http://gerrit.openafs.org/553
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Modify the fast path case so that it uses readpage(), rather than read()
to access data in the cache. This removes a lot of the hidden, uncessary
work that the kernel was doing behind the scenes, and takes advantage of
the fact that we know a page read will always result in a page read
against the backing cache.
Reviewed-on: http://gerrit.openafs.org/535
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fix compilation for irix (and warning for solaris) for icreate
as well as more stdint.h fixes
Reviewed-on: http://gerrit.openafs.org/548
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
To assist with debugging, add consistent trace log messages for
smb operations that generate an error because smb_FindFID failed.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/545
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Has been removed from license file the reference to menucracker for hack NSMenuExtra, that is no more needed.
Reviewed-on: http://gerrit.openafs.org/547
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If cm_GetBuffer is being called in order to obtain a buffer to store
data beyond the end of the existing file as known to the file server
there is no reason to contact the file server. Instead use the cached
status info in order to allocate a new buffer zero initialized.
This logic avoids triggering the FetchData bug in all file servers
older than 1.4.12 and 1.5.65 in which the file server returns a
large negative number (filesize - requested_offset) when a FetchData
is received where the requested_offset is larger than the filesize.
It also avoids unnecessary work.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/542
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
When enumerating streams for objects, do not offer a default stream
for directory objects (including mount points).
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The POD formatting code for bold is B, not b.
Reviewed-on: http://gerrit.openafs.org/546
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
pthread_t is defined as being opaque - there's no way to portably
print it on a way that makes sense on all platforms. Remove this output.
Reviewed-on: http://gerrit.openafs.org/541
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
3f2dd80697 contained a number of
new warnings. This patch fixes them.
It also adds the AFS_UNUSED_FUNCTION macro which can be used to
portably mark functions as unused.
Reviewed-on: http://gerrit.openafs.org/543
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Get rid of more warnings in viced
- Cast fids that we pass into the Dir package to avoid type warnings
- Add ()s to a && b || c, to clarify its meaning - (a && b ) || c
- Don't use %ld to print ints
- Prototype another function from the host package
Reviewed-on: http://gerrit.openafs.org/539
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
just like everywhere else. move the one last
struct UCRED to UCRED like everywhere else
Reviewed-on: http://gerrit.openafs.org/538
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reduce the number of times we cref() unnecessarily, and add a fastpath
at the beginning of readpage() to handle the cache hit case.
Refactor the Linux implementation of afs_open to provide a directly
callable version that bypasses the OSI layer.
Add a non-blocking variant of ObtainReadLock()
Reviewed-on: http://gerrit.openafs.org/534
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
due to 32/64 and a newer compiler, macos 10.6 finds more warnings.
these are fixes for some of them.
Reviewed-on: http://gerrit.openafs.org/533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
"static inline" doesn't work on various still-supported systems.
use the workaround macro
Reviewed-on: http://gerrit.openafs.org/532
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
There's no need to hardcode 'cc' for libuafs builds on Darwin. Let
the user specify the compiler to use, in the same way as for the
rest of the tree.
Reviewed-on: http://gerrit.openafs.org/531
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This patch adds a '--enable-checking' configuration option. When this
option is supplied, and gcc is in use, the compiler will treat any
warnings as errors. This will hopefully help stop new warnings from
creeping into the tree.
In order to still be able to build, all of the currently existing
warnings are accepted (these are documented in README.WARNINGS). With
this set of warning inhibitions, the tree is known to build on 32bit
Leopard - other systems may vary. Warning inhibition may be disabled
by supplying --enable-checking=all - in this case the tree will
definitely not build!
If --enabled-checking is not specified, the existing compilation
behaviour is maintained, so there is no user-visible change.
Gcc 4.2, or later, is required to use the pragma sets contained within
this patch. Again, they are not visible unless --enable-checking is
given.
Reviewed-on: http://gerrit.openafs.org/526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Irix has no stdint.h; wrap in ifdefs so we don't include
when we don't have it.
Reviewed-on: http://gerrit.openafs.org/530
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
previously we used fprintf without a format string in some cases. now we don't
Reviewed-on: http://gerrit.openafs.org/528
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The implementation follows the specification from October 2007.
All old tags are accecpted as before.
New tags 0x06-0x60 (capital letters) are followed by a 1 byte length
field which may contain directly the length (up to 127) or the length
of the then following length field (max 8) ored with 0x80.
New tags 0x61-0x77a are directly followed by 4 bytes building a 32bit
integer.
0x7b-0xf are single-byte tags, 0x7e meaning next tag is critical.
On this basis unknown tags can be skipped unless they were marked
critical. In this case the restore is aborted.
in dump.h tags following the new standard are marked by an asterisk
Last update: added parameter types for HandleUnknownTag.
Reviewed-on: http://gerrit.openafs.org/191
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Some parts of the build provide -DAFS_NONFSTRANS on the command line.
This causes an error when the 'param' file redefines it. Fix this
by #undef ing the token before defining it.
Reviewed-on: http://gerrit.openafs.org/510
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>