Commit Graph

242 Commits (352325169ce93187c205d1ebfb7b2c2ce605b78f)

Author SHA1 Message Date
Ronnie Sahlberg 352325169c NFSv4: Add support for nfs_unlink()
This function is identical to nfs_rmdir() so create a common
function that we call from both unlink and rmdir.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-06 19:24:05 +10:00
Ronnie Sahlberg 9854c0d574 NFSv4: Add support for open_create() by plumbing it into open(O_CREAT)
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-08-06 19:15:04 +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 61e071d448 NFSv4: Add support for nfs_[p]write()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-29 19:52:41 +10:00
Ronnie Sahlberg 5c2d989887 NFSv4: Add support for readlink()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-26 14:26:29 +10:00
Ronnie Sahlberg f3211e9be5 NFSv4 Add support for symlink()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-26 14:26:29 +10:00
Ronnie Sahlberg dce044ab53 NFSv4: Add support for read() and pread()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-26 14:26:29 +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 93fbecd7c1 NFSv4 Add support for nfs_rmdir()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-14 07:04:28 +10:00
Ronnie Sahlberg 8a9fceb725 NFSv4: Add support for nfs_mkdir2()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-13 23:04:35 +10:00
Ronnie Sahlberg 3ced39f567 Rework the NFSv4 path lookup framework so it handles symlinks properly.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-13 18:22:27 +10:00
Ronnie Sahlberg df94ae931a pdu->timeout needs to be uint64_t
pdu->timeout is the timeout for for the pdu using the unix epoch but
expressed in ms, not seconds.
As such it must be 64 bit as on 32 bit we would have already wrapped the
timer.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 17:08:17 +10:00
Ronnie Sahlberg 419e196979 rpc->timeout does not need to be 64 bit
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 16:46:24 +10:00
Ronnie Sahlberg dc9669abd5 Fix compiler warnings about cast from char* -> uint32_t*
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 16:33:55 +10:00
Ronnie Sahlberg 5a6865c7ab Change the paths for the nfs includes from libnfs-private.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 14:34:29 +10:00
Ronnie Sahlberg 4cb34e2c9a Merge branch 'nfsv4' 2017-07-08 09:58:11 +10:00
Chris Richards fb1efbe51c Increased resolution of PDU timeout from seconds to milliseconds 2017-07-08 09:47:51 +10:00
Ronnie Sahlberg 2b764fa926 NFSv4: Add support for nfs_stat64()
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-07-08 07:41:11 +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
Ronnie Sahlberg 2db0878396 Use clock_gettime(CLOCK_MONOTONIC_COARSE) if/when available
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-10 18:11:00 -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
Ronnie Sahlberg 4abadb7943 Remove old declarations of nfs_get|set_timeout
The new ones in the previous patch are much nicer and have better
documentation.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-05 08:41:06 -07:00
Ronnie Sahlberg f2fffe858f Merge pull request #196 from earlchew/issues-195
libnfs: Export nfs_set_timeout() and nfs_get_timeout()
2017-05-05 08:34:52 -07:00
Earl Chew b01776cf94 libnfs: Export nfs_set_timeout() and nfs_get_timeout()
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-05 08:02:29 -07:00
Earl Chew 1af36b4c77 nfs_readlink2: Return symlink without incurring ENAMETOOLONG
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-05 07:57:28 -07:00
Earl Chew adcfda60fa nfs_mkdir2: Include permissions when creating a new directory
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-05 07:55:09 -07:00
Earl Chew 9bd2ceddd3 nfs_open: Support O_NOFOLLOW
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
2017-05-05 07:50:35 -07:00
Ronnie Sahlberg 70df81c16a Merge pull request #173 from rosslagerwall/reconnect-retries
socket: Limit reconnect retries to 10
2017-03-02 17:07:13 -08:00
Daniel Abrecht 50bf03bc66 Some changes to resolve conflicts with dokan_fuse 2017-02-26 18:14:37 +00:00