On Mon, Jul 30, 2007 at 06:13:42PM +0200, Jan Blunck wrote: > On union-mounted file systems the lookup function must also visit lower layers > of the union-stack when doing a lookup. This patches add support for > union-mounts to cached lookups and real lookups. > > We have 3 different styles of lookup functions now: > - multiple pathname components, follow mounts, follow union, follow symlinks > - single pathname component, doesn't follow mounts, follow union, doesn't > follow symlinks > - single pathname component doesn't follow mounts, doesn't follow unions, > doesn't follow symlinks > <snip> > +static int hash_lookup_union(struct nameidata *nd, struct qstr *name, > + struct path *path) > +{ Jan, Looks like there is a lot of code duplication b/n lookup_hash versions and real_lookup versions for union mounts. Is there a reason for doing it this way? I believe that with a little effort we should be able to get rid of the above hash_lookup_union() completely and can instead use real_lookup_union() variants from lookup_hash() also. The reason I say this is, I can't see any _real_ difference b/n real_lookup() and __lookup_hash_kern(). While the former does a seqlock protected(for concurrent renames) dcache lookup followed by a ->lookup(), the latter does an extra lock free dcache lookup, followed by seqlock protected dcache lookup and a ->lookup() on failure. Do you want me to cook up a patch for this Jan ? Aside from that, it would help if someone could throw some light on the history of __lookup_hash_kern. I wonder why real_lookup wasn't be used instead. Regards, Bharata. - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html