static BOOL linux_set_kernel_oplock(files_struct *fsp, int oplock_type) { if (linux_setlease(fsp->fd, F_WRLCK) == -1) { DEBUG(3,("linux_set_kernel_oplock: Refused oplock on file %s, fd = %d, dev = %x, \ inode = %.0f. (%s)\n", fsp->fsp_name, fsp->fd, (unsigned int)fsp->dev, (double)fsp->inode, strerror(errno))); return False; }
static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int fd, int leasetype) { int result = -1; START_PROFILE(syscall_linux_setlease); #ifdef HAVE_KERNEL_OPLOCKS_LINUX /* first set the signal handler */ if(linux_set_lease_sighandler(fd) == -1) { return -1; } result = linux_setlease(fd, leasetype); #else errno = ENOSYS; #endif END_PROFILE(syscall_linux_setlease); return result; }
static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp, int leasetype) { int ret; START_PROFILE(syscall_linux_setlease); if ( linux_set_lease_sighandler(fsp->fh->fd) == -1) return -1; ret = set_gpfs_lease(fsp->fh->fd,leasetype); if ( ret < 0 ) { /* This must have come from GPFS not being available */ /* or some other error, hence call the default */ ret = linux_setlease(fsp->fh->fd, leasetype); } END_PROFILE(syscall_linux_setlease); return ret; }