Commit Graph

721 Commits (9cb49494c7b5ef25ccd9ae5e2e5ddc57e4d0c1cd)

Author SHA1 Message Date
Ronnie Sahlberg be243cfa9b Merge pull request #82 from plieven/readahead
add readahead support
2014-06-29 14:41:28 -07: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 a0c4ea7d9f update copyright bilerplates also in generated files
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-13 17:03:35 -07:00
Ronnie Sahlberg 390ff38ad1 libnfs.c: add nlink to nfsdirent so we can get it for 'free'
update the nfs-ls utility to just use nfsdirent as is instead of having to
stat the files.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 11:40:35 -07:00
Ronnie Sahlberg 56e96539ef libnfs.c: add a simple dircache to libnfs
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 11:24:18 -07:00
Ronnie Sahlberg 20379f03fc libnfs.c: always pass the attributes to the callback for recursive lookups
Always pass a fattr3 structure to the callbacks for the internal function
to perform recursive lookups : nfs_lookuppath_async().
This will allow us to access for example the mtime for an object before we
start performing any expensive functions.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 11:24:09 -07:00
Ronnie Sahlberg c63ba81eeb win32_errnowrapper.h: add licence boilerplate
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 07:54:45 -07:00
Ronnie Sahlberg 9f0b180a2b aros: add licence to aros_compat.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 07:53:03 -07:00
Ronnie Sahlberg 2f5c161b44 proto files: add a simplified bsd licence to the dot-x files
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 07:51:38 -07:00
Ronnie Sahlberg f0888d12d9 init.c: fixup the mangled lgplv2.1 boilerplate
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 07:34:54 -07:00
Ronnie Sahlberg 1a6ec3ee76 init.c: use list macro when removing pdus from the wait list
Use the macro when removing the pdus in the wait list from the queues.
Also make sure to remove them from the right queue, from waitqueue and not
the outqueue for PDUs we have already sent out.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-06-08 07:21:43 -07:00
Ronnie Sahlberg a1911b0144 Merge pull request #79 from plieven/readahead
socket: fix broken connect for non broadcast traffic
2014-06-08 06:33:09 -07:00
Peter Lieven 7a750aea1c socket: fix broken connect for non broadcast traffic
commit 1c1e09a completely broke connects for non broadcast
traffic since it forgot to copy the server address into
the socket_storage struct.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-08 14:20:12 +02:00
Ronnie Sahlberg 8a52596b74 slist.h: Change SLIST_* to LIBNFS_LIST_* to avoid name clash on *BSD
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-05-14 19:11:03 -07:00
Ronnie Sahlberg 8e003243fb docs: add a prebuilt manpage to the distribution
Add a prebuilt manpage for nfs-ls and change the makefiles to not build the
manpage by default. This is because the manpages change rarely and this removes
the need for an internet connection when building the library.
(previously building the library required downloading a template from
sourceforge)

Update the README and mention that you now need to manually rebuild the
manpages if the manpage sources change.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-05-14 19:04:43 -07:00
Ronnie Sahlberg 475f1f2808 Merge pull request #74 from alexsn/master
nfs-ls: Fix crash when called with no arguments
2014-04-19 11:38:11 -07:00
Alex Snast 76ead54bd3 nfs-ls: Fix crash when called with no arguments
When called with no argument we jump to 'finished' label
after which nfs_destroy_url is called with *url having
some garbage stack value.
2014-04-19 19:35:49 +03:00
Ronnie Sahlberg 548e2bea4b nfs_open: add support for O_APPEND 2014-04-18 09:32:01 -07:00
Ronnie Sahlberg a87bb233a8 Merge branch 'xid-hash' 2014-04-10 19:59:28 -07:00
Ronnie Sahlberg 0275da678b Merge pull request #71 from Memphiz/nolinger
[socket] - disable linger by setting SO_LINGER to 0 seconds
2014-04-10 18:21:13 -07:00
Ronnie Sahlberg 06b64cc6c2 Merge pull request #72 from Memphiz/fixosxcompile
[osx] - fix compile
2014-04-10 18:20:52 -07:00
Memphiz bd2f43c8a6 [osx] - fix compile 2014-04-10 20:35:44 +02:00
Memphiz 74b037ec46 [socket] - disable linger by setting SO_LINGER to 0 seconds 2014-04-10 20:34:11 +02:00
Arne Redlich 567a94d937 Fix the file position handling of the read and write calls
Since the interface is modelled after the libc calls we should try to match
their behaviour to avoid unpleasant surprises:
* read / write (sync and async flavours) update the file position
* pread / pwrite (sync and async flavours) do not update the file position
.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-04-03 18:05:32 -07:00
Arne Redlich 9e6ac3d4ee libnfs-sync: nfs_{read,write}: use their _async counterparts internally
Previously nfs_read and nfs_write used to use nfs_pread and nfs_pwrite respectively.
In preparation of getting the file position handling right this has to be detangled.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-04-03 18:04:41 -07:00
Arne Redlich 1f1b6cb0a7 nfs_lseek{,_async}: allow negative offsets and guard against file positions < 0
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-04-03 18:03:21 -07:00
Mark Hills 63f36a0923 Track waiting requests in a hash table, by xid
NFS servers can respond to requests in any order, and they do. In our
tests there is also some clustering to the responses; it could be
because eg. requests are served synchronously if the data is in the cache.

