diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2020-02-27 06:37:15 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 07:07:25 +0300 |
commit | b8f33e5d76a7a1b87e0cc760d05bf2477b4e91d6 (patch) | |
tree | ebe85d5298d71865ff7ac2ddb4d6d4292b5a28bd /include/linux/device.h | |
parent | 2c4f9401ceb00167a3bfd322a28aa87b646a253f (diff) | |
download | linux-b8f33e5d76a7a1b87e0cc760d05bf2477b4e91d6.tar.xz |
device: add device_change_owner()
Add a helper to change the owner of a device's sysfs entries. This
needs to happen when the ownership of a device is changed, e.g. when
moving network devices between network namespaces.
This function will be used to correctly account for 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/device.h')
-rw-r--r-- | include/linux/device.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 0cd7c647c16c..3e40533d2037 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -817,6 +817,7 @@ extern struct device *device_find_child_by_name(struct device *parent, extern int device_rename(struct device *dev, const char *new_name); extern int device_move(struct device *dev, struct device *new_parent, enum dpm_order dpm_order); +extern int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid); extern const char *device_get_devnode(struct device *dev, umode_t *mode, kuid_t *uid, kgid_t *gid, const char **tmp); |