Re: [PATCH 5/7] sysfs: make sysfs_add/remove_one() calllink/unlink_sibling() implictly
From: Cornelia Huck
Date: Tue Jul 31 2007 - 09:15:01 EST
On Tue, 31 Jul 2007 19:15:08 +0900,
Tejun Heo <htejun@xxxxxxxxx> 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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/