Commit Graph

51 Commits (master)

Author SHA1 Message Date
Ronnie Sahlberg 630a80c056 WIN32: add multithreading support for windows 2022-01-02 13:02:31 +10:00
Ronnie Sahlberg efa9085cfa add support for nfsv3 getacl
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-12-31 11:42:48 +10:00
Ronnie Sahlberg f55637619e initial pthread support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-10-14 16:31:26 +10:00
Ronnie Sahlberg 965b1914ef Allow setting max read/write size from the api
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-08-10 16:29:42 +10:00
Ronnie Sahlberg cdb377532a acl: add support and helpers to read nfsv4 acls
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-07-17 20:11:56 +10:00
Ronnie Sahlberg 9e63589591 add nfs_umount() which will unregister the client from the mount daemon
This is only implemented for v3 since there is no mount protocol in v4.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-12-29 13:56:29 +10:00
Ronnie Sahlberg 48a559cb47 Add nfs_statvfs64()
Add a new function nfs_statvfs64() that returns a struct nfs_statvfs_64
where all fields are uint64_t.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-12-26 13:33:38 +10:00
Ronnie Sahlberg b54fc96e00 Add nfsport/mountport arguments
Add two arguments to set which port to use for MOUNT (only used in NFSv3)
as well as for the NFS protocols.
When set to non-zero libnfs will connect directly to that port and bypass
the use of portmapper completely.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-04-08 14:36:37 +10:00
Ronnie Sahlberg 50068b8432 NFSv4: add support for fcntl locking
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-01-08 14:38:30 +10:00
Ronnie Sahlberg 208dd08039 NFSv4: add lockf emulation
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-01-07 08:35:42 +10:00
Ronnie Sahlberg 0ce4917afd nfs_open2(): Add a new nfs_open2() function that takes a mode argument.
Pass mode all the way down to nfs*_open_async() but we do not yet have any
plumbing to actually use it. That will come later as we implement O_CREAT
support.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-06 16:02:39 +10:00
Ronnie Sahlberg 56194deeee NFS4: Add support to nfs_mount()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-06 10:04:17 +10:00
Ronnie Sahlberg 4a6012ea74 NFSv4: Add support for selecting version via url argument or nfs_set_version
This only allow selecting the version for the context.
There is still no real v4 support and all I/O is still using v3.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-30 13:48:59 +10:00
Ronnie Sahlberg 367ef3b189 Merge pull request #213 from earlchew/issues-212
Allow autoreconnect to be disabled
2017-05-10 18:13:56 -07:00
Earl Chew 5e43d0a92f Allow autoreconnect to be disabled
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-09 21:43:31 -07:00
Ronnie Sahlberg 13c253673b We do not need an async version of readlink2
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-09 14:56:44 -07:00
Ronnie Sahlberg 519686356c Export the nfs_readlink2[_async] symbols from the win32/64 DLL
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-09 14:53:12 -07:00
Ronnie Sahlberg 15c7b4c33a Add mkdir2() to the symbols we export for win32/64
and will at some point restrict export to for .so libraries as well.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-08 20:54:36 -07:00
Ronnie Sahlberg d6a21b2bda Make rpc_set{g|u}id() public
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-30 17:47:18 -08:00
Ronnie Sahlberg eb6b39125c Initial rpc server support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-12-17 10:44:12 -08:00
Ronnie Sahlberg 853474d387 Add NFSv4 protocol definitions
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-12-17 10:44:12 -08:00
Ronnie Sahlberg 6f27daf6d4 Create a generic RPC NULL function
This allows us to use the NULL function for any arbitrary
program/version from rpc_connect_program() instead of the hardcoded support
for mount v3 and nfs v3

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-11-27 12:50:06 -08:00
Peter Lieven 3e2847226f libnfs: add a pagecache
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>
2016-05-13 12:03:40 +02:00
Kuldeep Kumar 83d1005c6b sync apis with timeout values
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.
2016-03-14 19:04:53 -07:00
Ronnie Sahlberg 458f6c2be5 Add option and method to disable/enable directory caching
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-07 16:06:00 -08:00
Peter Lieven 9bff07490f add basic support for setting a log level
only logging to stderr is supported at the moment. Per default
there is no output. Its possible to set the log level via
debug url parameter.

