From 4d1d826be44ec82e3778e89cbd2873e0aacfc134 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 6 Jan 2006 10:27:12 +0000 Subject: r12735: After talking to Tridge and Jeremy... This needs to be made more generic before it goes in. Volker (This used to be commit 2c3d5c029a31111e1fe84ddc13c1bfc183d8bfde) --- source3/smbd/oplock_linux.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'source3/smbd/oplock_linux.c') diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index 0285bfce97..ab0c08f7fc 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -101,11 +101,11 @@ static void set_capability(unsigned capability) } /**************************************************************************** - Call SETLEASE. If we get EACCES then we try setting up the right capability - and try again + Call SETLEASE. If we get EACCES then we try setting up the right capability and + try again ****************************************************************************/ -static int linux_setlease(int snum, int fd, int leasetype) +static int linux_setlease(int fd, int leasetype) { int ret; @@ -114,17 +114,7 @@ static int linux_setlease(int snum, int fd, int leasetype) return -1; } - if (lp_gpfs_share(snum)) { - ret = set_gpfs_lease(fd, leasetype); - } else { - ret = fcntl(fd, F_SETLEASE, leasetype); - } - - if ((ret < 0) && (errno == ENOSYS)) { - /* This must have come from GPFS not being available */ - ret = fcntl(fd, F_SETLEASE, leasetype); - } - + ret = fcntl(fd, F_SETLEASE, leasetype); if (ret == -1 && errno == EACCES) { set_capability(CAP_LEASE); ret = fcntl(fd, F_SETLEASE, leasetype); @@ -164,7 +154,7 @@ static files_struct *linux_oplock_receive_message(fd_set *fds) static BOOL linux_set_kernel_oplock(files_struct *fsp, int oplock_type) { - if (linux_setlease(SNUM(fsp->conn), fsp->fh->fd, F_WRLCK) == -1) { + if (linux_setlease(fsp->fh->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->fh->fd, @@ -198,7 +188,7 @@ oplock state of %x.\n", fsp->fsp_name, (unsigned int)fsp->dev, /* * Remove the kernel oplock on this file. */ - if (linux_setlease(SNUM(fsp->conn), fsp->fh->fd, F_UNLCK) == -1) { + if (linux_setlease(fsp->fh->fd, F_UNLCK) == -1) { if (DEBUGLVL(0)) { dbgtext("linux_release_kernel_oplock: Error when removing kernel oplock on file " ); dbgtext("%s, dev = %x, inode = %.0f, file_id = %lu. Error was %s\n", -- cgit