• Tejun Heo's avatar
    sysfs, kernfs: introduce kernfs_setattr() · 5d60418e
    Tejun Heo authored
    Introduce kernfs setattr interface - kernfs_setattr().
    sysfs_sd_setattr() is renamed to __kernfs_setattr() and
    kernfs_setattr() is a simple wrapper around it with sysfs_mutex
    locking.  sysfs_chmod_file() is updated to get an explicit ref on
    kobj->sd and then invoke kernfs_setattr() so that it doesn't have to
    use internal interface.
    This patch doesn't introduce any behavior differences.
    v2: Dummy implementation for !CONFIG_SYSFS updated to return -ENOSYS.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>