Commit Graph

911 Commits (04cdb72bb1a147c2d732dcca5f87e5e3bd2e2252)

Author SHA1 Message Date
Ronnie Sahlberg a2b37349fa Update README about capability support and fix some typos.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-11-06 15:16:31 -08:00
Ronnie Sahlberg 85760ec4d6 Fixes to build nfs-ls and nfs-cp on win32
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-11-06 14:44:03 -08:00
Ronnie Sahlberg 2edbd14779 New version 1.11.0
- Reduce the number of memory allocations in the ZDR layer.
 - Check both seconds and nanoseconds field when validating dir cache.
 - Invalidate the dir cache immediately if we do something that would cause
   it to become stale, such as adding/removing objects from the cache.
 - Add options to enable/disable dir caching.
 - Discard readahead cache on [p]write and truncate.
 - Android fixes
 - Windows fixes
 - Support timeouts for sync functions
 - Add an internal pagecache
 - Add nfs_rewinddir(), nfs_seekdir() and nfs_telldir()
 - Fix crash in nfs_truncate()
 - Fix segfault that can trigger if we rpc_disconnect() during the mount.
 - Add support to bind to a specific interface (linux only)

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-10-09 11:23:11 -07:00
Ronnie Sahlberg 235cb45e69 Conditionally define _GNU_SOURCE
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-10-09 11:23:11 -07:00
sahlberg 048e7737d9 WIN32: map open to _open. Same for lseek, read, write 2016-09-21 15:47:19 -07:00
sahlberg 8c8e615e54 nfs-cp change uint64_t to size_t for the read/write wrappers 2016-09-21 11:35:59 -07:00
sahlberg 2ff6131244 nfs-cp remove unused variable ret 2016-09-21 11:27:27 -07:00
sahlberg 232c9da7cf WIN32: conditionally remove some stat fields that are not present under win32 2016-09-21 11:24:00 -07:00
sahlberg 84c894c8a4 nfs-cp: add casts between the nfs stat elements and the normal stat elements 2016-09-21 11:17:09 -07:00
sahlberg 72bcd185db WIN32: remove the nfsclient-* examples from the project 2016-09-21 11:05:20 -07:00
sahlberg adc46ec1b0 WIN32: Change examples -> utils for nfs-ls and nfs-cp project filter 2016-09-21 11:02:53 -07:00
sahlberg dc8e10df07 WIN32: compiler warnings 2016-09-21 10:49:59 -07:00
sahlberg 6b6d6084d0 WIN32: Fix types for max_watch_len st_dev and st_ino 2016-09-21 09:45:55 -07:00
sahlberg 3d1351bf82 WIN32: make pagecache ttl of type time_t
We both compare and compute using the ttl value with variables of
type time_t. Thus is makes most sense to have ttl as time_t too.
2016-09-21 09:32:45 -07:00
Ronnie Sahlberg c000bf2acc WIN32: Add include paths for include/nfsc for x64 builds
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-20 18:42:54 -07:00
Ronnie Sahlberg 2601b42496 WIN32: remove references to onc-rpc
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>
2016-09-20 18:42:17 -07:00
Ronnie Sahlberg 9a65270510 WIN32: Add portmap to the include paths
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-20 18:17:24 -07:00
Ronnie Sahlberg b70d5b6dac WIN32: No need to run rpcgen.exe anymore. Remove from project.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-20 18:09:25 -07:00
Ronnie Sahlberg fc2501dc45 Merge branch 'master' of github.com:sahlberg/libnfs 2016-09-20 17:45:37 -07:00
sahlberg e53758fc43 compiler warnings 2016-09-20 17:45:05 -07:00
sahlberg 6d3e9814fa more win32 fixes 2016-09-20 17:44:42 -07:00
sahlberg c672db8351 WIN32: Use size_t for the rpc fragment size 2016-09-20 17:43:53 -07:00
sahlberg 563c112343 WIN32: fix compile warnings in nfs.c 2016-09-20 17:43:26 -07:00
Ronnie Sahlberg 53f634468c WIN32: Update the path to nfs-{cp|ls}.c
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-20 17:42:46 -07:00
sahlberg b741a44f81 WIN32: Add portmap to more include directives 2016-09-20 17:40:18 -07:00
sahlberg 4c3d809e07 WIN32: Don't call assert() before all variables are declared.
VisualStudioOnline does not like when you intermingle variable
definitions and code so move the assert() to after the variables
are all declared.
2016-09-20 17:37:48 -07:00
sahlberg 799abde68d WIN32: win32 does not have IFNAMSIZ 2016-09-20 17:36:59 -07:00
Ronnie Sahlberg 6cde2aca64 Conditionally include unistd.h from libnfs-zdr.c as some platforms lack this header
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-20 17:36:19 -07:00
Ronnie Sahlberg b0c3cb3415 Conditionally include unistd.h from libnfs-zdr.c a some platforms lack this header
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-19 18:36:59 -07:00
Chris 5f75307a36 Added the ability to bind to a specific interface with the
`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`.
2016-09-19 18:31:49 -07:00
Ronnie Sahlberg fac3a95453 Make rpc_disconnect() a no-op if the session is already disconnected
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>
2016-07-05 13:18:17 -07:00
Ronnie Sahlberg 28e01e67b1 Add seekdir and telldir support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-07-05 10:14:49 -07:00
Ronnie Sahlberg cdbcdfd736 Update some comment and fix typos
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-07-05 09:59:30 -07:00
Ronnie Sahlberg d9e75d56fa Add comment that nfs_rewinddir will never block.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-21 19:30:00 -07:00
Ronnie Sahlberg 4388570dc4 Merge pull request #151 from benoit-canet/rewinddir
nfs_rewinddir: introduce additional nfs_rewinddir()
2016-06-21 19:28:20 -07:00
Ronnie Sahlberg 4cc09b972a Fix crash in nfs_truncate due to dereference of uninitialized data
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-21 19:25:27 -07:00
Benoît Canet 352fb5bb70 nfs_rewinddir: introduce additional nfs_rewinddir()
Introduce the nfs_rewinddir() utility function used
to cancel previous nfs_readdir() side effects.

