Difference between revisions of "User talk:Debankur"

(Download)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=='''DESCRIPTION  '''==
+
==Description==
  
==='' <u><b> LEASES (analogous to OpLocks or NFSv4 delegations) </b></u> ''===
+
The "General Parallel File System" by IBM is a clustered file system with POSIX semantics. To make Samba interoperable with GPFS, IBM has provided a library including important calls for Samba is included beginning with the GPFS v3.1 PTF6. .
  
Unless Samba oplocks are turned off (they are on by default) dual Windows-UNIX access to the same file (or multiple Samba servers) may result in the file data being corrupted (until this support is provided).  A performance improvement is expected, but not quantified.  As some vendors rely on NFS and some on Samba or even FTP, we need to get a common mechanism for communication and coordination in place.
+
It contains function calls in the following areas:
  
'' <b><u>Summary:</u></b> ''
+
===Leases (analogous to OpLocks or NFSv4 delegations)===
  
On Linux, GPFS would provide (and Samba would exploit) a user-level interface to acquire/return leases and a method  to notify Samba when they need to be revoked.  GPFS would not grant write leases.  For AIX, Samba would code to the VCM client API.
+
Unless Samba oplocks are turned off (they are on by default) dual Windows-UNIX access to the same file (or multiple Samba servers) may result in the file data being corrupted (until this support is provided). The gpfs_set_lease() and gpfs_get_lease() functions allow Samba to set leases in the filesystem which are visibly for UNIX processes and on all nodes the filesystem is mounted on.
  
What happens if oplocks are turned off?  What will the result be then, if you try to access the file from
+
===Share modes (Equivalent of Open Locks and NFSv4 reservations)===
dual Windows-UNIX, or multiple SAMBA servers?
 
 
Clearly, multiple SAMBA servers is to be avoided for a mixed Windows-UNIX environment, multi-write environment.
 
