Commit Graph

292 Commits (master)

Author SHA1 Message Date
Vitaliy Filippov 45430b3c38 Add an opaque pointer argument to service_proc
Without this argument it's impossible to pass an object instance to procedure
callbacks which basically forces users to either use global variables or to
write additional boilerplate code and find object instances from rpc_context
pointer values.
2022-02-06 02:29:39 +03:00
Ronnie Sahlberg a48f019e05 New version 5.0.0
Multithread support for Linux and Windows
Fix NFS4 behavior of chmod/chown/utimes
Add marshalling / unmarshalling of various NFSv4.1 structures (but not 4.1 support)
PS3 support
PS2 EE support
Support escaped characters in the URL
Fix MINGW build

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-28 10:50:38 +10:00
Ronnie Sahlberg 29b4cea00f multithreading: make nfs_get_error() work for multithreaded applications
This mostly consists of creating one slave nfs_context  for each nfs
thread to track the error-string.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-28 10:38:32 +10:00
Ronnie Sahlberg f85c21755e nfs4: Use RELEASE_LOCKOWNER when we close a file
We create a new lock_owner for every open(), to reduce pressure on the
servers lock_owner cache  we can tell it that this lock_owner will not
be used again and it can drop it from the cache.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-05 16:41:34 +10:00
Ronnie Sahlberg 0550a5c83f nfs4 multithreading: create a new lock_owner for every single open()
This allows us to perform unlimited concurrent opens as we are longer
bound by rfc3530  8.1.5 which limits to only one active OPEN command
per lock_owner

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-05 16:18:11 +10:00
Ronnie Sahlberg 61e5863e46 nfsv4: fix multithreading for nfsv4
Some multi-stage operations in nfs v4 can not be interleaved
so add mutex to prevent them from running concurrently.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-05 13:10:16 +10:00
Ronnie Sahlberg 1716b14104 Write PDUs straight to the wire when the queue is empty
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2022-01-05 13:10:00 +10:00
Ronnie Sahlberg 630a80c056 WIN32: add multithreading support for windows 2022-01-02 13:02:31 +10:00
Ronnie Sahlberg 20b39fd251 PS2_EE: update to compile on latest ps2 sdk
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-10-15 18:14:18 +10:00
Ronnie Sahlberg f55637619e initial pthread support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-10-14 16:31:26 +10:00
Daniel Abrecht 939814826f Fix mingw build: add strndup implementation to win32_compat.c 2021-10-03 12:51:42 +00:00
Ronnie Sahlberg f965ec74cf ps2ee: PS2 EE support
Initial support for building a library for PS2 EmotionEngine

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2021-09-17 07:27:44 +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
Daniel Abrecht 4ae2f12b74 Define u_int in libnfs-zdr.h for mingw again
The typedef for u_int was removed in 172f46756e,
assuming that sys/types.h defines it. This doesn't seam to be the case on mingw.
2020-11-27 20:43:43 +01:00
Damian 901d4a0040 sys/time.h include clean-up (PS3 PPU) 2020-08-17 21:14:30 -03:00
Damian 1bafddb264 Include clean-up 2020-08-15 11:28:04 -03:00
Alan Somers 172f46756e Don't define u_int
It's usually defined by the platform in types.h or sys/types.h.
The compiler complains if libnfs redefines it.
2020-07-26 15:13:13 -06:00
Ronnie Sahlberg 03a47809cb nfs4.1: add marshalling of CREATE_SESSION command
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2020-06-08 12:34:22 +10:00
peak3d 74ac9b5e11 Implement mount_getexports_timeout 2020-06-04 16:42:48 +02:00
Dirk Meister 483be177fe Allocate larger buffer for write operations in NFS4
The NFS4 pwrite operations contains a memory corruption if a write
is large than 4KB. The reason is that the buffer allocated within
nfs4_compund_async has a size of 4K and it does not account
for the size of the write buffer. To fix this the patch
padds a rpc_allocate_ndu2 function which an additional parameter
as an extra hint for the allocation.
2020-05-18 20:57:06 -07:00
crusader-mike 9d5427bbd4 fixed few MSVC warnings; fixed missing exports 2019-10-09 17:08:10 -05:00
crusader-mike 6564abaa1f fixed CMake build on windows, few trivial fixes 2019-09-12 15:07:35 -05:00
Peter Lieven 68faa72c85 add LIBNFS_FEATURE_UMOUNT macro
Signed-off-by: Peter Lieven <pl@kamp.de>
2019-09-02 15:49:26 +02: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
snoe925 f1ba956a77
Avoid redefinition of EXTERN macro
If an EXTERN macro is present then use it.
2018-10-10 10:32:31 -05:00
Daniel Abrecht eab4eac275 Define MSG_NOSIGNAL in windows if it doesn't exist. Windows doesn't have signals like SIGPIPE, so defining the flag as 0 is probably fine. 2018-04-29 12:02:08 +00:00
Shreyas Siravara 1fff7707f2 Add & export a call to initialize the pagecache 2018-04-26 18:15:02 -07:00
Daniel Abrecht b3fd3ca7e4 Move win32/win32_compat.h to include/win32/win32_compat.h 2018-04-16 19:42:38 +00: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 4dda1f87a4 nfsv4: add support for utime()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-01-10 17:09:14 +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 09f8a621fb nfsv4: lock_owner is by client, not by filehandle
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2018-01-07 10:54:09 +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 2fcb14cf62 Fix typo in header file
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-10-30 07:44:40 +10:00
Ronnie Sahlberg 8489557694 NFSv4: add utimes/lutimes support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-09-03 06:25:55 +10:00
Ronnie Sahlberg 5ebd10f54c NFSv4: Add access()/access2()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-09-03 05:43:04 +10:00
Ronnie Sahlberg 4c6d19b3b8 NFSv4: Add support for chown/lchown/fchown
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-09-02 06:42:59 +10:00
Ronnie Sahlberg 6c034223fd NFSv4: Add support for chmod/lchmod/fchmod
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-09-01 14:02:43 +10:00
Ronnie Sahlberg c7655f90ca NFSv4: Add support for statvfs()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-27 07:56:19 +10:00
Ronnie Sahlberg 8f12f7f0a0 NFSv4: Add lseek() support.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-26 08:05:12 +10:00
Ronnie Sahlberg 73b81297e7 NFSv4: Add support for ftruncate()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-26 01:31:25 +10:00
Ronnie Sahlberg 80d3f48199 NFSv4: Add support for fsync()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-26 01:07:22 +10:00
Ronnie Sahlberg ebc2f0a6c2 NFSv3: Add support for open(O_CREAT)
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-25 18:55:25 +10:00
Ronnie Sahlberg 2b6216dd6f NFSv4: add nfs_truncate() support
Rework the open() flow so we can append a extra callback to be invoked
once the open has completed.
Use this new feature to implement both nfs_truncate() as well as simplify
open(O_TRUNC) support.

Later this can be used for other commands too that need to open a path
and do something.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-25 10:37:07 +10:00
Ronnie Sahlberg cea99f8ed5 NFSv4: Add support for opendir()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-20 09:08:46 +10:00
Ronnie Sahlberg bd95371005 NFSv4: Add support for mknod()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-15 20:05:47 +10:00
Ronnie Sahlberg de9da5689d NFSv4: Add rename() support.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-14 09:20:08 +10:00
Ronnie Sahlberg ffafa5fd9c NFSv4: add nfs_link() support.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-08 20:47:22 +10:00