Fix coverity defects
CIDs: 53513, 53512, 53507, 53501, 53502
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Fix pseudofs readdir method

readdir method of pseudofs expects that the first direntry should have
index 2. This may not be true if we remove export entries due to remove
export dbus command! Use avltree_first() and skip entries that are
before the seek location.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
Handle EXPORT_OPTION_COMMIT if FSAL_O_SYNC is not honored

FSAL_O_SYNC is not always honored, so just setting FSAL_O_SYNC has no
guaranty that this write will be a stable write. Instead, we pretend
that the caller asked for the stable write!

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Marc Eshel <eshel@us.ibm.com>
Fix delayed_get_work() erroneously returning delayed_unemployed

delayed_get_work() seems to work only when there is one node in the AVL
tree (used as heap)! In the current implementation, a node can exist
without any tasks (after the tasks of a node are completed). It returns
delayed_unemployed when all tasks in the first node are emptied even if
the heap has other tasks. This commits makes sure that there is no node
without any tasks and returns delayed_unemployed only if the tree is
empty.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
Use LIST_EMPTY, LIST_FIRST macros insread of lh_first field

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Dominique Martinet <dominique.martinet@cea.fr>
CID30211: fix locking issue in nfs_release_nlm_state
Need to asynchroniously invoke nlm state release to
avoid releasing lock while traversing the nsm client RBT tree.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Fix more coverity defects
CIDs: 53514 53510 53508 53506 53505 53504 53503
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>