Re: [PATCH 5/7] sysfs: make sysfs_add/remove_one() call link/unlink_sibling() implictly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Jul 2007 19:15:08 +0900,
Tejun Heo <[email protected]> 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 <[email protected]>
> ---
>  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 <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux