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

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Mon, 28 Jun 1999 16:21:37 +0200


Alexander Viro wrote:
> > Use the same attributes for the "default" file as the directory itself.
> > So really you've opened the directory inode, it's just that reading &
> > writing work on the associated file.
>
> Parse it, please. What dentry you will get?

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_.

For this reason, the default file may not be a symbolic link.

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.

Hey, this is too easy :-)

-- Jamie

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