(We can tell people to try to avoid that, where possible - but it's unlikely to be very possible.) 
 
 
 
Lets take a small subset:
 
all Windows clients that wish to write are attached to the same SAMBA server, and there is no UNIX access
 
at the same time:  Does that sub-scenario work correctly, or is there still a chance of file data corruption
 
there too?
 
 
 
Turning oplocks off will result in a performance degradation. With oplocks enabled, the problem is not just
 
Windows-UNIX but corruption may happen when multiple Samba servers are involved (even without any UNIX sharing).
 
Two Samba servers writing to the same file may corrupt it.  One Samba server writing and one reading will not
 
corrupt the data, but may give incorrect results since Samba does not coordinate its oplocks with other Samba
 
servers.
 
 
 
 
 
==='' <b><u> SHARE MODES (Equivalent of Open Locks and NFSv4 reservations) </u></b> ''===
 
  
 
Without this support, the implementation of multiple Samba servers (or dual Windows-UNIX access to the same file) may result in the file data being corrupted.  Needed to avoid impacting commands, like file deletion while ingesting and even to establish the possibility of proper collaboration.
 
Without this support, the implementation of multiple Samba servers (or dual Windows-UNIX access to the same file) may result in the file data being corrupted.  Needed to avoid impacting commands, like file deletion while ingesting and even to establish the possibility of proper collaboration.
  
'' <b><u>Summary:</u></b> ''
+
With the gpfs_set_share() function available to Samba, Samba can provide the 1-second wait using the asynchronous character of the interface.
  
On Linux, GPFS needs to provide an asynchronous interface to its kxGetShare function.  Samba would provide the 1-second wait using the asynchronous character of the interface.  AIX support requires that Samba code to the VCM client API.
+
===ACLs===
  
 +
GPFS ACLs are currently available in POSIX format via the Linux getxattr inode operation.  Although equivalent for NFSv4 ACLs available, they are not provided by any shipped distro of linux. With gpfs_getacl() and gpfs_setacl() Samba can now get and set NFSv4 ACLs in GPFS on Linux.
  
==='' <b><u> ACLs :</u></b>===
+
==Files==
  
GPFS ACLs are currently available in POSIX format via the Linux getxattr inode operation. Linux does not provide any equivalent for NFSv4 ACLs.  GPFS could expand its ACL API to provide Samba access to its ACLs (both types).
+
  - gpfs_gpl.h
 +
  - libgpfs_gpl.so
  
 +
==Function Calls==
  
=='''FUNCTION CALLS : '''==
+
===gpfs_getacl()===
  
===''<b> gpfs_getacl() </b>''===
+
''FUNCTION''
 
 
''FUNCTION : ''
 
  
 
Retrieves the ACL information for a file.
 
Retrieves the ACL information for a file.
This function, together with gpfs_putacl, is intended for use by a backup program to save (gpfs_getacl) and   restore (gpfs_putacl) the ACL information for a file. The flags parameter must be zero (reserved for future use). The '''aclP''' parameter must point to a buffer mapped by the ''gpfs_opaque_acl_t'' structure. The first four bytes of the buffer must contain its total size.
+
This function, together with gpfs_putacl, is intended for use by a backup program to save (gpfs_getacl) and restore (gpfs_putacl) the ACL information for a file. The flags parameter must be zero (reserved for future use). The '''aclP''' parameter must point to a buffer mapped by the ''gpfs_opaque_acl_t'' structure. The first four bytes of the buffer must contain its total size.
  
 
Note: The use of gpfs_fgetattrs/gpfs_fputattrs is preferred.
 
Note: The use of gpfs_fgetattrs/gpfs_fputattrs is preferred.
Line 84: Line 67:
  
  
===''      <b>  gpfs_set_share() </b> ===
+
===gpfs_set_share()===
  
 
''FUNCTION :''
 
''FUNCTION :''
Line 121: Line 104:
  
  
===''    <b>    gpfs_set_lease() </b> ===
+
===gpfs_set_lease()===
  
 
''FUNCTION :''
 
''FUNCTION :''
Line 150: Line 133:
  
  
===''    <b>  gpfs_get_lease() </b>===
+
===gpfs_get_lease()===
  
 
''FUNCTION :''
 
''FUNCTION :''
Line 168: Line 151:
 
     EINVAL
 
     EINVAL
  
 +
==Download==
  
=='''DOWNLOAD LINK ''' ==
+
http://www14.software.ibm.com/webapp/set2/sas/f/gpfs/home.html
 
 
http://www14.software.ibm.com/webapp/set2/sas/f/gpfs/download/home.html
 
  
=='''LICENSE :'''==
+
==License==
  
 
Copyright (C) 2006 International Business Machines
 
Copyright (C) 2006 International Business Machines

Latest revision as of 09:28, 16 December 2008

Description

The "General Parallel File System" by IBM is a clustered file system with POSIX semantics. To make Samba interoperable with GPFS, IBM has provided a library including important calls for Samba is included beginning with the GPFS v3.1 PTF6. .

It contains function calls in the following areas:

Leases (analogous to OpLocks or NFSv4 delegations)

Unless Samba oplocks are turned off (they are on by default) dual Windows-UNIX access to the same file (or multiple Samba servers) may result in the file data being corrupted (until this support is provided). The gpfs_set_lease() and gpfs_get_lease() functions allow Samba to set leases in the filesystem which are visibly for UNIX processes and on all nodes the filesystem is mounted on.

Share modes (Equivalent of Open Locks and NFSv4 reservations)

Without this support, the implementation of multiple Samba servers (or dual Windows-UNIX access to the same file) may result in the file data being corrupted. Needed to avoid impacting commands, like file deletion while ingesting and even to establish the possibility of proper collaboration.

With the gpfs_set_share() function available to Samba, Samba can provide the 1-second wait using the asynchronous character of the interface.

ACLs

GPFS ACLs are currently available in POSIX format via the Linux getxattr inode operation. Although equivalent for NFSv4 ACLs available, they are not provided by any shipped distro of linux. With gpfs_getacl() and gpfs_setacl() Samba can now get and set NFSv4 ACLs in GPFS on Linux.

Files

 - gpfs_gpl.h
 - libgpfs_gpl.so

Function Calls

gpfs_getacl()

FUNCTION

Retrieves the ACL information for a file. This function, together with gpfs_putacl, is intended for use by a backup program to save (gpfs_getacl) and restore (gpfs_putacl) the ACL information for a file. The flags parameter must be zero (reserved for future use). The aclP parameter must point to a buffer mapped by the gpfs_opaque_acl_t structure. The first four bytes of the buffer must contain its total size.

Note: The use of gpfs_fgetattrs/gpfs_fputattrs is preferred.

FUNCTION PROTOTYPE :

   int gpfs_getacl(char *pathname, int flags, void *acl);

RETURNS :

     0      Successful
    -1      Failure

ERROR :

    ENOSYS  function not available
    ENOSPC  buffer too small to return the entire ACL. 
            Needed size is returned in the first four bytes of the buffer pointed to by aclP.


gpfs_putacl()

FUNCTION :

Sets the ACL information for a file. The buffer passed in should contain the ACL data that was obtained by a previous call to gpfs_getacl. The flags parameter must be zero (reserved for future use).

Note: The use of gpfs_fgetattrs/gpfs_fputattrs is preferred.

FUNCTION PROTOTYPE :

  int gpfs_putacl(char *pathname, int   flags, void *acl);

RETURNS :

     0      Successful
    -1      Failure

ERROR :

    ENOSYS  function not available


gpfs_set_share()

FUNCTION :

Acquire shares for Samba

      Input :
            fd    : file descriptor
            allow : share type being requested
                    GPFS_SHARE_NONE, GPFS_SHARE_READ,
                    GPFS_SHARE_WRITE, GPFS_SHARE_BOTH
            deny  : share type to deny to others
                    GPFS_DENY_NONE, GPFS_DENY_READ,
                    GPFS_DENY_WRITE, GPFS_DENY_BOTH

FUNCTION PROTOTYPE :

   int gpfs_set_share(int fd, unsigned int allow, unsigned int deny);
   allow/deny specifications
   #define GPFS_SHARE_NONE   0
   #define GPFS_SHARE_READ   1
   #define GPFS_SHARE_WRITE  2
   #define GPFS_SHARE_BOTH   3
   #define GPFS_DENY_NONE    0
   #define GPFS_DENY_READ    1
   #define GPFS_DENY_WRITE   2
   #define GPFS_DENY_BOTH    3

RETURNS :

     0      Successful
    -1      Failure

ERROR :

   Specific error indication
   EACCES  share mode not available


gpfs_set_lease()

FUNCTION :

Acquire leases for Samba

   Input :
         fd        : file descriptor
         leaseType : lease type being requested
                     GPFS_LEASE_NONE GPFS_LEASE_READ,
                     GPFS_LEASE_WRITE

FUNCTION PROTOTYPE :

  int gpfs_set_lease(int fd, unsigned int leaseType);
     /* leaseType specifications */
     #define GPFS_LEASE_NONE    0
     #define GPFS_LEASE_READ    1
     #define GPFS_LEASE_WRITE   2

RETURNS :

     0      Successful
    -1      Failure

ERROR :

   Specific error indication
   EACCES  lease not available


gpfs_get_lease()

FUNCTION :

   Returns the type of lease currently held

FUNCTION PROTOTYPE :

  int gpfs_get_lease(int fd);

Returns :

       GPFS_LEASE_READ
       GPFS_LEASE_WRITE
       GPFS_LEASE_NONE
       -1      Failure

ERROR :

   Specific error indication
   EINVAL

Download

http://www14.software.ibm.com/webapp/set2/sas/f/gpfs/home.html

License

Copyright (C) 2006 International Business Machines

All rights reserved.

This file is part of the GPFS.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.