Introduce a hash table so that we are able to find the pdu quickly in
all cases, assuming random distribution of the responses.
2014-04-03 17:52:21 -07:00
Mark Hills d46c3d622b Ensure the next pointer is correct
Fixes a bug where the next pointer was not being explicitly set. We
were ok much of the time due to zero-filled memory, and also we need
this if the same pdu is re-queued.
2014-04-03 17:51:56 -07:00
Mark Hills aec45c6274 Optimisations to the pdu queues
When making many concurrent requests (as is likely in any performance
criticial application), the use of SLIST_REMOVE and SLIST_ADD_END are
a severe bottleneck because of their linear search.

I considered using a double-linked list but it was unnecessary to
allocate the additional memory for each list entry.

Instead, continue to use a single-linked list but retain:

* a pointer to the end of the list; and
* a pointer to the previous entry during a linear search.

The former would makes append operations O(1) time, and the latter
does the same for removal. We can do this because removal only happens
within the linear search, and there is no random access to the queue.
2014-04-03 17:51:04 -07:00
Ronnie Sahlberg 2c0f57fa33 RPM: Fix the specfile 2014-03-23 09:54:21 -07:00
Ronnie Sahlberg 54bafab240 INCLUDES: Don't install libnfs-provate.h or slist.h 2014-03-23 09:54:05 -07:00
Ronnie Sahlberg d3b289284a AUTOTOOLS: Add Makefile.am to utils 2014-03-23 09:18:31 -07:00
Ronnie Sahlberg 7440522d8a SPECFILE: Fix syntax error in the spec file 2014-03-23 09:18:13 -07:00
Ronnie Sahlberg c7ddf2e5cb NFS-LS: Build nfs-ls as utils and make it install under bin 2014-03-21 18:31:05 -07:00
Ronnie Sahlberg ca3bb55c65 DOC: Add manpage for nfs-ls 2014-03-21 18:15:40 -07:00
Ronnie Sahlberg a562a7f5fb examples/Makefile.am Remove stuff we do not need 2014-03-21 17:33:14 -07:00
Ronnie Sahlberg f3684c0857 PORTMAP: Add some comments about the origin of definitions 2014-03-20 17:32:19 -07:00
Arne Redlich d5f7880641 nfs_normalize_path: don't strip trailing slash from "/"
Otherwise end up with a null string which is not permitted (RFC 1813, 3.2;
the code checks for it right after the now fixed nullification of "/").

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-03-20 16:58:32 -07:00
Arne Redlich b644665077 nfs_opendir2_cb: plug potential memory leak
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-03-20 16:52:53 -07:00
Ronnie Sahlberg 1f8134ebe4 PORTMAP client: Pass length as sockaddr_storage, not sockaddr_in6 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg ea20b4ec24 PORTMAP client: Parse and print the actual sockaddr that UADDR2TADDR returned 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg b3525a9439 IPV6: Update the README and specify ipv6 is supported 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 75ec99d519 PORTMAP client: Add commands to send v3 SET/UNSET 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg 24f45c5452 PORTMAP: Rename pmap3_getaddr_result to pmap3_string_result 2014-03-19 18:25:50 -07: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 6c60e2822f IPv6: If we use IPv6 then we need to use PMAP v3 GETADDR 2014-03-19 18:25:50 -07:00
Ronnie Sahlberg d731e94cfa PORTMAP: Add support for SET UNSET procedures 2014-03-19 18:25:50 -07:00