Retry blocking lock if not granted.
FSAL API: refcount is used as a signed int32, fix its type

Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Merge remote-tracking branch 'marc/relock' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Merge remote-tracking branch 'martinetd/next' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add new glist_insert_sorted function to ganesha_list.h

This function uses a comparer routine to insert an element
into a sorted list

Signed-off-by: Allison Henderson <achender@vnet.linux.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Jim Lieb <lieb@sea-troll.net>
Added a dbus broadcast service to the dbus thread
Other threads my add function callbacks to be invoked
by this service

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Signed-off-by: Allison Henderson <achender@vnet.linux.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Jim Lieb <lieb@sea-troll.net>
Added new heartbeat message to dbus broadcast service

Added new configs to enable heartbeat and set interval
Also make the new heartbeat an introspective dbus signal

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Signed-off-by: Allison Henderson <achender@vnet.linux.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Jim Lieb <lieb@sea-troll.net>
Fix usage of PATH_MAX

PATH_MAX includes the NUL byte. So any definition of the form
"char path[MAX_PATH+1]" is incorrect! It should just be "char
path[PATH_MAX]". Changed such definitions!

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add support to dbus interface for reporting delegation stats.

Format Corrections for check patch:
Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Consolidated glib dbus python scripts.

Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Added export_revert

which will be called when export_commit failed to clean up the following
 - node added to export_by_id avl tree
 - export added to exportlist
 - exp_work list element to mount_work list

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Check for export refcount before freeing export_stats

check for refcnt in free_export() before proceeding as it might have been
freed by put_gsh_export.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Add internal error to config_error_type

And use it for cache_inode layer errors

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Display proper error on export stanza path errors

init_export_root checks for the export stanza path but the final error
displayed is (resource alloc) errors but it must be invalid param value.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Simple format correction

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reviewed-by: Frank S. Filz <ffilzlnx@mindspring.com>
Merge remote-tracking branch 'ganltc/for-V2.2-dev-11' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
V2.2-dev-11

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
NFSv4: Cache NFSv4 open stateids for the lease period after close

NFSv4 rfc states that -

 --->
 9.10.1. Close and Retention of State Information

 Since a CLOSE operation requests deallocation of a stateid, dealing
 with retransmission of the CLOSE, may pose special difficulties,
 since the state information, which normally would be used to
 determine the state of the open file being designated, might be
 deallocated, resulting in an NFS4ERR_BAD_STATEID error.
 Servers may deal with this problem in a number of ways. To provide
 the greatest degree assurance that the protocol is being used
 properly, a server should, rather than deallocate the stateid, mark
 it as close-pending, and retain the stateid with this status, until
 later deallocation. In this way, a retransmitted CLOSE can be
 recognized since the stateid points to state information with this
 distinctive status, so that it can be handled without error.
 When adopting this strategy, a server should retain the state
 information until the earliest of:

 o Another validly sequenced request for the same open-owner, that is not a retransmission.

 o The time that an open-owner is freed by the server due to period with no activity.

 o All locks for the client are freed as a result of a SETCLIENTID.
 <---

 So, to provide greater assurance and detect replayed CLOSE ops, we chose
 to extend stateid lifetime. Also retaining state_ids extend the life of
 open_owner as well. This will help us in reusing the same open_owner and avoid
 open_confirmation incase of reOPEN ops issued by the client within the lease period.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>