Re: 2.1.51 dcache questions

Linus Torvalds (torvalds@transmeta.com)
Tue, 19 Aug 1997 09:49:13 -0700 (PDT)


On Tue, 19 Aug 1997, Bill Hawes wrote:
>
> Just a couple of questions though -- the semantics of reserved_lookup
> are a little different, as you're no longer using dentry->d_mounts. Was
> this the intent? Seems like dget(result->d_mounts) is still
> appropriate.

I decided that there is no point in using d_mounts for the reserved
entries, as nothing can be mounted on "." or ".." anyway.

In fact, I didn't do the d_mounts thing in real_lookup() either at first:
if it isn't in the dcache it cannot be a mount point. That worked fine,
_except_ for autofs which puts it into the dcache and turns it into a
mount point as part of the lookup..

I considered changing the lookup() code to return the dentry, so that
autofs could do the mount point following on its own, and not do the
unnecessary pointer traversal for normal names.

Yes, I know, it only gets rid of a single unconditional pointer lookup.
Call me anal.

> The other question is in regards to d_move -- it appears to be possible
> for the old dentry to no longer be hashed, as someone could have done a
> d_drop on it after the original lookup. This would confuse your hash
> swapping tricks, and it looks like both dentries would get put on the
> new parent's hash chain. Perhaps it's safer to just do the slower
> unhash/re-hash? d_move shouldn't be performance critical anyway.

Yeah, but it was so _clean_ with the clever switches..

But you're probably right. Damn.

Linus