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.
gettid() is not guaranteed to be universally available
so replace this with calling the syscall directly for
building on Linux with Multithreading enabled.
Windows already use a native call for this so it should be unaffected
but other unix-like systems with pthread support will need to have
a replacement function here as well.
This is todo for later for non-linux pthread platforms.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
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>
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>
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>
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>
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>
We must make sure that we prepare and process all the returned data
before we wake the thread that is waiting for the i/o to complete
or else we will have a race between waking the thread and copying
the returned data in the service thread.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Otherwise it segfaults inside any string decoding inside rpc_process_call()
as it doesn't zero the allocated memory, so libnfs_zdr_string() may receive
non-zero *strp which is very easy to reproduce by writing a simple NFS server
example using libnfs :-)
We need to allow users to specify escaped characters as part of the 'path'
field of a URL.
For example, '?' is used to separate the part and the optional list of
arguments.
IF 'path' contains a '?' character then that must be escaped as %3F.
So that libnfs will be able to tell it apart from the '?' separator.
I.e.
nfs://127.0.0.1/my?path/?version=4
must be escaped as
nfs://127.0.0.1/my%3Fpath/?version=4
before passed to any of the URL parsing functions.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>