Implemented OPLOCK for FreeBsd

Jeremy Allison jeremy at
Fri Sep 7 10:33:07 GMT 2001

Ephi Dror wrote:
> Thanks Andrew,
> The implementation is based on Linux API.
> I created a new file in source/smbd called oplock_fbsd.c that implements the
> kernel specific support for FreeBSD.
> In general, I added two more commands to fcntl for FreeBSD: F_SETLEASE and
> In the Vonde layer, I added a slist of oplock files. For each oplock file I
> keep information such as the proc pointer, fd and vnode.
> For each open file by either local FS or NFS (not really open), I added a
> check to see if the file is oplocked, if yes, it sends a signal to the smbd
> that holds the oplock so it can break the oplock.
> In the mean time, that process is waiting on tsleep until the oplock break
> is done or a timeout.
> In Linux, as part of the signal, the fd is passed to the signal handler,
> however in FreeBSD  I did not know how to pass that fd information from the
> kernel to user land so I used fcntl with F_GETLEASE to pass me back the fd
> instead of the pid. It is a kludge until I find the way to do it right.
> We are going to test it here and welcome anyone who is interested to help.
> As soon as it become mature, we will be more than happy to submit it to
> SAMBA and everyone else in the world.

Thats' great ! As FreeBSD runs under vmware, can you
send instructions as to what version of FreeBSD to
test this out under ?

I'd like to test this, but it won't be until after
2.2.2 ships (few weeks).

Have you informed Jordan and the other FreeBSD developers 
(I'm CC:ing Jordan on this message) ? I'm sure they'll be
interested in including this (it's something that would
help MaxOS X enormously also).


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list