User: Password:
Subscribe / Log in / New account

Open by handle

Open by handle

Posted Feb 25, 2010 11:36 UTC (Thu) by nix (subscriber, #2304)
Parent article: Open by handle

Why is this reminding me of the seekdir()/telldir() horror?

I suppose that the handle being an opaque structure adds enough freedom that filesystems won't be locked into a seekdir()-style nightmare... if need be you could simply wrap the filename into a structure and return that :)

(Log in to post comments)

Open by handle

Posted Feb 25, 2010 17:27 UTC (Thu) by kvaneesh (subscriber, #45646) [Link]

That will not work with rename.

Open by handle

Posted Feb 25, 2010 17:36 UTC (Thu) by nix (subscriber, #2304) [Link]


It'll work even less well with unlink(). In fact, if we don't have a close_handle(), this gives rise to exactly the same resource usage and when-can-we-recycle-handles problems that telldir() has got. Whatever goes into a handle, it essentially has to be correlated with the inode number, and thus physically present on and persistent in the FS, and won't work well with FAT. Unsurprisingly these are the same constraints imposed by NFS
server support. )

I hope open_by_handle() is allowed to return -ESTALE...

Open by handle

Posted Feb 25, 2010 17:47 UTC (Thu) by kvaneesh (subscriber, #45646) [Link]

It does return -ESTALE if it can't find a mapping inode.

Open by handle

Posted Feb 25, 2010 20:50 UTC (Thu) by nix (subscriber, #2304) [Link]

I should have just checked the code rather than wasting your time like
that. Apologies.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds