Implemented OPLOCK for FreeBsd

Jordan Hubbard jkh at freebsd.org
Fri Sep 7 12:49:04 GMT 2001


Thanks guys,

I also mailed some of this discussion to the freebsd developers
mailing list, and some of them have already come up with a way of
fully implementing the functionality needed by simply using kqueue.
I'm currently arguing that we should use kqueue internally and support
the Linux API externally, but in the interim I think Jonathan Lemon
will be able to help provide a freebsd_oplocks.c that mostly just
works out of the box if Ephi is willing to work with him a little.

- Jordan

From: "Ephi Dror" <edror at panasas.com>
Subject: RE: Implemented OPLOCK for FreeBsd
Date: Fri, 7 Sep 2001 11:57:32 -0700

> Hi everyone,
> 
> Sure, we will package it together with a README file and instructions so it
> can be easily installed and used by everyone.
> It was implemented and tested on FreeBSD 4.3 so far.
> 
> Thanks,
> Ephi
> 
> 
> > -----Original Message-----
> > From: jeremy at valinux.com [mailto:jeremy at valinux.com]
> > Sent: Friday, September 07, 2001 10:38 AM
> > To: edror at panasas.com
> > Cc: tridge at samba.org; samba-technical at lists.samba.org; Jordan
> > K. Hubbard
> > Subject: Re: Implemented OPLOCK for FreeBsd
> >
> >
> > 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
> > > 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.
> >
> > 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).
> >
> > Jeremy.
> >
> > --
> > --------------------------------------------------------
> > 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