diff options
author | 2020-02-27 04:37:12 +0100 | |
---|---|---|
committer | 2020-02-26 20:07:25 -0800 | |
commit | 0666a3aee762cd4f7981c2eed0fd8cab87533539 (patch) | |
tree | 777513bd25867a6d981901eb0987fb90fcdd68ee /include | |
parent | sysfs: add sysfs_file_change_owner() (diff) | |
download | linux-0666a3aee762cd4f7981c2eed0fd8cab87533539.tar.gz linux-0666a3aee762cd4f7981c2eed0fd8cab87533539.tar.bz2 linux-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')
-rw-r--r-- | include/linux/sysfs.h | 10 |
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, |