Fix GPFS config defauls.
Fixes for NFSv4.2 as a result of the Cthon testing.
Make some debug logging refinements

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

Add CONFIG_LIST_BITS and CONFIG_ENUM_BITS: These config items allow a
list or enum to occupy a range of bits in a uint32_t, there can be other
config items that occupy other bits (CONF_ITEM_BOOLBIT works just fine
with this without any change). These items have a mask that defines the
set of bits belonging to this option. These items overload CONFIG_LIST
and CONFIG_ENUM (with those having a mask of UINT32_MAX).

Add some debug.

For CONFIG_ENUM, the default and comnfigured values must be set with |=
instead of = for the bit fields to work right.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Improve use of MaxOffsetWrite and MaxOffsetRead to not use EXPORT_OPTION values

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Don't use EXPORT_OPTION_PSEUDO anymore

We can just test export->pseudo != NULL

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Deprecate unused EXPORT_OPTION values

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Rearrange EXPORT_OPTION values and add EXPORT_OPTION_ROOT_SQUASH

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Improve debug in support/exports.c

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Don't cast from void * in support/exports.c

The compiler allows assigning void * to typed pointer without a cast.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Deprecate Allow_Root_Access, Make_All_Users_Anonymous, Anonymous_root_uid options

Please use Squash and Anon_Uid instead.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Correct max and default for MaxOffsetWrite and MaxOffsetRead

The max and default for these should be UINT64_MAX.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Correct tupe and max for Anon_Uid and Anon_Gid

These are uint32_t (but we allow small negative numbers to allow for the
tradition of specifying NFS Nobody user as -2).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Use CONF_ITEM_LIST_BITS and CONF_ITEM_ENUM_BITS for export/client permissions

Using CONF_ITEM_LIST_BITS and CONF_ITEM_ENUM_BITS allows the various
export/client permissions options to work correctly given that many
of the options occupy several bits in the uint32_t.

Also swap a few items between list and enum:

CLIENT SecType becomes a LIST rather than an ENUM.

EXPORT Access_Type becomes an ENUM rather than a LIST.

EXPORT MFS_Protocols becomes a LIST rather than a MAND_LIST (there is
now a default).

Also change defaults for many items:

Access_Type default changes from None to
EXPORT_OPTION_RW_ACCESS | EXPORT_OPTION_MD_ACCESS

NFS_Protocols changed from None to
EXPORT_OPTION_PROTOCOLS (3, 4)

SecType changes from None to
EXPORT_OPTION_AUTH_NONE | EXPORT_OPTION_AUTH_UNIX

Transport_Protocols changes from None to
EXPORT_OPTION_TRANSPORTS

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add Manage_Gids to EXPORT and CLIENT and Use_Deleg to EXPORT

These options may have got dropped during config rewrite.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Make client lsit a little more efficient

getaddrinfo could return up to three entries for each IP address, one
for each of SOCK_DGRAM, SOCK_STREAM, and SOCK_RAW. We can at least
get rid of the SOCK_RAW one, however a better way of managing IP
addresses in client lists should be implemented.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add option set flags for CONFIG_FSID, CONFIG_LIST, CONFIG_ENUM, and CONFIG_BOOLBIT

Add new macros CONF_ITEM_LIST_BITS_SET. CONF_ITEM_BOOLBIT_SET,
CONF_ITEM_ENUM_BITS_SET and CONF_ITEM_FSID_SET to use this new
capability.

Also change macro used for maximum in FSID (from ULLONG_MAX to
UINT64_MAX).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add CONF_ANONID and CONF_ITEM_ANONID

uid_t and gid_t are uint32_t, however, convention has always been to
specify the anonymous id as -2. This new configure type allows setting
the uint32_t with a value from the range of -2147483648 to 4294967295.

It also utilizes the new "option set" capabilities.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
nfs4_read_recov_clids need to handle (skip) malformat.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Enable config of export perms for EXPORT_DEFAULTS, EXPORT, and CLIENT

Along the way, deprecate some unused options and unify so all perms
options are set at all levels.

A new config block, EXPORT_DEFAULTS allows setting export permissions
to be used for all exports if not otherwise specified. This utilizes
the new capability of the config parser to track if an option has been
specified or not.

To establish the effective export permissions, each option is
effectively considered in turn (however all bit field options are
actually considered in parallell). If the option has been set in the
applicable CLIENT block, that value will be used, otherwise if set
in the EXPORT block, that value will be used, otherwise if set in
the EXPORT_DEFAULTS block, that value will be used, and finally, if
no configuration block has provided a value, then the code default
value will be used.

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