Whamcloud - gitweb
LU-4423 lustre: don't declare extern variables in C files.
[fs/lustre-release.git] / lustre / ldlm / ldlm_pool.c
index 3e74a40..3c518aa 100644 (file)
  */
 #define LDLM_POOL_SLV_SHIFT (10)
 
-extern struct proc_dir_entry *ldlm_ns_proc_dir;
-
 static inline __u64 dru(__u64 val, __u32 shift, int round_up)
 {
        return (val + (round_up ? (1 << shift) - 1 : 0)) >> shift;
@@ -789,20 +787,15 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
        struct ldlm_namespace *ns = ldlm_pl2ns(pl);
        struct dentry *debugfs_ns_parent;
        struct lprocfs_vars pool_vars[2];
-       char *var_name = NULL;
        int rc = 0;
 
        ENTRY;
 
-       OBD_ALLOC(var_name, MAX_STRING_SIZE + 1);
-       if (!var_name)
-               RETURN(-ENOMEM);
-
        debugfs_ns_parent = ns->ns_debugfs_entry;
        if (IS_ERR_OR_NULL(debugfs_ns_parent)) {
                CERROR("%s: debugfs entry is not initialized\n",
                       ldlm_ns_name(ns));
-               GOTO(out_free_name, rc = -EINVAL);
+               GOTO(out, rc = -EINVAL);
        }
        pl->pl_debugfs_entry = ldebugfs_register("pool", debugfs_ns_parent,
                                                 NULL, NULL);
@@ -811,12 +804,10 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
                pl->pl_debugfs_entry = NULL;
                CERROR("%s: cannot create 'pool' debugfs entry: rc = %d\n",
                       ldlm_ns_name(ns), rc);
-               GOTO(out_free_name, rc);
+               GOTO(out, rc);
        }
 
-       var_name[MAX_STRING_SIZE] = '\0';
        memset(pool_vars, 0, sizeof(pool_vars));
-       pool_vars[0].name = var_name;
 
        ldlm_add_var(&pool_vars[0], pl->pl_debugfs_entry, "state", pl,
                     &lprocfs_pool_state_fops);
@@ -824,7 +815,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
        pl->pl_stats = lprocfs_alloc_stats(LDLM_POOL_LAST_STAT -
                                           LDLM_POOL_FIRST_STAT, 0);
        if (!pl->pl_stats)
-               GOTO(out_free_name, rc = -ENOMEM);
+               GOTO(out, rc = -ENOMEM);
 
        lprocfs_counter_init(pl->pl_stats, LDLM_POOL_GRANTED_STAT,
                             LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV,
@@ -863,8 +854,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
                                     pl->pl_stats);
 
        EXIT;
-out_free_name:
-       OBD_FREE(var_name, MAX_STRING_SIZE + 1);
+out:
        return rc;
 }