Fix in-kernel sysfs entries

The recent sysfs zfs properties feature breaks the in-kernel
builds of zfs (sans module).  When not built as a module add
the sysfs entries under /sys/fs/zfs/.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes #7868 
Closes #7872
This commit is contained in:
Don Brady
2018-09-06 22:44:52 -06:00
committed by Brian Behlendorf
parent e7b677aa5d
commit 73a5ec30bf
4 changed files with 40 additions and 30 deletions
+8 -3
View File
@@ -572,11 +572,16 @@ zfs_sysfs_properties_init(zfs_mod_kobj_t *zfs_kobj, struct kobject *parent,
void
zfs_sysfs_init(void)
{
struct kobject *parent =
&(((struct module *)(THIS_MODULE))->mkobj).kobj;
struct kobject *parent;
#if defined(CONFIG_ZFS) && !defined(CONFIG_ZFS_MODULE)
parent = kobject_create_and_add("zfs", fs_kobj);
#else
parent = &(((struct module *)(THIS_MODULE))->mkobj).kobj;
#endif
int err;
ASSERT(parent != NULL);
if (parent == NULL)
return;
err = zfs_kernel_features_init(&kernel_features_kobj, parent);
if (err)