[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVxJT98EJvw1E+o6mpu8ugMz3Ztqz7pJOwZeZW9A41P0AhB_g@mail.gmail.com>
Date: Fri, 3 Oct 2014 13:55:51 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: netdev <netdev@...r.kernel.org>,
Linux Kernel <linux-kernel@...r.kernel.org>,
David Miller <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>,
rui.xiang@...wei.com, Al Viro <viro@...iv.linux.org.uk>,
Oleg Nesterov <oleg@...hat.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
kirill.shutemov@...ux.intel.com,
Grant Likely <grant.likely@...retlab.ca>,
"Theodore Ts'o" <tytso@....edu>,
Thierry Herbelot <thierry.herbelot@...nd.com>
Subject: Re: [RFC PATCH linux 2/2] fs/proc: use a hash table for the directory entries
On Thu, Oct 2, 2014 at 6:25 PM, Nicolas Dichtel
<nicolas.dichtel@...nd.com> wrote:
> --- a/fs/proc/generic.c
> +++ b/fs/proc/generic.c
> @@ -81,10 +81,13 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
> + if (!S_ISDIR(de->mode))
> + return -EINVAL;
There are way too many S_ISDIR checks.
In lookup and readdir, it is guaranteed that PDE is directory.
I'd say all of them aren't needed because non-directories have
->subdir = NULL and
directories have ->subdir != NULL which transforms into hashtable or
rbtree or whatever,
so you only need to guarantee only directories appear where they are
expected and
fearlessly use your new data structure traversing directories.
Alexey
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists