Re: Open by cookie (was Re: inode)

Chip Salzenberg (chip@perlsupport.com)
Wed, 13 Jan 1999 16:33:22 -0500


According to Linus Torvalds:
> Chip:
> > 2) Why should open_by_handle work for smbfs?
>
> If it doesn't work for some filesystems, that makes me suspect that
> the whole idea is bogus. Sure, we can have special case interfaces,
> but if you want those, you should already love WNT, right?

Well, this problem has been solved for sockets. Sockets work for most
network protocols because the definition of 'name' is general enough
to cover almost anything.

Taking the idea for our uses, would it be acceptable to define
something just as general for fast opens? It could be considered a
magic cookie. And all the semantics of getting variable-length
cookies are already established by the socket calls like getpeername:

cookiesize = /*sizeof(cookiebuf)*/;
getcookie(fd, cookiebuf, &cookiesize);

/* ... */

fd = openbycookie(cookiebuf, cookiesize, O_RDONLY); /* or whatever */

Is that general enough to be a supported interface?

-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/