*at family of syscalls in FreeBSD

Eric Lemar eric.lemar at isilon.com
Thu Jun 7 19:36:03 UTC 2007


I certainly don't want to hold anything from getting into the release.  I
haven't had a chance to compare all the details of your patch and ours,
but I've spent a bit of time looking through yours, and I'd say
(not surprisingly) that what we've done is much more similar than not and
this is certainly a nice API to have even aside from the linux compatibility
reasons.

At least conceptually, most of the differences are relatively minor
stylistic differences.  We've done the same NDINIT/namei() changes.

Rather than have a set of kern_common_* functions, kern_open(), for
instance, just calls kern_openat() using AT_FDCWD.  kern_openat() has all
the actuall implementaiton.  This lets us avoid adding a seperate
kern_common_open() and the associated clutter with no real downside that I
can see.

Basic pattern is:
  *kern_open() - calls kern_openat() with AT_FDCWD
  *kern_openat() - calls a funtion at_getwd() similar to your kern_get_at
  *at_getwd() - In addition to your parameters, we also pass in the flags
   and path.  The flags let us do an isilon specific VOP to get a vp for
   the subfile container if the user passed in O_XATTR (solaris uses this
   to access subfiles and I know linux has at least talked about if not
   implemented it).  We include the path largely to avoid doing work if
   the path is absolute since the fd is supposed to be ignored in that
   case.  Depending on how tightly you want to tat, you could
   argue whether it is valid to return an error due to an invalid
   fd if you pass in an absolute path (I haven't looked at draft posix
   or actual implementations to see what they do, but we just
   plain don't touch the fd at all in that case).


eric


________________________________

From: Roman Divacky [mailto:rdivacky at FreeBSD.org]
Sent: Thu 6/7/2007 12:04 AM
To: Doug Barton
Cc: Eric Lemar; arch at FreeBSD.org
Subject: Re: *at family of syscalls in FreeBSD



On Wed, Jun 06, 2007 at 10:38:03AM -0700, Doug Barton wrote:
> Roman Divacky wrote:
>
> > my current patch is at: www.vlakno.cz/~rdivacky/linux_at.patch
> >
> > it does not implement the native fbsd syscalls, only the linuxulator ones
> > but adding those is a matter of minutes. I asked for a review by pjd and/or
> > rwatson and hopefully this will get commited soon..
>
> My recollection of the last round of discussion was that you were
> asked to implement these in our base, then wrap the linux versions. If
> it's trivial to implement, it should probably be done that way first.

well.. my implementation does exactly that :) I changed namei() routine to
check ni_startdir for possible startdir other then CWD and made the kern_fooat()
use it. the change is mostly self-contained (minus prototypes in sys/sys/syscallsubr.h)
in vfs_syscalls. with a very slight change (5 lines?) to vfs_lookup.c + namei.h

its quite simple. I cant comment the Isilon's version. My patch (the approach) has been
OKed by rwatson@ and pjd at . I'd really love to see this go to -current before RELENG_7
so time is rushing.

can someone from Isilon comment their version so we can compare benefits etc.?

roman




More information about the freebsd-arch mailing list