[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91b13c310707242129u6aa09166j74ad42d31adc4ad7@mail.gmail.com>
Date: Wed, 25 Jul 2007 12:29:17 +0800
From: "rae l" <crquan@...il.com>
To: "Al Viro" <viro@....linux.org.uk>
Cc: "Alexander Viro" <viro@...iv.linux.org.uk>,
linux-kernel@...r.kernel.org, "Greg Kroah-Hartman" <gregkh@...e.de>
Subject: Re: [RFC] fs/super.c: Why alloc_super use a static variable default_op?
On 7/25/07, Al Viro <viro@....linux.org.uk> wrote:
> On Wed, Jul 25, 2007 at 11:48:35AM +0800, rae l wrote:
> > Why alloc_super use a static variable default_op?
> > the static struct super_operations default_op is just all zeros, and
> > just referenced as the initial value of a new allocated super_block,
> > what does it for?
>
> So that we would not have to care about ->s_op *ever* being NULL.
But is it valuable? Compared to a waste of sizeof(struct super_block)
bytes memory.
When some code want to refer fs_type->s_op, it almost always want to
refer some function pointer in s_op with fs_type->s_op->***, but all
pointers in default_op are all NULLs, what about this scenario?
and if you do grep s_op in the source code, you will found nowhere
will want to test s_op or dependent on s_op not NULL.
So my opinion is to remove default_ops, just keep new allocated s_op NULL.
>
--
Denis Cheng
Linux Application Developer
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists