OSDN Git Service

sysfs: Add sysfs_update_groups function
authorJiri Olsa <jolsa@kernel.org>
Sun, 12 May 2019 15:55:10 +0000 (17:55 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 3 Jun 2019 09:58:20 +0000 (11:58 +0200)
commitaac1f7f95f115d5a5329be05b80022e72df7d080
tree85a5b4d0b54b418b8a1ba7c1f7aa769508c61a1f
parent6e86d3db5f8fb69eea76cc496c3c3da19c855aa9
sysfs: Add sysfs_update_groups function

Adding sysfs_update_groups function to update
multiple groups.

  sysfs_update_groups - given a directory kobject, create a bunch of attribute groups
  @kobj:      The kobject to update the group on
  @groups:    The attribute groups to update, NULL terminated

This function update a bunch of attribute groups.  If an error occurs when
updating a group, all previously updated groups will be removed together
with already existing (not updated) attributes.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190512155518.21468-2-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
fs/sysfs/group.c
include/linux/sysfs.h