We have not needed an external onc-rpc library for libnfs in a long
long time since the re-write to use a builtin XDR replacement (ZDR).
Remove all references from the project files to my old port of a onc-rpc
library to win32.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
`nfs_set_interface` and `rpc_set_interface` APIs, or via the
NFS URL `if=<interface>` parameter. This feature requires
`root` permissions.
NOTE: This has only been compiled and tested on Ubuntu 14.04. It's
unlikely that it'll work on other platforms without modification,
particularly around the inclusion of <net/if.h> and IFNAMSIZ define
in `libnfs-private.h`.
This addresses a bug causing a segfault if we destroy the nfs context/
disconnect the session while the mount_8_cb callbacks for checking the
filehandle for nested mountpoints are still in flight.
Issue found and reported by doktorstick
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
the only call thar really needs a big encodebuf is WRITE. So give each
PDU its private encodebuf. This avoids the need to memcpy the data from
the static rpc->encodebuf to the pdu->outdata.data.
Signed-off-by: Peter Lieven <pl@kamp.de>
before this setting readahead would always modify the pagecache,
but it might be desireable to have a greater pagecache and only
a reasonable small readahead.
Signed-off-by: Peter Lieven <pl@kamp.de>
in commit b319b97 the check for count == 0 was introduced, but
it was accidently reverted in commit f681a2c if pdu->inpos < 4.
This patch fixes this issue resulting in deadlocks and removes
the somewhat redundant receive code.
Signed-off-by: Peter Lieven <pl@kamp.de>
this adds support for a simple read cache to avoid unnecassary request
to the NFS storage. libnfs by design cannot benefit from the kernel page
cache and suffers from performance penalties in some cases when compared
with a file accessed via kernel NFS.
This patch exposes 3 new API calls:
void nfs_set_pagecache(struct nfs_context *nfs, uint32_t v);
void nfs_set_pagecache_ttl(struct nfs_context *nfs, uint32_t v);
void nfs_pagecache_invalidate(struct nfs_context *nfs, struct nfsfh *nfsfh);
As well as the two new URL parameters pagecache and pagecache_ttl.
pagecache is defined in number of pages where a page is always NFS_BLKSIZE (4kB).
pagecache_ttl takes the page timeout in seconds where 0 means infinite.
Signed-off-by: Peter Lieven <pl@kamp.de>
If we are decoding a zdr string and the called did not provide
a pointer/buffer for us. We can just return the string to the rx buffer
immediately and avoid calling libnfs_zdr_opaque().
This avoids wasting cpu cycles on running a memcpy where src and dst buffers
are the same.
Add support to timeout sync functions.
Add a field to the rpc context to specify the timeout for functions.
Currently only sync functions support a timeout.