On Feb 19 2007 15:35, Dave Kleikamp wrote: >On Mon, 2007-02-19 at 21:09 +0100, Jan Engelhardt wrote: >> Hello, >> >> >> simple_lookup() in fs/libfs.c does some extra steps, namely >> >> dentry->d_op = &simple_dentry_operations; >> d_add(dentry, NULL); >> >> as far as I understand, this creates a negative dentry which will be >> deleted sometime later again. Is not it easier to not create it at all >> (since it is not going to be existent anyway)? > >I'm not sure I understand the question, so allow me to restate a similar >question, and you can tell me if we're asking the same thing. > >In general, the negative dentry avoids the overhead of looking up a >non-existent entry more than once by "remembering" that the entry does >not exist.
Ah, thanks. That might indeed make sense for disk-based filesystems. > Since there is almost no overhead to calling >simple_lookup(), would be be better off simply returning without >creating the negative dentry (and letting simple_lookup be called more >often)? Yes, that is what I was out at. - The comment above simple_lookup already says it - if it's not already positive, it does not exist. Jan -- - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html