From aab2fe021643417854451c65e564932f4ac25f10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Sep 1998 01:48:45 +0000 Subject: First cut at kernel oplocks. This should have no effect unless runnin on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy. (This used to be commit c3c5e13f85c97939746070132dad941e79c546fb) --- source3/include/smb.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'source3/include/smb.h') diff --git a/source3/include/smb.h b/source3/include/smb.h index 2af7b7ced4..842aeb57be 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1538,11 +1538,11 @@ extern int unix_ERR_code; * Loopback command offsets. */ -#define UDP_CMD_LEN_OFFSET 0 -#define UDP_CMD_PORT_OFFSET 4 -#define UDP_CMD_HEADER_LEN 6 +#define OPBRK_CMD_LEN_OFFSET 0 +#define OPBRK_CMD_PORT_OFFSET 4 +#define OPBRK_CMD_HEADER_LEN 6 -#define UDP_MESSAGE_CMD_OFFSET 0 +#define OPBRK_MESSAGE_CMD_OFFSET 0 /* * Oplock break command code to send over the udp socket. @@ -1563,6 +1563,24 @@ extern int unix_ERR_code; #define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) #define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) +#if defined(HAVE_KERNEL_OPLOCKS) +/* + * Oplock break command code sent via the kernel interface. + * + * Form of this is : + * + * 0 2 2+devsize 2+devsize+inodesize + * +----+--------+--------+ + * | cmd| dev | inode | + * +----+--------+--------+ + */ + +#define KERNEL_OPLOCK_BREAK_CMD 0x2 +#define KERNEL_OPLOCK_BREAK_DEV_OFFSET 2 +#define KERNEL_OPLOCK_BREAK_INODE_OFFSET (KERNEL_OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) +#define KERNEL_OPLOCK_BREAK_MSG_LEN (KERNEL_OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) + +#endif /* HAVE_KERNEL_OPLOCKS */ #define CMD_REPLY 0x8000 -- cgit