Implemented OPLOCK for FreeBsd

Ephi Dror edror at panasas.com
Fri Sep 7 10:27:02 GMT 2001


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
F_GETLEASE.

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.

Thanks,
Ephi.




> -----Original Message-----
> From: Andrew Tridgell [mailto:tridge at samba.org]
> Sent: Friday, September 07, 2001 4:47 AM
> To: edror at panasas.com
> Cc: samba-technical at lists.samba.org
> Subject: Re: Implemented OPLOCK for FreeBsd
>
>
> Ephi,
>
> > I implemented OPLOCK for FreeBsd kernel.
>
> Great! What API did you choose? The one in Linux 2.4?
>
> Cheers, Tridge





More information about the samba-technical mailing list