Purge the dirent tree when a remove of the dir fails with ENOTEMPTY

The dirent cache is out of sync for some non-ganesha reason. Purge the
dirent tree to force a re-populate

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix Use After Free.
Ported from 1.5.x: 690d68e9789f33024514504279496f019f48d322

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Signed-off-by: suhrud <supatank@in.ibm.com>
Fix up-call to update inode.
Fix XFS FSAL regression with symlinks.

This only applies to XFS exports on older (pre- 2.6.39) Linux kernels.
The libhandle open_by_handle function and syscall will only open regular
files and directories.  All others return an EPERM error.  In order to
do full support, symlinks would have to be considered "unopenable" files
and extra obj handle space would have to be added for the parent directory
handle and name. Since symlinks are more plentiful in an export than
special files and UNIX sockets, this is significant memory overhead.

We work around this by noticing that open_by_handle() returns the EPERM in this
case where FreeBSD and Linux open_by_handle_at don't.  This turns a setattr
into a NOP and getattr returns whatever was cached at lookup time.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
changed Use_Getattr_Directory_Invalidation to 0
Ported from 1.5.x: 3efa36184166f8b83d1787aefecf70d82b8458bd

Signed-off-by: suhrud <supatank@in.ibm.com>
Changed Nb_Worker from 128 to 512
Ported from 1.5.x: a15038ddb492c3146ae57c171c490126ef6b67e1

Signed-off-by: suhrud <supatank@in.ibm.com>
Convert nlm_block_data_to_export to use get_gsh_export

Deprecates last use of nfs_Get_export_by_id()
Also remove unnecessary pexport and ppexport args in NLM

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove nfs_Get_export_by_id()

This had become unsafe in the new export mgr world.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove sbd_block_data_to_fsal_context callback in state_block_data_t

One more cleanup.  This callback doesn't seem to be used anyway.  It also
had a questionable typedef pattern of defining the function proto in two
separate places...

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Fix Use After Free.
Ported from 1.5.x: 690d68e9789f33024514504279496f019f48d322

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Signed-off-by: suhrud <supatank@in.ibm.com>
Porting updates for Dev_34

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Minor log clean up

Remove a duplicate function (macro actually).

When changing all log levels by -N or by setting COMPONENT_ALL from
environment or SNMP, ignore the components that have special purpose.

Read the environment for COMPONENT_XYZ variables after processing
the -N and -L command line options.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>

Conflicts:

	src/MainNFSD/nfs_init.c
Add config block for log

Var names are the log component name (such as COMPONENT_FSAL).
The COMPONENT_ part is optional. COMPONENT_ is still required
in the environment.

Var values are the log levels (such as NIV_DEBUG). The NIV_
part is optional (and is now optional for environment and
SNMP set values.

Ignore case for components and level values (except component
must still be in all caps in environment).

Signed-off-by: Frank Filz <ffilz@us.ibm.com>

Conflicts:

	src/Log/log_functions.c
	src/include/log.h
changed Use_Getattr_Directory_Invalidation to 0
Ported from 1.5.x: 3efa36184166f8b83d1787aefecf70d82b8458bd

Signed-off-by: suhrud <supatank@in.ibm.com>
Changed Nb_Worker from 128 to 512
Ported from 1.5.x: a15038ddb492c3146ae57c171c490126ef6b67e1

Signed-off-by: suhrud <supatank@in.ibm.com>
Populate post_op_attr with updated attributes after commit.

Ported from: 75eae985f14c0236beabf0fa3727469f289ec8f4

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Need content lock in write mode for open/close

Ported from: 6a850a0baeaebe5c354393197f8f2beac2571d19

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Rong zeng <rongzeng@us.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Remove wcc pre-attrs form Write and Commit Replies

Given that Ganesha need to make multiple calls to underlying filesystem
to perform write and then to get attributes, there is no way we can provide
accurate/atomic wcc pre-attrs. Because of this, the attr times on the client
side are not matching, resulting in invalidating client's cache. Removing
wcc pre-attrs in the Write and Commit replies, allows client to accurately
follow close-to-open semantics and keep the client cache sane.

Ported from: cc3af75fa4e8bd1668f0a967f6e7fb0a03261b20

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Update porting doc to indicate what I have completed

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Tighten up the V4 compound processing loop

Simplfy code the processing loops, eliminate unnessary code and make op
processing table driven.  Change op function protos to make this possible.

Signed-off-by: Jim Lieb <jlieb@panasas.com>