modules/gpfs.c

ソースコードを見る。

関数

BOOL set_gpfs_sharemode (files_struct *fsp, uint32 access_mask, uint32 share_access)
int set_gpfs_lease (int fd, int leasetype)
int smbd_gpfs_getacl (char *pathname, int flags, void *acl)
int smbd_gpfs_putacl (char *pathname, int flags, void *acl)
void init_gpfs (void)

変数

static void * libgpfs_handle = NULL
static int(*) gpfs_set_share_fn (int fd, unsigned int allow, unsigned int deny)
static int(*) gpfs_set_lease_fn (int fd, unsigned int leaseType)
static int(*) gpfs_getacl_fn (char *pathname, int flags, void *acl)
static int(*) gpfs_putacl_fn (char *pathname, int flags, void *acl)


関数

BOOL set_gpfs_sharemode ( files_struct fsp,
uint32  access_mask,
uint32  share_access 
)

gpfs.c35 行で定義されています。

参照先 errnofd_handle::fdfiles_struct::fhgpfs_set_share_fnresultstrerror().

参照元 vfs_gpfs_kernel_flock().

00037 {
00038         unsigned int allow = GPFS_SHARE_NONE;
00039         unsigned int deny = GPFS_DENY_NONE;
00040         int result;
00041 
00042         if (gpfs_set_share_fn == NULL) {
00043                 return False;
00044         }
00045 
00046         if ((fsp == NULL) || (fsp->fh == NULL) || (fsp->fh->fd < 0)) {
00047                 /* No real file, don't disturb */
00048                 return True;
00049         }
00050 
00051         allow |= (access_mask & (FILE_WRITE_DATA|FILE_APPEND_DATA|
00052                                  DELETE_ACCESS)) ? GPFS_SHARE_WRITE : 0;
00053         allow |= (access_mask & (FILE_READ_DATA|FILE_EXECUTE)) ?
00054                 GPFS_SHARE_READ : 0;
00055 
00056         if (allow == GPFS_SHARE_NONE) {
00057                 DEBUG(10, ("special case am=no_access:%x\n",access_mask));
00058         }
00059         else {  
00060                 deny |= (share_access & FILE_SHARE_WRITE) ?
00061                         0 : GPFS_DENY_WRITE;
00062                 deny |= (share_access & (FILE_SHARE_READ)) ?
00063                         0 : GPFS_DENY_READ;
00064         }
00065         DEBUG(10, ("am=%x, allow=%d, sa=%x, deny=%d\n",
00066                    access_mask, allow, share_access, deny));
00067 
00068         result = gpfs_set_share_fn(fsp->fh->fd, allow, deny);
00069         if (result != 0) {
00070                 if (errno == ENOSYS) {
00071                         DEBUG(5, ("VFS module vfs_gpfs loaded, but no gpfs "
00072                                   "support has been compiled into Samba. Allowing access\n"));
00073                         return True;
00074                 } else {
00075                         DEBUG(10, ("gpfs_set_share failed: %s\n",
00076                                    strerror(errno)));
00077                 }
00078         }
00079 
00080         return (result == 0);
00081 }

int set_gpfs_lease ( int  fd,
int  leasetype 
)

gpfs.c83 行で定義されています。

参照先 errnogpfs_set_lease_fn.

参照元 vfs_gpfs_setlease().

00084 {
00085         int gpfs_type = GPFS_LEASE_NONE;
00086 
00087         if (gpfs_set_lease_fn == NULL) {
00088                 errno = EINVAL;
00089                 return -1;
00090         }
00091 
00092         if (leasetype == F_RDLCK) {
00093                 gpfs_type = GPFS_LEASE_READ;
00094         }
00095         if (leasetype == F_WRLCK) {
00096                 gpfs_type = GPFS_LEASE_WRITE;
00097         }
00098         return gpfs_set_lease_fn(fd, gpfs_type);
00099 }

int smbd_gpfs_getacl ( char *  pathname,
int  flags,
void *  acl 
)

gpfs.c101 行で定義されています。

参照先 errnogpfs_getacl_fn.

参照元 gpfs_getacl_alloc().

00102 {
00103         if (gpfs_getacl_fn == NULL) {
00104                 errno = ENOSYS;
00105                 return -1;
00106         }
00107 
00108         return gpfs_getacl_fn(pathname, flags, acl);
00109 }

int smbd_gpfs_putacl ( char *  pathname,
int  flags,
void *  acl 
)

gpfs.c111 行で定義されています。

参照先 errnogpfs_putacl_fn.

参照元 gpfsacl_process_smbacl()gpfsacl_sys_acl_set_file().

