All of lore.kernel.org
 help / color / mirror / Atom feed
* libfs.c:simple_lookup
@ 2007-02-19 20:09 Jan Engelhardt
  2007-02-19 21:35 ` libfs.c:simple_lookup Dave Kleikamp
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2007-02-19 20:09 UTC (permalink / raw)
  To: linux-fsdevel

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)?


Jan
-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libfs.c:simple_lookup
  2007-02-19 20:09 libfs.c:simple_lookup Jan Engelhardt
@ 2007-02-19 21:35 ` Dave Kleikamp
  2007-02-19 22:49   ` libfs.c:simple_lookup Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Kleikamp @ 2007-02-19 21:35 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-fsdevel

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.  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)?

Shaggy
-- 
David Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libfs.c:simple_lookup
  2007-02-19 21:35 ` libfs.c:simple_lookup Dave Kleikamp
@ 2007-02-19 22:49   ` Jan Engelhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2007-02-19 22:49 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: linux-fsdevel


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-19 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 20:09 libfs.c:simple_lookup Jan Engelhardt
2007-02-19 21:35 ` libfs.c:simple_lookup Dave Kleikamp
2007-02-19 22:49   ` libfs.c:simple_lookup Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.