Whamcloud - gitweb
LU-12635 build: Support for gcc -Wimplicit-fallthrough
[fs/lustre-release.git] / lustre / lod / lod_dev.c
index 98c1369..8d9c1ef 100644 (file)
@@ -1320,8 +1320,8 @@ static void lod_statfs_sum(struct obd_statfs *sfs,
  *
  * see include/dt_object.h for the details.
  */
-static int lod_statfs(const struct lu_env *env,
-                     struct dt_device *dev, struct obd_statfs *sfs)
+static int lod_statfs(const struct lu_env *env, struct dt_device *dev,
+                     struct obd_statfs *sfs, struct obd_statfs_info *info)
 {
        struct lod_device *lod = dt2lod_dev(dev);
        struct lod_ost_desc *ost;
@@ -2227,9 +2227,6 @@ static struct obd_type *sym;
 
 static int __init lod_init(void)
 {
-       struct dentry *symlink;
-       struct obd_type *type;
-       struct qstr dname;
        int rc;
 
        rc = lu_kmem_init(lod_caches);
@@ -2243,55 +2240,23 @@ static int __init lod_init(void)
                return rc;
        }
 
-       sym = class_setup_tunables(LUSTRE_LOV_NAME);
+       /* create "lov" entry for compatibility purposes */
+       sym = class_add_symlinks(LUSTRE_LOV_NAME, true);
        if (IS_ERR(sym)) {
                rc = PTR_ERR(sym);
                /* does real "lov" already exist ? */
                if (rc == -EEXIST)
-                       GOTO(try_proc, rc = 0);
-               GOTO(no_lov, rc);
-       }
-
-       /* create "lov" entry for compatibility purposes */
-       dname.name = "lov";
-       dname.len = strlen(dname.name);
-       dname.hash = ll_full_name_hash(debugfs_lustre_root, dname.name,
-                                      dname.len);
-       symlink = d_lookup(debugfs_lustre_root, &dname);
-       if (!symlink) {
-               symlink = debugfs_create_dir(dname.name, debugfs_lustre_root);
-               if (IS_ERR_OR_NULL(symlink)) {
-                       rc = symlink ? PTR_ERR(symlink) : -ENOMEM;
-                       GOTO(no_lov, rc);
-               }
-               sym->typ_debugfs_entry = symlink;
-       } else {
-               dput(symlink);
+                       rc = 0;
        }
 
-try_proc:
-       type = class_search_type(LUSTRE_LOV_NAME);
-       if (type && type->typ_procroot)
-               GOTO(no_lov, rc);
-
-       type = class_search_type(LUSTRE_LOD_NAME);
-       type->typ_procsym = lprocfs_register("lov", proc_lustre_root,
-                                            NULL, NULL);
-       if (IS_ERR(type->typ_procsym)) {
-               CERROR("lod: can't create compat entry \"lov\": %d\n",
-                      (int)PTR_ERR(type->typ_procsym));
-               type->typ_procsym = NULL;
-       }
-no_lov:
        return rc;
 }
 
 static void __exit lod_exit(void)
 {
-       if (!IS_ERR_OR_NULL(sym)) {
-               ldebugfs_remove(&sym->typ_debugfs_entry);
+       if (!IS_ERR_OR_NULL(sym))
                kobject_put(&sym->typ_kobj);
-       }
+
        class_unregister_type(LUSTRE_LOD_NAME);
        lu_kmem_fini(lod_caches);
 }