00112 {
00113         if (gpfs_putacl_fn == NULL) {
00114                 errno = ENOSYS;
00115                 return -1;
00116         }
00117 
00118         return gpfs_putacl_fn(pathname, flags, acl);
00119 }

void init_gpfs ( void   ) 

gpfs.c121 行で定義されています。

参照先 errnogpfs_getacl_fngpfs_putacl_fngpfs_set_lease_fngpfs_set_share_fnlibgpfs_handlestrerror()sys_dlclose()sys_dlopen()sys_dlsym().

参照元 vfs_gpfs_init().

00122 {
00123         if (libgpfs_handle != NULL) {
00124                 return;
00125         }
00126 
00127         libgpfs_handle = sys_dlopen("libgpfs_gpl.so", RTLD_LAZY);
00128 
00129         if (libgpfs_handle == NULL) {
00130                 DEBUG(10, ("sys_dlopen for libgpfs_gpl failed: %s\n",
00131                            strerror(errno)));
00132                 return;
00133         }
00134 
00135         DEBUG(10, ("libgpfs_gpl.so loaded\n"));
00136 
00137         gpfs_set_share_fn = sys_dlsym(libgpfs_handle, "gpfs_set_share");
00138         if (gpfs_set_share_fn == NULL) {
00139                 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
00140                           "'gpfs_set_share'\n"));
00141                 sys_dlclose(libgpfs_handle);
00142 
00143                 /* leave libgpfs_handle != NULL around, no point
00144                    in trying twice */
00145                 gpfs_set_share_fn = NULL;
00146                 gpfs_set_lease_fn = NULL;
00147                 gpfs_getacl_fn = NULL;
00148                 gpfs_putacl_fn = NULL;
00149                 return;
00150         }
00151 
00152         gpfs_set_lease_fn = sys_dlsym(libgpfs_handle, "gpfs_set_lease");
00153         if (gpfs_set_lease_fn == NULL) {
00154                 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
00155                           "'gpfs_set_lease'\n"));
00156                 sys_dlclose(libgpfs_handle);
00157 
00158                 /* leave libgpfs_handle != NULL around, no point
00159                    in trying twice */
00160                 gpfs_set_share_fn = NULL;
00161                 gpfs_set_lease_fn = NULL;
00162                 gpfs_getacl_fn = NULL;
00163                 gpfs_putacl_fn = NULL;
00164                 return;
00165         }
00166 
00167         gpfs_getacl_fn = sys_dlsym(libgpfs_handle, "gpfs_getacl");
00168         if (gpfs_getacl_fn == NULL) {
00169                 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
00170                           "'gpfs_getacl'\n"));
00171                 sys_dlclose(libgpfs_handle);
00172 
00173                 /* leave libgpfs_handle != NULL around, no point
00174                    in trying twice */
00175                 gpfs_set_share_fn = NULL;
00176                 gpfs_set_lease_fn = NULL;
00177                 gpfs_getacl_fn = NULL;
00178                 gpfs_putacl_fn = NULL;
00179                 return;
00180         }
00181 
00182         gpfs_putacl_fn = sys_dlsym(libgpfs_handle, "gpfs_putacl");
00183         if (gpfs_putacl_fn == NULL) {
00184                 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol "
00185                           "'gpfs_putacl'\n"));
00186                 sys_dlclose(libgpfs_handle);
00187 
00188                 /* leave libgpfs_handle != NULL around, no point
00189                    in trying twice */
00190                 gpfs_set_share_fn = NULL;
00191                 gpfs_set_lease_fn = NULL;
00192                 gpfs_getacl_fn = NULL;
00193                 gpfs_putacl_fn = NULL;
00194                 return;
00195         }
00196 
00197 }


変数

void* libgpfs_handle = NULL [static]

gpfs.c27 行で定義されています。

参照元 init_gpfs().

int(*) gpfs_set_share_fn(int fd, unsigned int allow, unsigned int deny) [static]

gpfs.c29 行で定義されています。

参照元 init_gpfs()set_gpfs_sharemode().

int(*) gpfs_set_lease_fn(int fd, unsigned int leaseType) [static]

gpfs.c30 行で定義されています。

参照元 init_gpfs()set_gpfs_lease().

int(*) gpfs_getacl_fn(char *pathname, int flags, void *acl) [static]

gpfs.c31 行で定義されています。

参照元 init_gpfs()smbd_gpfs_getacl().

int(*) gpfs_putacl_fn(char *pathname, int flags, void *acl) [static]

gpfs.c32 行で定義されています。

参照元 init_gpfs()smbd_gpfs_putacl().


Sambaに対してSat Aug 29 21:23:50 2009に生成されました。  doxygen 1.4.7