Re: [RFC] Open directory as default file - proposal for API

Alexander Viro (viro@math.psu.edu)
Mon, 28 Jun 1999 10:52:55 -0400 (EDT)


On Mon, 28 Jun 1999, Jamie Lokier wrote:

> Two options:
>
> 1. The dentry of the default file.
> A flag is set on the filp.
> Most operations act on the default file's dentry, but readdir and
> lseek check the filp flag to consider acting on the default file
> dentry's _parent_.

lseek doesn't act on dentries at all - it lives on struct file layer.
readdir requires a lock on inode in question for damn good reasons.
You'll get races that way.

> 2. The filp has two dentries.
> Most operations use the usual one, but readdir uses the other, and
> lseek knows to operate on both if they are different.
>
> Has no limitation w.r.t. symbolic links, but uses a bit more space in
> filps.
Ditto. Locking is not going to be fun that way.

> Hey, this is too easy :-)

Ahem... And what about ->create()/->unlink()/.... stuff? What about
renaming an open file?

-
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/