Ronnie Sahlberg [Tue, 25 Nov 2014 14:47:55 +0000 (06:47 -0800)]
New version 1.9.6
- Add O_TRUNC support for nfs_create
- Handle OOM during create
- Return more stats fields as part of readdir since we get these for "free"
when we use READDIRPLUS
- Follow symlinks during path resolution
- Add lchown, lstat and lutimes
- Replace all [u_]quad types with [u]int types in our RPC layer
- Solaris build fixes
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Stefan Blanke [Thu, 30 Oct 2014 16:32:43 +0000 (16:32 +0000)]
Issue READIRPLUS calls with a sensible dircount maxcount ratio
The NFS spec states:
"The ratio of the directory entry size to the size of the attributes plus the
size of the file handle is usually at least 8 to 1."
Though implementation dependent the spec implies that the previous 1 to 1 ratio
could have a detrimental impact on the performance of the server due to most of
the data per VOP_READDIR call being wasted.
The Linux kernel uses the 8 to 1 ratio.
Signed-off-by: Stefan Blanke <stefan.blanke@framestore.com> Signed-off-by: Mark Hills <mark.hills@framestore.com>
Ross Lagerwall [Sun, 14 Sep 2014 14:41:04 +0000 (15:41 +0100)]
libnfs: Add access2()
Add nfs_access2(), like nfs_access() but it returns the individual
statuses of R_OK, W_OK and X_OK rather than a single success or failure
status. This saves the latency and overhead of multiple lookups if an
application tries to determine the status of each of R_OK, W_OK and
X_OK.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Ronnie Sahlberg [Sat, 16 Aug 2014 21:51:53 +0000 (14:51 -0700)]
types: remove the [u_]quad type and replace with [u]int64
All current platforms have a quad type that maps to a 64bit scalar.
But there are platforms where quad maps to a 64bit non-scalar.
Replace quad with int64 in the protocol definitions and the ZDR layer
so that these fields will map to a 64 bit scalar also on those platforms
where quad can not be used.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Mike Frysinger [Tue, 4 Dec 2012 03:30:04 +0000 (22:30 -0500)]
fix implicit decl warnings
Include the proper headers to fix warnings like:
libnfs-sync.c:1529:3: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
libnfs-zdr.c:506:2: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sys/time.h needs to be protected with an ifdef
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ross Lagerwall [Fri, 8 Aug 2014 19:14:44 +0000 (20:14 +0100)]
Map NFS3ERR_NOTEMPTY to ENOTEMPTY
Map NFS3ERR_NOTEMPTY to ENOTEMPTY rather than EEXIST. POSIX allows
either EEXIST or ENOTEMPTY for rmdir on a non-empty directory but
ENOTEMPTY is more explicit and in line with Linux, OS X, FreeBSD and
OpenBSD's behavior.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Ross Lagerwall [Sun, 27 Jul 2014 17:01:25 +0000 (18:01 +0100)]
libnfs.c: Follow symlinks during path resolution
Follow symlinks during path resolution. If the symlink points outside
the mount, -ENOENT is returned. This is slightly different behavior
from the in-kernel NFS client where symlinks pointing outside the mount
get resolved to local paths.
The algorithm for symlink resolution is simple and stupid. If a symlink
is encountered, the path is rewritten and path resolution begins again
from the root filehandle. A count is kept to prevent loops. This is
not particularly efficient but it is good enough for now.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Ross Lagerwall [Sun, 20 Jul 2014 20:39:06 +0000 (21:39 +0100)]
libnfs: Set as much stat information as possible
Set as much stat information as possible for stat, stat64, fstat and
readdir.
Fill in dev to the given fsid.
Fill in rdev to the given major and minor numbers.
Set the file type bits in the mode from the type returned by the server.
Set the number of blocks used based on the number of bytes used in
blocks of size 512 (which is what stat(2) uses), rounded up.
Fill in the nanosecond timestamps.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Ross Lagerwall [Thu, 17 Jul 2014 21:31:23 +0000 (22:31 +0100)]
libnfs.c: add nfs_create
Add a new family of functions, nfs_create, like nfs_creat but takes an
additional flags argument which allows extra flags like O_SYNC, O_EXCL
and O_APPEND to be specified.
Ronnie Sahlberg [Sun, 29 Jun 2014 21:57:45 +0000 (14:57 -0700)]
New version 1.9.4
New version of libnfs:
- IPv6 support
- Support for Portmapper version 3 and an example portmap client.
- Directory caching top make repeated opendir() calls faster
- Readahead support
- Build manpages for the utilities (==nfs-ls)
- Support for O_APPEND
- Rename the list macros to avoid collission on *BSD
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Peter Lieven [Mon, 23 Jun 2014 14:31:32 +0000 (16:31 +0200)]
add readahead support
This patch add support for an internal readahead machanism. The maximum readahead
size can be specified via URL parameter readahead. This should significantly
speed up small sequential reads.
Ronnie Sahlberg [Sun, 8 Jun 2014 16:45:22 +0000 (09:45 -0700)]
libnfs.c: always pass the attributes to the callback for recursive lookups
Always pass a fattr3 structure to the callbacks for the internal function
to perform recursive lookups : nfs_lookuppath_async().
This will allow us to access for example the mtime for an object before we
start performing any expensive functions.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Sun, 8 Jun 2014 14:21:43 +0000 (07:21 -0700)]
init.c: use list macro when removing pdus from the wait list
Use the macro when removing the pdus in the wait list from the queues.
Also make sure to remove them from the right queue, from waitqueue and not
the outqueue for PDUs we have already sent out.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Ronnie Sahlberg [Thu, 15 May 2014 02:04:43 +0000 (19:04 -0700)]
docs: add a prebuilt manpage to the distribution
Add a prebuilt manpage for nfs-ls and change the makefiles to not build the
manpage by default. This is because the manpages change rarely and this removes
the need for an internet connection when building the library.
(previously building the library required downloading a template from
sourceforge)
Update the README and mention that you now need to manually rebuild the
manpages if the manpage sources change.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>