lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmail.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@gmail.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@de.ibm.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-31 15:17    [W:0.093 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site