[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070731151311.1e02626b@gondolin.boeblingen.de.ibm.com>
Date: Tue, 31 Jul 2007 15:13:11 +0200
From: Cornelia Huck <cornelia.huck@...ibm.com>
To: Tejun Heo <htejun@...il.com>
Cc: ebiederm@...ssion.com, gregkh@...e.de,
linux-kernel@...r.kernel.org, satyam@...radead.org,
stern@...land.harvard.edu
Subject: Re: [PATCH 5/7] sysfs: make sysfs_add/remove_one() call
link/unlink_sibling() implictly
On Tue, 31 Jul 2007 19:15:08 +0900,
Tejun Heo <htejun@...il.com> wrote:
> When adding or removing a sysfs_dirent, the user used to be required
> to call link/unlink separately. It was for two reasons - code looked
> like that before sysfs_addrm_cxt conversion and to avoid looping
> through parent_sd->children list twice during removal.
>
> Performance optimization during removal just isn't worth it. Make
> sysfs_add/remove_one() call sysfs_link/unlink_sibing() implicitly.
> This makes code simpler albeit slightly less efficient. This change
> doesn't introduce any noticeable behavior change.
>
> Signed-off-by: Tejun Heo <htejun@...il.com>
> ---
> fs/sysfs/dir.c | 21 ++++++++++-----------
> fs/sysfs/file.c | 4 +---
> fs/sysfs/inode.c | 17 ++++-------------
> fs/sysfs/symlink.c | 4 +---
> fs/sysfs/sysfs.h | 2 --
> 5 files changed, 16 insertions(+), 32 deletions(-)
>
I agree. The double loop in the removal path doesn't really hurt, and
the code is now much nicer.
Acked-by: Cornelia Huck <cornelia.huck@...ibm.com>
-
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