FSAL_GLUSTER: rework getattrs() to use supported/requested ATTR_*

Add ATTR_ACL to GLUSTERFS_SUPPORTED_ATTRIBUTES and
GLUSTERFS_SETTABLE_ATTRIBUTES. These defines are used when a handle is
constructed by calling fs_supported_attrs(). Afterwards, it is possible
for to change the attrlist->mask to request only specific attributes.

While reviewing the usage of ATTR_* and XATTR_* flags, it seems nicer to
use the FSAL_*_MASK() defines that are intended for modifying the mask.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
Acked-by: Soumya Koduri <skoduri@redhat.com>
Ached-by: Daniel Gryniewicz <dang@cohortfs.com>
Merge remote-tracking branch 'nixpanic/fsal_gluster/perf/acl-attr_v2.2-dev-18.1' into next

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Replace/merge state_status_t with Ganesha Unified Status

Strict hierarchy of sal_data.h and sal_functions.h
* sal_functions.h is now only called from .c
* Move forward declarations above #includes in sal_data.h,
  to improve circular dependency processing

Fix related includes.
- Remove unused nfs_exports.h from sal_functions.h
- Remove nfs_proto_functions.h from sal_data.h,
  fixing circular dependency!
- Do not include 9p.h for one typedef in sal_data.h,
  changed typedefs to defines and moved them into 9p_types.h,
  fixing circular dependency!

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Replace/merge cache_inode_status_t with Ganesha Unified Status

Refactor cache_inode.h forward declarations.
* Move some forward declarations above #includes,
  and resolve forward declarations near end of file,
  to improve circular dependency processing
+ Move entry_export_map after typedef struct cache_entry_t
  to avoid redundant forward declaration

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Move most definitions from fsal.h to fsal_types.h

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Move externs and functions down hierarchy to fsal.h

+ op_ctx and functions from fsal_types.h
  - root_op_export_options, should be extern!
  - root_op_export_set, should be extern!
+ fsal management functions from fsal_api.h
+ stray pnfs_fsal[FSAL_ID_COUNT] array from fsal_pnfs.h
  - should be extern!

* Move req_op_context from fsal_types.h to fsal_api.h
  (down hierarchy where used by functions).
+ append fsal_module *fsal_module for future ds-only use.

* Remove sal_data.h (and others) from fsal_up.h
+ move local use definitions to fsal_up_top.c,
  fixing circular dependency!

* Update a few includes matching these changes
+ inexplicably missing include <pthread> in common_utils.h
+ missing include common_utils.h in FSAL/commonlib.c
+ missing include common_utils.h in FSAL/FSAL_VFS/xattrs.c
+ wrong fsal_types.h should be ganesha_types.h (or ganesha_rpc.h)
  in gsh_config.h

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Acked-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Restructure hierarchy of nfs_* headers.

* nfs_core.h is primarily called directly from .c
- definitions formerly dependent on nfs_proto_functions.h
  and nfs_exports.h moved up the hierarchy to compound_data.h,
  fixing circular dependency!

* nfs_exports.h is now only called from .c
- Compound data structs moved up the hierarchy to compound_data.h

* nfs_proto_functions.h is now only called from .c
- Typedefs and structs moved up the hierarchy to compound_data.h

Coordinated changes with previous reorganizing of fsal.h, etc.

Repaired various instances of headers without proper includes;
these merely have worked by serendipitous order in .c files.

mount.h was autogenerated, and requires several headers to compile;
rather than scattered through the code (found some mistakes),
use existing nfs23.h via compound_data.h (as .c files are updated).

Updated numerous .c files missing the correct includes.

s/compound_data.h/nfs_proto_data.h/ (Matt, per Frank)

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Add default GPFS config files,
and include them in the RPM

Signed-off-by: Poornima Gupte <poornima.gupte@in.ibm.com>
Reviewed-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Remove duplicate function declarations

in nfs_proto_functions.h

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Acked-by: Malahal Naineni <malahal@us.ibm.com>
Modify config.txt to say that read delegations are default in GPFS FSAL.

Since commit 5feb1b4fcd397b3066edc952a7eaa79278514e67 enabled read
delegations by default for GPFS, config.txt is modified to reflect the
same.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
pycheckpatch script to run checkpatch.pl on a list of commits

The script takes same arguments as "git rev-list". With an optional "-a"
argument, it lists all commits with pass/fail status.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix nfs3_write to sync writes when requested

Signed-off-by: Allison Henderson <achender@vnet.linux.ibm.com>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Reorganize fsal_api.h

!  minor version not incremented per Frank.  He will update.

* Divide pNFS DS (servers) from DS handles (files/objects).
+ allows more than one handle per server.
+ allows more than one server per export.
+ disentangle vectors from export (for ds-only).

* structures follow function (operations) definitions.
+ vectors now have prefixes (m_ops, exp_ops, obj_ops).
+ vectors now included in structure allocations:
++ removing unnecessary alloc & frees.
++ speeding every operation call (by one pointer).
++ reducing register pressure (fewer pointers).

Build against Lustre 2.6, on Centos 6.5.

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Fix ZFS build with ZFS_PREFIX.

The full invocation is to update CMAKE_C_FLAGS with the prefix
values, in FSAL/FSAL_ZFS/CMakeLists.txt.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Configure pNFS Data Servers

Signed-off-by: William Allen Simpson <bill@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Replace FSAL_ESTALE, KILLED, DEAD_ENTRY, CACHE_INODE STATE errors with ESTALE

These three errors all mean the same thing, so just use CACHE_INODE_ESTALE
and STATE_ESTALE.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>

Conflicts:
	src/include/cache_inode.h
	src/include/sal_data.h
Cosmetic. s/ganesha_<foo>.h/gsh_<foo>.h/.

Also ganesha_lttng.  Per Frank, only one of these two forms
should be used.  Take the shorter one.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Non-Trivial Merge remote-tracking branch 'linuxbox2/ds-only-ff-mb' into next

Fixed compile issue in FSAL/FSAL_GLUSTER/gluster_internal.c.

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

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix checkpatch errors

Checkpatch run on patches can't catch some issues, so every once in a while,
we use src/scripts/runcp.sh to checkpatch.pl on the entire tree.

This patch fixes the errors that have accumulated.

A new complex macro has been introduced, requiring a new file to have
complex macro warnings ignored.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>