Change readdir FSAL cookie from variable length to uint64_t

Signed-off-by: Amit Dror <amitd@infinidat.com>
Add constness to cache_inode_readdir_cb_t name param

Signed-off-by: Amit Dror <amitd@infinidat.com>
Remove unused export pointer from nfs3_readdirplus_cb_data

Signed-off-by: Amit Dror <amitd@infinidat.com>
Use NFS3_OK instead of NFS_OK (NFSv2)

Signed-off-by: Amit Dror <amitd@infinidat.com>
Make cache_inode_remove_impl() static and simplify locking conditions

Signed-off-by: Amit Dror <amitd@infinidat.com>
Keep directory's CACHE_INODE_TRUST_CONTENT flag on where possible

Signed-off-by: Amit Dror <amitd@infinidat.com>
Remove unused fsal_cookie from cache_inode_dir_entry_t

Signed-off-by: Amit Dror <amitd@infinidat.com>
Translate ERR_FSAL_ISDIR into CACHE_INODE_IS_A_DIRECTORY code

Signed-off-by: Amit Dror <amitd@infinidat.com>
Add cache_inode_refresh_attrs_locked()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Ease lock contention in cache_inode_remove()

Do not hold attr_lock and content_lock write locked for the whole operation.
Use cache_inode_access(), which takes read lock the attr_lock instead of write.
Use cache_inode_refresh_attrs() instead of doing ourselves.
Removed unreachable code (call to cih_remove_checked).
Merged cache_inode_remove_impl() into cache_inode_remove()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Fixed valgrind uninitialized warnings

In case nfs3_FhandleToCache returns NULL, do not check nfsstat3,
as it is invalid (and uninitialized)

Signed-off-by: Amit Dror <amitd@infinidat.com>
Use CACHE_INODE_NOT_A_DIRECTORY status where appropriate

Signed-off-by: Amit Dror <amitd@infinidat.com>
Add cache_inode_check_sticky()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Ease lock contention in cache_inode_link()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Ease some more locking, use cache_inode_check_sticky()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Ease lock contention in cache_inode_rename()

Use cache_inode_access() which works under attr_lock
Do not hold content_lock for src and dst dirs for the whole operation
Add sticky check for the destination
Use cache_inode_refresh_attrs_locked() for refresh

Signed-off-by: Amit Dror <amitd@infinidat.com>
Unify and add missing calls to cache_inode_put()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Remove redundant assignment to cache_status in cache_inode_refresh_attrs()

Signed-off-by: Amit Dror <amitd@infinidat.com>
Properly handle the case where files exists but type incorrect

Signed-off-by: Amit Dror <amitd@infinidat.com>
Rearrange code and bug fix in cache_inode_create()

Perform refresh for parent entry earlier.
Handle the case where FSAL insist the file exists when we try to
create it, but lookup couldn't find it, in this case return
CACHE_INODE_INCONSISTENT_ENTRY to retry.
Use cache_inode_put() instead of cache_inode_lru_unref()

Signed-off-by: Amit Dror <amitd@infinidat.com>