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/