Commits on Jul 5, 2016
  1. Make rpc_disconnect() a no-op if the session is already disconnected

    This addresses a bug causing a segfault if we destroy the nfs context/
    disconnect the session while the mount_8_cb callbacks for checking the
    filehandle for nested mountpoints are still in flight.
    
    Issue found and reported by doktorstick
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Jul 5, 2016
  2. Add seekdir and telldir support

    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Jul 5, 2016
  3. Update some comment and fix typos

    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Jul 5, 2016
Commits on Jun 22, 2016
  1. Add comment that nfs_rewinddir will never block.

    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Jun 21, 2016
  2. Merge pull request #151 from benoit-canet/rewinddir

    nfs_rewinddir: introduce additional nfs_rewinddir()
    committed on GitHub Jun 21, 2016
  3. Fix crash in nfs_truncate due to dereference of uninitialized data

    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Jun 21, 2016
Commits on Jun 7, 2016
  1. @benoit-canet

    nfs_rewinddir: introduce additional nfs_rewinddir()

    Introduce the nfs_rewinddir() utility function used
    to cancel previous nfs_readdir() side effects.
    
    Signed-off-by: Benoît Canet <benoit@scylladb.com>
    benoit-canet committed Jun 7, 2016
Commits on Jun 3, 2016
  1. Merge pull request #150 from plieven/for_upstream

    For upstream
    committed Jun 3, 2016
  2. @plieven

    pagecache: define hash constant as UL

    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed Jun 2, 2016
Commits on Jun 2, 2016
  1. @plieven

    gcc 5.3 does not allow casting a char * to any longer, so cast via vo…

    …id *
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed with plieven Jun 1, 2016
  2. @plieven

    pdu: drop the rpc->encodebuf

    the only call thar really needs a big encodebuf is WRITE. So give each
    PDU its private encodebuf. This avoids the need to memcpy the data from
    the static rpc->encodebuf to the pdu->outdata.data.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed Jun 2, 2016
Commits on May 31, 2016
  1. @plieven

    libnfs: avoid a bounce buffer in pread if possible

    there are cases where we do not need the bounce buffer. So avoid
    the overhead of malloc, memcpy and free.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 31, 2016
  2. @plieven

    pagecache: allow readahead and pagecache options to coexist

    before this setting readahead would always modify the pagecache,
    but it might be desireable to have a greater pagecache and only
    a reasonable small readahead.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 31, 2016
  3. @plieven

    libnfs-sync: make send_nfsd_probes portable

    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 31, 2016
  4. @plieven

    pagecache: avoid time() syscall if the cache has no ttl

    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 31, 2016
Commits on May 30, 2016
  1. Merge pull request #148 from plieven/fix_hang

    Fix deadlock once again
    committed May 30, 2016
  2. @plieven

    pdu: fix potential overflow in rpc_get_pdu_size

    (size & 0x7fffffff) + 4 can overflow an int returning
    a negative number.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 30, 2016
  3. @plieven

    socket: really handle count == 0 in rpc_read_from_socket

    in commit b319b97 the check for count == 0 was introduced, but
    it was accidently reverted in commit f681a2c if pdu->inpos < 4.
    
    This patch fixes this issue resulting in deadlocks and removes
    the somewhat redundant receive code.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 30, 2016
Commits on May 18, 2016
  1. Remove rpc_set_tcp_syncnt from the nfs-cat utility

    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed May 17, 2016
Commits on May 17, 2016
  1. Merge pull request #146 from plieven/pagecache_v2

    Pagecache v2
    committed May 17, 2016
  2. @plieven

    libnfs: fix compiler warnings on 32bit systems

    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 17, 2016
Commits on May 13, 2016
  1. @plieven

    libnfs: add a pagecache

    this adds support for a simple read cache to avoid unnecassary request
    to the NFS storage. libnfs by design cannot benefit from the kernel page
    cache and suffers from performance penalties in some cases when compared
    with a file accessed via kernel NFS.
    
    This patch exposes 3 new API calls:
     void nfs_set_pagecache(struct nfs_context *nfs, uint32_t v);
     void nfs_set_pagecache_ttl(struct nfs_context *nfs, uint32_t v);
     void nfs_pagecache_invalidate(struct nfs_context *nfs, struct nfsfh *nfsfh);
    
    As well as the two new URL parameters pagecache and pagecache_ttl.
    
    pagecache is defined in number of pages where a page is always NFS_BLKSIZE (4kB).
    pagecache_ttl takes the page timeout in seconds where 0 means infinite.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 13, 2016
  2. @plieven

    configure.ac: really build with -Werror by default

    Signed-off-by: Peter Lieven <pl@kamp.de>
    plieven committed May 13, 2016
Commits on Apr 28, 2016
  1. Add win32 magics to example programs

    Some examples lack win32 socket magic. Add it.
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Apr 27, 2016
Commits on Mar 22, 2016
  1. zdr string decode: don't memcpy when src and dst pointers are the same

    If we are decoding a zdr string and the called did not provide
    a pointer/buffer for us. We can just return the string to the rx buffer
    immediately and avoid calling libnfs_zdr_opaque().
    
    This avoids wasting cpu cycles on running a memcpy where src and dst buffers
    are the same.
    committed Mar 21, 2016
Commits on Mar 15, 2016
  1. Merge pull request #143 from jbkempf/android_ndk_statvfs

    Android: only redefine statvfs if it is not already defined
    committed Mar 14, 2016
  2. @kkloginid

    sync apis with timeout values

    Add support to timeout sync functions.
    Add a field to the rpc context to specify the timeout for functions.
    Currently only sync functions support a timeout.
    kkloginid committed with Mar 2, 2016
  3. @doj

    fix spelling errors.

    doj committed with Feb 10, 2016
Commits on Mar 10, 2016
  1. @jbkempf

    Android: only redefine statvfs if it is not already defined

    It is defined with recent platforms version 21 and more recent
    jbkempf committed Mar 11, 2016
Commits on Feb 25, 2016
  1. Discard readahead cache on pwrite and truncate too

    Reported by Dirk Jagdmann
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Feb 24, 2016
Commits on Feb 14, 2016
  1. Merge pull request #139 from doj/master

    fix spelling errors.
    committed Feb 13, 2016
Commits on Feb 11, 2016
  1. link/rename uses two directories. We must drop both drom the dircache.

    Link and Rename are special since they will process two (often) different
    directories. We need to drop both directories from the cache and also do so
    BEFORE we clear/steal the data->fh.data.data_val pointer.
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
    committed Feb 10, 2016
Commits on Feb 10, 2016
  1. @doj

    fix spelling errors.

    doj committed Feb 10, 2016