sysfs: make kobj point to sysfs_dirent instead of dentry
As kobj sysfs dentries and inodes are gonna be made reclaimable, dentry can't be used as naming token for sysfs file/directory, replace kobj->dentry with kobj->sd. The only external interface change is shadow directory handling. All other changes are contained in kobj and sysfs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f0b0af4792
commit
608e266a2d
@@ -234,9 +234,9 @@ const struct file_operations bin_fops = {
|
||||
|
||||
int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr)
|
||||
{
|
||||
BUG_ON(!kobj || !kobj->dentry || !attr);
|
||||
BUG_ON(!kobj || !kobj->sd || !attr);
|
||||
|
||||
return sysfs_add_file(kobj->dentry, &attr->attr, SYSFS_KOBJ_BIN_ATTR);
|
||||
return sysfs_add_file(kobj->sd, &attr->attr, SYSFS_KOBJ_BIN_ATTR);
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr)
|
||||
|
||||
void sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr)
|
||||
{
|
||||
if (sysfs_hash_and_remove(kobj->dentry, attr->attr.name) < 0) {
|
||||
if (sysfs_hash_and_remove(kobj->sd, attr->attr.name) < 0) {
|
||||
printk(KERN_ERR "%s: "
|
||||
"bad dentry or inode or no such file: \"%s\"\n",
|
||||
__FUNCTION__, attr->attr.name);
|
||||
|
Reference in New Issue
Block a user