[Tux3] Deferred namespace operations, change return type of fs create method

Daniel Phillips phillips at phunq.net
Sun Dec 7 03:22:18 PST 2008


This patch gets ready to support creating a name that collides with a
hidden dentry that still carries an inode because the file was unlinked
while somebody had it open.  The plan is to handle this in d_instantiate
by unhashing the hidden dentry and replacing it with a clone.  This
means that d_instantiate, or a varient, can return a different dentry
than it was given.  d_instantiate has, up till now, returned void, and
now it (or a variant) will return a dentry, which may possibly be
different than the one it was asked to instantiate.

It is probably ok to just change d_instantiate's return type, which
will be the same as passed for any filesystem that does not support
deferring, and thus can never create a negative dentry that still has
an inode.

The patch adds a (dentry *) return value to the vfs ->create method,
which requires every filesystem to be updated to return the dentry
that was passed or an ERR_PTR return in place of the current integer
error.  The original vfs_create, which called ->create is now called
namei_create and returns a dentry which is needed by a higher level
file notification API within vfs/namei.c.  A new vfs_create is a
wrapper, which keeps the old interface for external filesystem use.

Next, I will attempt to add the handling to d_instantiated for a
collision with a negative dentry for a file that is still open.  Unless
Hirofumi comes up with a simpler idea, which he is thinking about.

Regards,

Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: defer.patch
Type: text/x-diff
Size: 24695 bytes
Desc: not available
URL: <http://phunq.net/pipermail/tux3/attachments/20081207/77ecac1f/attachment.patch>
-------------- next part --------------
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3


More information about the Tux3 mailing list