summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/config.h.in1
-rw-r--r--source3/include/proto.h15
-rw-r--r--source3/include/smb.h26
3 files changed, 30 insertions, 12 deletions
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index da545486f0..4f199f0df3 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -122,6 +122,7 @@
#undef SIZEOF_OFF_T
#undef STAT_STATVFS64
#undef HAVE_LIBREADLINE
+#undef HAVE_KERNEL_OPLOCKS
/* The number of bytes in a int. */
#undef SIZEOF_INT
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c2d5c0e1ff..cbd4f07b2f 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -276,11 +276,6 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,
ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout);
BOOL receive_smb(int fd,char *buffer, unsigned int timeout);
BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout);
-BOOL receive_local_message(int fd, char *buffer, int buffer_len, unsigned int timeout);
-BOOL push_oplock_pending_smb_message(char *buf, int msg_len);
-BOOL receive_message_or_smb(int smbfd, int oplock_fd,
- char *buffer, int buffer_len,
- int timeout, BOOL *got_smb);
BOOL send_smb(int fd,char *buffer);
int name_extract(char *buf,int ofs,char *name);
int name_len( char *s );
@@ -1809,11 +1804,14 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op);
/*The following definitions come from smbd/oplock.c */
BOOL open_oplock_ipc(void);
-BOOL process_local_message(int sock, char *buffer, int buf_size);
+BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeout);
+BOOL set_file_oplock(files_struct *fsp);
+int setup_oplock_select_set( fd_set *fds);
+BOOL process_local_message(char *buffer, int buf_size);
BOOL request_oplock_break(share_mode_entry *share_entry,
SMB_DEV_T dev, SMB_INO_T inode);
BOOL attempt_close_oplocked_file(files_struct *fsp);
-void check_kernel_oplocks(BOOL *have_oplocks);
+void check_kernel_oplocks(void);
/*The following definitions come from smbd/password.c */
@@ -1857,7 +1855,8 @@ void invalidate_read_prediction(int fd);
/*The following definitions come from smbd/process.c */
-BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout);
+BOOL push_oplock_pending_smb_message(char *buf, int msg_len);
+BOOL receive_next_smb(char *inbuf, int bufsize, int timeout);
void process_smb(char *inbuf, char *outbuf);
char *smb_fn_name(int type);
void construct_reply_common(char *inbuf,char *outbuf);
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