Example:
 nfs-ls nfs://127.0.0.1/export?debug=2

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-06-23 08:55:11 +02:00
Peter Lieven 3ca2aac9a4 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.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-23 16:31:32 +02:00
Ronnie Sahlberg 29258a73c0 PORTMAP: Add support for v3 TADDR2UADDR 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 729266a796 PORTMAP: Add PMAP v3 UADDR2TADDR support 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg b71f7e8291 PORTMAP: Add support for PORTMAP v3 CALLIT 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 5245608a65 PORTMAP: Add v3 GETTIME support 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 7fbedfdefd PORTMAP: Add support for PORTMAP v3 GETADDR 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 0f0e352f49 PORTMAP: Rename the functions in PMAP to PMAP2 to desribe the version of PMAP we use.
Future patches will add PMAP3 which we will need for IPv6 support.
2014-03-19 18:25:49 -07:00
Ronnie Sahlberg 8ae943f608 PORTMAP: Add support for V3 DUMP command
This implements the missing procedure from Issue #65
2014-03-16 14:17:06 -07:00
Ronnie Sahlberg 479302f729 Add a new nfs_stat64() function that operates on a always-64-bit stat structure 2014-03-04 19:40:05 -08:00
Ronnie Sahlberg 6ec481d3fa Add a rpc_set_fd() fucntion which can be used to swap the underlying socket file descriptor
This is mainly needed when having to track and control the file descriptors that are used by libnfs, for example when trying to emulate dup2() ontop
of libnfs.
2014-02-02 08:45:21 -08:00
Ronnie Sahlberg f893b680f2 Add support for chdir and getcwd
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
    // -> /
    /./ -> /
    ^/../ -> error
    ^[^/] -> error
    /string/../ -> /
    /$ -> \0
    /.$ -> \0
    ^/..$ -> error
    /string/..$ -> /

Update the path lookup function to allow specifying relative paths based on
cwd for all functions.
2014-01-30 20:06:57 -08:00
Ronnie Sahlberg 0df47959c4 Revert "Add support for chdir and getcwd"
This reverts commit fb6f315257.
2014-01-30 18:26:39 -08:00
Ronnie Sahlberg fb6f315257 Add support for chdir and getcwd
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
    // -> /
    /./ -> /
    ^/../ -> error
    ^[^/] -> error
    /string/../ -> /
    /$ -> \0
    /.$ -> \0
    ^/..$ -> error
    /string/..$ -> /

Update the path lookup function to allow specifying relative paths based on
cwd for all functions.
2014-01-27 20:54:59 -08:00
Ronnie Sahlberg 9180287b27 Export the three new nfs_set_* functions from the windows library/dll 2014-01-13 06:30:43 -08:00
Ronnie Sahlberg b2a4b99ee9 Add the url parsing functions to libnfs-win32.def 2013-12-25 16:29:00 -08:00
Ronnie Sahlberg 04e9034165 MOUNT: Add RPC support for MOUNTv1 2013-12-24 12:20:41 -08:00
Ronnie Sahlberg f38aacf8c9 Add NFSv2 RPC support 2013-12-24 11:28:56 -08:00
Ronnie Sahlberg 463d59bf8e NFS: Add new function signatures for rpc_nfs3_ that takes *3args arguments
to match the XDR.

Leave the existing ad-hoc rpc_nfs_* functions for backward compatibility.
2013-12-24 11:16:21 -08:00
Ronnie Sahlberg 21668dcef4 Add missing symbols to libnfs-win32.def and make them EXTERN 2013-12-24 08:54:28 -08:00
Memphiz 292e2d9097 [win32] - add projects for examples to the solution and make them compile (all compile but nfsclient-bcast) 2013-05-29 18:41:31 +02:00
Ronnie Sahlberg 1ec6b50aef Add MKNOD command support
Add support for raw nfs3 mknod  and sync and async posixlike api
2011-11-27 14:08:24 +11:00
Memphiz fcc42bfe85 [win32] - completed win32 port 2011-09-12 19:53:33 +02:00
Memphiz 7f7993883c [add] - win32 compat stuff 2011-09-03 14:51:54 +10:00
Ronnie Sahlberg db4ea5dd80 Revert "Rename libnfs.def to libnfs-win32.def"
This reverts commit a3d6cf111e.
2011-09-03 14:51:48 +10:00