kernfs: drop s_ prefix from kernfs_node members
kernfs has just been separated out from sysfs and we're already in full conflict mode. Nothing can make the situation any worse. Let's take the chance to name things properly. s_ prefix for kernfs members is used inconsistently and a misnomer now. It's not like kernfs_node is used widely across the kernel making the ability to grep for the members particularly useful. Let's just drop the prefix. This patch is strictly rename only and doesn't introduce any functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
324a56e16e
commit
adc5e8b58f
@@ -29,11 +29,11 @@ DEFINE_SPINLOCK(sysfs_symlink_target_lock);
|
||||
*/
|
||||
static char *sysfs_pathname(struct kernfs_node *kn, char *path)
|
||||
{
|
||||
if (kn->s_parent) {
|
||||
sysfs_pathname(kn->s_parent, path);
|
||||
if (kn->parent) {
|
||||
sysfs_pathname(kn->parent, path);
|
||||
strlcat(path, "/", PATH_MAX);
|
||||
}
|
||||
strlcat(path, kn->s_name, PATH_MAX);
|
||||
strlcat(path, kn->name, PATH_MAX);
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void sysfs_remove_dir(struct kobject *kobj)
|
||||
int sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
|
||||
const void *new_ns)
|
||||
{
|
||||
struct kernfs_node *parent = kobj->sd->s_parent;
|
||||
struct kernfs_node *parent = kobj->sd->parent;
|
||||
|
||||
return kernfs_rename_ns(kobj->sd, parent, new_name, new_ns);
|
||||
}
|
||||
@@ -132,9 +132,9 @@ int sysfs_move_dir_ns(struct kobject *kobj, struct kobject *new_parent_kobj,
|
||||
struct kernfs_node *kn = kobj->sd;
|
||||
struct kernfs_node *new_parent;
|
||||
|
||||
BUG_ON(!kn->s_parent);
|
||||
BUG_ON(!kn->parent);
|
||||
new_parent = new_parent_kobj && new_parent_kobj->sd ?
|
||||
new_parent_kobj->sd : sysfs_root_kn;
|
||||
|
||||
return kernfs_rename_ns(kn, new_parent, kn->s_name, new_ns);
|
||||
return kernfs_rename_ns(kn, new_parent, kn->name, new_ns);
|
||||
}
|
||||
|
@@ -27,9 +27,9 @@
|
||||
*/
|
||||
static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn)
|
||||
{
|
||||
struct kobject *kobj = kn->s_parent->priv;
|
||||
struct kobject *kobj = kn->parent->priv;
|
||||
|
||||
if (kn->s_flags & SYSFS_FLAG_LOCKDEP)
|
||||
if (kn->flags & SYSFS_FLAG_LOCKDEP)
|
||||
lockdep_assert_held(kn);
|
||||
return kobj->ktype ? kobj->ktype->sysfs_ops : NULL;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn)
|
||||
static int sysfs_kf_seq_show(struct seq_file *sf, void *v)
|
||||
{
|
||||
struct sysfs_open_file *of = sf->private;
|
||||
struct kobject *kobj = of->kn->s_parent->priv;
|
||||
struct kobject *kobj = of->kn->parent->priv;
|
||||
const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
|
||||
ssize_t count;
|
||||
char *buf;
|
||||
@@ -82,7 +82,7 @@ static ssize_t sysfs_kf_bin_read(struct sysfs_open_file *of, char *buf,
|
||||
size_t count, loff_t pos)
|
||||
{
|
||||
struct bin_attribute *battr = of->kn->priv;
|
||||
struct kobject *kobj = of->kn->s_parent->priv;
|
||||
struct kobject *kobj = of->kn->parent->priv;
|
||||
loff_t size = file_inode(of->file)->i_size;
|
||||
|
||||
if (!count)
|
||||
@@ -106,7 +106,7 @@ static ssize_t sysfs_kf_write(struct sysfs_open_file *of, char *buf,
|
||||
size_t count, loff_t pos)
|
||||
{
|
||||
const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
|
||||
struct kobject *kobj = of->kn->s_parent->priv;
|
||||
struct kobject *kobj = of->kn->parent->priv;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
@@ -119,7 +119,7 @@ static ssize_t sysfs_kf_bin_write(struct sysfs_open_file *of, char *buf,
|
||||
size_t count, loff_t pos)
|
||||
{
|
||||
struct bin_attribute *battr = of->kn->priv;
|
||||
struct kobject *kobj = of->kn->s_parent->priv;
|
||||
struct kobject *kobj = of->kn->parent->priv;
|
||||
loff_t size = file_inode(of->file)->i_size;
|
||||
|
||||
if (size) {
|
||||
@@ -140,7 +140,7 @@ static int sysfs_kf_bin_mmap(struct sysfs_open_file *of,
|
||||
struct vm_area_struct *vma)
|
||||
{
|
||||
struct bin_attribute *battr = of->kn->priv;
|
||||
struct kobject *kobj = of->kn->s_parent->priv;
|
||||
struct kobject *kobj = of->kn->parent->priv;
|
||||
|
||||
return battr->mmap(of->file, kobj, battr, vma);
|
||||
}
|
||||
@@ -345,7 +345,7 @@ int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr,
|
||||
if (!kn)
|
||||
return -ENOENT;
|
||||
|
||||
newattrs.ia_mode = (mode & S_IALLUGO) | (kn->s_mode & ~S_IALLUGO);
|
||||
newattrs.ia_mode = (mode & S_IALLUGO) | (kn->mode & ~S_IALLUGO);
|
||||
newattrs.ia_valid = ATTR_MODE;
|
||||
|
||||
rc = kernfs_setattr(kn, &newattrs);
|
||||
|
@@ -129,7 +129,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
|
||||
*/
|
||||
spin_lock(&sysfs_symlink_target_lock);
|
||||
if (targ->sd && kernfs_ns_enabled(kobj->sd))
|
||||
ns = targ->sd->s_ns;
|
||||
ns = targ->sd->ns;
|
||||
spin_unlock(&sysfs_symlink_target_lock);
|
||||
kernfs_remove_by_name_ns(kobj->sd, name, ns);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
|
||||
parent = kobj->sd;
|
||||
|
||||
if (targ->sd)
|
||||
old_ns = targ->sd->s_ns;
|
||||
old_ns = targ->sd->ns;
|
||||
|
||||
result = -ENOENT;
|
||||
kn = kernfs_find_and_get_ns(parent, old, old_ns);
|
||||
@@ -185,7 +185,7 @@ int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
|
||||
result = -EINVAL;
|
||||
if (sysfs_type(kn) != SYSFS_KOBJ_LINK)
|
||||
goto out;
|
||||
if (kn->s_symlink.target_kn->priv != targ)
|
||||
if (kn->symlink.target_kn->priv != targ)
|
||||
goto out;
|
||||
|
||||
result = kernfs_rename_ns(kn, parent, new, new_ns);
|
||||
|
Reference in New Issue
Block a user