Re: 2.1.118 Tons of oopes

Linus Torvalds (torvalds@transmeta.com)
31 Aug 1998 20:32:38 GMT


In article <19980831082313.26439.qmail@hog.ctrl-c.liu.se>,
<wingel@t1.ctrl-c.liu.se> wrote:
>tantalophile.demon.co.uk wrote:
>>Richard Gooch wrote:
>>> Yes, I can see the benefit of avoiding the NULL check. It would be
>>> nice to be able to do this. However, that would then require every
>>> driver to be updated on every addition of a new VFS method.
>>
>>It's possible, in the NULL case, that the check is faster than the
>>function call to the default function.
>
>Which is a rather bogus argument, trying to call a VFS method which
>is NULL usually indicates an error and isn't time critical.

No, some functions are NULL quite normally, simply because it's
something that the low-level driver or FS doesn't want to bother with.

For example, networked filesystems often need more hooks to tell the
system that "ok, something changed", while a local filesystem doesn't
need that and can just let the VFS layer do whatever it wants to do
without having to worry about anybody else doing something over the
network.

As such, NULL pointers can often be the _default_ rather than being a
sign of error cases. And the NULL case may be the fast and
timing-sensitive one. This is true of the dcache hashing stuff, for
example, where there are special (and slow) routines for certain
filesystems that want to do stupid name mangling.

Linus

-
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.altern.org/andrebalsa/doc/lkml-faq.html