aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorChristian Brauner <christian.brauner@ubuntu.com>2020-02-27 04:37:12 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-26 20:07:25 -0800
commit0666a3aee762cd4f7981c2eed0fd8cab87533539 (patch)
tree777513bd25867a6d981901eb0987fb90fcdd68ee /include/linux/sysfs.h
parentsysfs: add sysfs_file_change_owner() (diff)
downloadlinux-dev-0666a3aee762cd4f7981c2eed0fd8cab87533539.tar.xz
linux-dev-0666a3aee762cd4f7981c2eed0fd8cab87533539.zip
sysfs: add sysfs_link_change_owner()
Add a helper to change the owner of a sysfs link. This function will be used to correctly account for kobject ownership changes, e.g. when moving network devices between network namespaces. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index a7884024a911..7e15ebfd750e 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -312,6 +312,8 @@ static inline void sysfs_enable_ns(struct kernfs_node *kn)
int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
kgid_t kgid);
+int sysfs_link_change_owner(struct kobject *kobj, struct kobject *targ,
+ const char *name, kuid_t kuid, kgid_t kgid);
#else /* CONFIG_SYSFS */
@@ -532,6 +534,14 @@ static inline int sysfs_file_change_owner(struct kobject *kobj,
return 0;
}
+static inline int sysfs_link_change_owner(struct kobject *kobj,
+ struct kobject *targ,
+ const char *name, kuid_t kuid,
+ kgid_t kgid)
+{
+ return 0;
+}
+
#endif /* CONFIG_SYSFS */
static inline int __must_check sysfs_create_file(struct kobject *kobj,