Ignore:
Timestamp:
Jul 6, 2011, 8:21:13 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/modules/vfs_gpfs.c

    r596 r599  
    3131#include "vfs_gpfs.h"
    3232
     33
     34
     35
     36
     37
     38
    3339static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
    3440                                 uint32 share_mode, uint32 access_mask)
    3541{
    3642
     43
     44
     45
     46
     47
     48
    3749        START_PROFILE(syscall_kernel_flock);
    3850
    3951        kernel_flock(fsp->fh->fd, share_mode, access_mask);
    4052
    41         if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
    42 
    43                 return -1;
    44 
     53        if (config->sharemodes
     54                && !set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
     55                return -1;
    4556        }
    4657
     
    5263static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp)
    5364{
    54         if ((fsp->fh != NULL) && (fsp->fh->fd != -1)) {
     65
     66        struct gpfs_config_data *config;
     67
     68        SMB_VFS_HANDLE_GET_DATA(handle, config,
     69                                struct gpfs_config_data,
     70                                return -1);
     71
     72        if (config->sharemodes && (fsp->fh != NULL) && (fsp->fh->fd != -1)) {
    5573                set_gpfs_sharemode(fsp, 0, 0);
    5674        }
     
    6280                             int leasetype)
    6381{
    64         int ret;
     82        struct gpfs_config_data *config;
     83        int ret=0;
     84
     85        SMB_VFS_HANDLE_GET_DATA(handle, config,
     86                                struct gpfs_config_data,
     87                                return -1);
    6588
    6689        START_PROFILE(syscall_linux_setlease);
    6790
    68         if ( linux_set_lease_sighandler(fsp->fh->fd) == -1)
    69                 return -1;
    70 
    71         ret = set_gpfs_lease(fsp->fh->fd,leasetype);
    72 
    73         if ( ret < 0 ) {
     91        if (linux_set_lease_sighandler(fsp->fh->fd) == -1)
     92                return -1;
     93
     94        if (config->leases) {
     95                ret = set_gpfs_lease(fsp->fh->fd,leasetype);
     96        }
     97
     98        if (ret < 0) {
    7499                /* This must have come from GPFS not being available */
    75100                /* or some other error, hence call the default */
     
    959984        struct gpfs_winattr attrs;
    960985        int ret = 0;
     986
    961987
    962988        DEBUG(10, ("gpfs_get_xattr: %s \n",path));
     
    9951021        }
    9961022
    997         snprintf(attrstr, size, "0x%x", dosmode & SAMBA_ATTRIBUTES_MASK);
     1023        result = snprintf(attrstr, size, "0x%x",
     1024                          dosmode & SAMBA_ATTRIBUTES_MASK) + 1;
     1025
    9981026        DEBUG(10, ("gpfs_get_xattr: returning %s\n",attrstr));
    999         return size;
     1027        return ;
    10001028}
    10011029
     
    11141142}
    11151143
     1144
     1145
     1146
     1147
     1148
     1149
     1150
     1151
     1152
     1153
     1154
     1155
     1156
     1157
     1158
     1159
     1160
     1161
     1162
     1163
     1164
     1165
     1166
     1167
     1168
     1169
     1170
     1171
     1172
     1173
     1174
     1175
     1176
     1177
     1178
     1179
     1180
     1181
     1182
     1183
     1184
     1185
     1186
    11161187static struct vfs_fn_pointers vfs_gpfs_fns = {
     1188
    11171189        .kernel_flock = vfs_gpfs_kernel_flock,
    11181190        .linux_setlease = vfs_gpfs_setlease,
     
    11351207        .lstat = vfs_gpfs_lstat,
    11361208        .ntimes = vfs_gpfs_ntimes,
     1209
    11371210};
    11381211
Note: See TracChangeset for help on using the changeset viewer.