diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-06-11 05:57:58 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-06-11 05:57:58 +0000 |
commit | 8843a6379d7c1cf59f0f3673cbc567b09994b7d2 (patch) | |
tree | 63f645769adeecd6cfd999a8f2d873f1c5a626b6 /source3/smbd/oplock.c | |
parent | 4ec7597d1154c60f0f55feab93f2dc9c776d56f8 (diff) | |
download | samba-8843a6379d7c1cf59f0f3673cbc567b09994b7d2.tar.gz samba-8843a6379d7c1cf59f0f3673cbc567b09994b7d2.tar.bz2 samba-8843a6379d7c1cf59f0f3673cbc567b09994b7d2.zip |
Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r-- | source3/smbd/oplock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 44a8e9b071..5e63b4d4ff 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -84,6 +84,13 @@ BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeou selrtn = sys_select(maxfd+1,fds,&to); + if (selrtn == -1 && errno == EINTR) { + /* could be a kernel oplock interrupt */ + if (koplocks && koplocks->msg_waiting(fds)) { + return koplocks->receive_message(fds, buffer, buffer_len); + } + } + /* Check if error */ if(selrtn == -1) { /* something is wrong. Maybe the socket is dead? */ @@ -1120,6 +1127,8 @@ address %lx. Error was %s\n", (long)htonl(INADDR_LOOPBACK), strerror(errno))); if (lp_kernel_oplocks()) { #if HAVE_KERNEL_OPLOCKS_IRIX koplocks = irix_init_kernel_oplocks(); +#elif HAVE_KERNEL_OPLOCKS_LINUX + koplocks = linux_init_kernel_oplocks(); #endif } |