Signed-off-by: Benoît Canet <benoit@scylladb.com>
2016-06-07 08:36:27 +02:00
Ronnie Sahlberg cdd1643c76 Merge pull request #150 from plieven/for_upstream
For upstream
2016-06-03 05:07:45 -07:00
Peter Lieven 10546da322 pagecache: define hash constant as UL
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-06-03 13:46:48 +02:00
Ronnie Sahlberg f9455e5ba5 gcc 5.3 does not allow casting a char * to any longer, so cast via void *
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-02 09:20:54 +02:00
Peter Lieven 9cb49494c7 pdu: drop the rpc->encodebuf
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>
2016-06-02 09:12:53 +02:00
Peter Lieven 21c466254a libnfs: avoid a bounce buffer in pread if possible
there are cases where we do not need the bounce buffer. So avoid
the overhead of malloc, memcpy and free.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-31 22:03:02 +02:00
Peter Lieven 14492d5c65 pagecache: allow readahead and pagecache options to coexist
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>
2016-05-31 12:05:20 +02:00
Peter Lieven 5a660d5afc libnfs-sync: make send_nfsd_probes portable
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-31 12:03:10 +02:00
Peter Lieven 36d687cdbc pagecache: avoid time() syscall if the cache has no ttl
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-31 08:34:17 +02:00
Ronnie Sahlberg 654243473a Merge pull request #148 from plieven/fix_hang
Fix deadlock once again
2016-05-30 09:27:05 -07:00
Peter Lieven 453db33f07 pdu: fix potential overflow in rpc_get_pdu_size
(size & 0x7fffffff) + 4 can overflow an int returning
a negative number.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-30 16:13:39 +02:00
Peter Lieven 295057aba4 socket: really handle count == 0 in rpc_read_from_socket
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>
2016-05-30 16:13:32 +02:00
Ronnie Sahlberg 00d9ba1563 Remove rpc_set_tcp_syncnt from the nfs-cat utility
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-05-17 18:38:30 -07:00
Ronnie Sahlberg cef46f4803 Merge pull request #146 from plieven/pagecache_v2
Pagecache v2
2016-05-17 06:18:26 -07:00