Commit Graph

148 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 630a80c056 WIN32: add multithreading support for windows 2022-01-02 13:02:31 +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 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
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
Shreyas Siravara 1fff7707f2 Add & export a call to initialize the pagecache 2018-04-26 18:15:02 -07: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 2fcb14cf62 Fix typo in header file
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-10-30 07:44:40 +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 65a0110476 NFSv4: Add support for open(O_CREAT)
Add support for O_CREAT for NFSv4. Note, it is not implemented for NFSv3.
While it creates files we still need to add plumbing to get umask
implemented or else all files created will have mode 0.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-06 18:43:28 +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 65de83140a NFSv4: Add support (and tests) for open(O_APPEND)
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-03 20:25:59 +10:00
Ronnie Sahlberg 2ce8890458 NFSv4: Add open(O_SYNC) support
Also update close() so we only send a COMMIT if there is still
unstaged data written.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-30 09:44:31 +10:00
Ronnie Sahlberg 42d14779b7 NFSv4: Add support for open(O_TRUNC)
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-30 08:36:18 +10:00
Ronnie Sahlberg 0d9dd0ee44 NFSv4 Add support for nfs_open() nfs_fstat64() nfs_close()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-26 14:26:29 +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 c9e546ba3c Reformat libnfs.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-03 11:07:58 +10:00
Ronnie Sahlberg ad6f95d9f9 More reformatting of libnfs-raw.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-01 09:07:28 +10:00
Ronnie Sahlberg db6d0836f4 TESTS: add tests for symlink/readlink
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-01 08:40:59 +10:00
Ronnie Sahlberg 0e0bb3fb34 NFSv4: Move all v3 specific code into its own nfsv3.c file
Split out the nfsv3 code from libnfs.c into its own file.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-30 13:48:59 +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 55144f237b libnfs-raw.h: Reformat the file and remove EXTERN
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-29 15:57:05 +10:00
Ronnie Sahlberg 173ad2b1f3 Change how auto-reconnect works
For NFS sessions, change the autoreconnect options to be :
-1:  (default) retry connectiong back to the server forever. Just like
normal NFS clients do.
0: Do not attempt reconnecting at all. Immediately fail and return an
error back to the application on session loss.
>=1: Retry connecting to the server this many times before giving up.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-31 19:46:18 -07:00
Ronnie Sahlberg 79d1dc5ad7 Merge branch 'issues-212' of https://github.com/earlchew/libnfs into earlchew-issues-212
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-10 21:26:57 -07:00
Earl Chew ef8c67e81e Provide documentation for autoreconnect option
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-10 20:29:00 -07:00
Ronnie Sahlberg 0e37be0339 Document the new url argument to disable autoreconnect
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-10 18:28:51 -07: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 973d368867 Merge pull request #194 from earlchew/issues-187
nfs_readlink2: Return symlink without incurring ENAMETOOLONG
2017-05-09 14:55:27 -07:00
Earl Chew e74846219a nfs_readlink2: Return symlink without incurring ENAMETOOLONG
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-08 21:56:50 -07:00
Earl Chew e788078e20 Revert "nfs_readlink2: Return symlink without incurring ENAMETOOLONG"
This reverts commit 1af36b4c77.

Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-08 21:55:54 -07:00
Ronnie Sahlberg ea3ee73e23 Merge pull request #192 from earlchew/issue-191
nfs_open: Support O_NOFOLLOW
2017-05-08 21:00:55 -07:00
Ronnie Sahlberg 2589086ce5 Merge pull request #193 from earlchew/issues-189
nfs_mkdir2: Include permissions when creating a new directory
2017-05-08 20:52:55 -07:00
Ronnie Sahlberg b5c5d5901e Add support for rpc timeouts to the async interface
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-08 18:38:42 -07:00