From: Tim Prouty Date: Fri, 9 Jan 2009 21:07:58 +0000 (-0800) Subject: s3 oplocks: Differentiate between releasing an oplock vs. downgrading to Level 2... X-Git-Tag: samba-4.0.0alpha7~389 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c1310fa6ae1a67dc0fea3bf549d805ff167e78f;p=thirdparty%2Fsamba.git s3 oplocks: Differentiate between releasing an oplock vs. downgrading to Level 2 for kernel oplocks Pass in an extra argument when releasing an oplock so kernel oplock implementations can support downgrading from Level 1 to Level 2. --- diff --git a/source3/include/smb.h b/source3/include/smb.h index 100ec210318..96cd3b7d853 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1701,7 +1701,7 @@ struct kernel_oplocks_ops { bool (*set_oplock)(struct kernel_oplocks *ctx, files_struct *fsp, int oplock_type); void (*release_oplock)(struct kernel_oplocks *ctx, - files_struct *fsp); + files_struct *fsp, int oplock_type); }; #include "smb_macros.h" diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 3dac674c17a..0945ac66776 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -91,7 +91,7 @@ void release_file_oplock(files_struct *fsp) if ((fsp->oplock_type != NO_OPLOCK) && (fsp->oplock_type != FAKE_LEVEL_II_OPLOCK) && koplocks) { - koplocks->ops->release_oplock(koplocks, fsp); + koplocks->ops->release_oplock(koplocks, fsp, NO_OPLOCK); } if (fsp->oplock_type == LEVEL_II_OPLOCK) { @@ -123,7 +123,7 @@ void release_file_oplock(files_struct *fsp) static void downgrade_file_oplock(files_struct *fsp) { if (koplocks) { - koplocks->ops->release_oplock(koplocks, fsp); + koplocks->ops->release_oplock(koplocks, fsp, LEVEL_II_OPLOCK); } fsp->oplock_type = LEVEL_II_OPLOCK; exclusive_oplocks_open--; diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c index d7f45e67de4..23b2fa90813 100644 --- a/source3/smbd/oplock_irix.c +++ b/source3/smbd/oplock_irix.c @@ -222,7 +222,7 @@ static bool irix_set_kernel_oplock(struct kernel_oplocks *_ctx, ****************************************************************************/ static void irix_release_kernel_oplock(struct kernel_oplocks *_ctx, - files_struct *fsp) + files_struct *fsp, int oplock_type) { if (DEBUGLVL(10)) { /* diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index 51cce0ed48a..5840ff0851c 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -130,7 +130,7 @@ static bool linux_set_kernel_oplock(struct kernel_oplocks *ctx, ****************************************************************************/ static void linux_release_kernel_oplock(struct kernel_oplocks *ctx, - files_struct *fsp) + files_struct *fsp, int oplock_type) { if (DEBUGLVL(10)) { /*