Initial new source code drop for support of Protectier FSAL.

More Signed-Off-by lines to be added from the main developers.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Initial ganesha modifications for support of Protectier FSAL.

More Signed-Off-by lines to be added from the main developers.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix buffer overflow and file not found errors

This patch resolves some buffer over flow errors and also
some file not found errors encountered while testing drop5

The file not found errors occur because the memcmp should only
compare up to strlen(path) bytes instead of the entire m_name
buffer, since only "strlen(path)" bytes are valid, and also
because "path", being a char *, may not have FSI_HANDLE_SIZE bytes
allocated to it.  Also the m_name buffer is of size
PATH_MAX (4096) bytes, not FSI_HANDLE_SIZE bytes (32)

Also the first strncpy should be using FSI_HANDLE_SIZE not PATH_MAX
since we are copying to the m_handle buffer in this case

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Correct fd handling in PTFSAL_truncate

The file descriptor passed to PTFSAL_truncate is usually null
except in the case where the file to truncate has already been
opened and locked.  A non null descriptor should simply be
truncated, and a null descriptor should be opened, truncated
and closed.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fix cthon test 7a failure

Hin's cthon basic test 7a fix

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Remove FSAL_UP code in FSAL_PT

The current fsal up code in the pt fsal is causing a lot
of log flooding and is not needed for protecTIER.
This patch removes all FSAL_UP code in the FSAL_PT

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
LTC drop7.  This drop will get us passing connectathon "general"
case
Signed-off-by: Hin Lam <hincheuk@us.ibm.com>

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Updated fsi_ipc_ccl.h to be insync with libccl.a
Signed-off-by: Hin Lam <hincheuk@us.ibm.com>

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Multiple updates for FSAL_PT

Conslidate and clean up some code.  This patch adds a new helper
function "ptfsal_set_fsi_handle_data" to help clean up repeated
code.

Added multiple exports support for PT.
This new function also fills out the export path of the handle
which will allow multiple exports.

Use latest CCL which contains common mutes and log. The libccl.a
has been renamed to libccl4ganesha.so.  We also need to update
ganesha with the new header files from this shared library.
src/FSAL/fsi_ipc_common.h and src/FSAL/FSAL_PT/fsi_ipc_ccl.h
have been modified to mirror the same headers in the new shared
library.

Removed uneeded ccl source file src/FSAL/FSAL_PT/fsi_ipc_ccl.c.
It should not be part of the ganesha source.

We added -DGANESHA_ENV inside -CFLAG in configure.ac. This flag
tells the shared library that this is a ganesha server instead of
a samba server.  This flag will be written to the Makefile by
configure.ac

Signed-off-by: Jeff Huang <huangz@us.ibm.com>
-----------------------

v1->v2
Removed uneeded white space changes
Removed uneeded code that was only commented away
Clearified new stub function PTFSAL_GetMountRootFD
Added TODO for IP address work when it is available from upstream source
Expanded patch description

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Sync ganesha header files with shared lib files

This patch is being added to v2 of this branch because
the shared library has changed since the v1 branch

Some bugs were corrected in the libccl4ganesha.so and
the ganesha header files need to be updated to mirror
the new header files on the shared lib side.

Signed-off-by: Jeff Huang <huangz@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Log level fix for DCUT

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Remove GPFS Dependency

This patch removes the GPFS package dependency from the
PTFSAL.  The PT fsal was originally modeled after the GPFS fsal,
and some references to the gpfs libraries were inadvertently left
in some of the PT fsal routines.  The references were later found
when installing ganesha for PT on a clean box, and dependency
errors were encountered.

This patch removes the file FSAL_PT/fsal_lock.c.  This file only had
one function in it, PTFSAL_lock_op, and it needed to be removed.
The existing routine was filling out some gpfs structures,
but they were not being used for any functional purpose as they were in
the GPFSFSAL_lock_op routine.  Sense PT does not support locking right
now, the function and the file are removed, and the fsal_lock_op function
pointer is set to NULL.  It can be filled in properly when
PT is made to support locking at a later time.

This patch also removes the "attr_valid" and "attr_changed" variables
from the PTFSAL_setattrs.  These variables were initially used to
store GPFS specific attributes, and then used as parameters to another
GPFS function that is not present in the PT fsal.  The existing variables
were still referencing GPFS attributes, but sense they are not used
for anything, they are now simply removed.

GPFS header includes and library linkers are also removed.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
-----------
v1 -> v2
Removed some extra white space

v2->v3
Removed the entire FSAL_PT/fsal_lock.c sense it only had the
on function in it
Distribution version for rpm

Chandras patch for adding the dist version to the rpm filenames.
The version is also logged once when ganesha starts.

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Changed fsi_handle_struct to ccl_context_t in headers and functions in PT helper layer. Changed compile flag from GANESHA_ENV to GANESHA_CCL in configure.ac file. Added ACL supporting stuff to CCL.
Signed-off-by: Jeff Huang <huangz@us.ibm.com>
Modified the script so the start/stop won't check for
rpc.quotad and rpc.statd as they are not required for ProtecTIER.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
PT drop 06-03-2012

Updated dist version for next PT drop

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Remove quotad and statd from status script

Modified the init script so the status won't check for
rpc.quotad or rpc.statd. They are not required for ProtecTIER.
and have already been removed from the stop and start routines

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Formatted code to make each line less than or equal 80 characters. Aligned parameters in each function. Added mutex lock on accessing global variables. Fixed strncpy so that strings are NULL terminated. Fixed review comments from PT code review.
Signed-off-by: Jeff Huang <huangz@us.ibm.com>
Updates for rebase

Added required updates to rebase PT branch
  - New IO flag FSAL_O_SYNC
  - All refrences to stuff_alloc.h removed
  - Mem_Free renamed to gsh_free
  - Mem_Alloc_Label renamed to gsh_malloc
  - Mem_Errno becomes ENOMEM
  - Added FSAL_write parameter: p_context
  - Removed configs no longer supported

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
TA config updates

Merge main.conf and exports.conf into a single config, and
add in changes from the TA config.  Move default log file
from config to the init

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>