Commit d5bf5cf9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

staging: lustre: make ldebugfs_add_vars a void function



The call to ldebugfs_add_vars() can not really fail, so have it just
return nothing, which allows us to clean up a lot of unused error
handling code.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Roman Storozhenko <romeusmeister@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Aastha Gupta <aastha.gupta4104@gmail.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Frank Zago <fzago@cray.com>
Cc: Patrick Farrell <paf@cray.com>
Cc: Simo Koskinen <koskisoft@gmail.com>
Cc: Andriy Skulysh <andriy.skulysh@seagate.com>
Cc: "John L. Hammond" <john.hammond@intel.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00905f00
Loading
Loading
Loading
Loading
+7 −30
Original line number Diff line number Diff line
@@ -295,26 +295,12 @@ static void seq_client_debugfs_fini(struct lu_client_seq *seq)
		ldebugfs_remove(&seq->lcs_debugfs_entry);
}

static int seq_client_debugfs_init(struct lu_client_seq *seq)
static void seq_client_debugfs_init(struct lu_client_seq *seq)
{
	int rc;

	seq->lcs_debugfs_entry = debugfs_create_dir(seq->lcs_name,
						    seq_debugfs_dir);

	rc = ldebugfs_add_vars(seq->lcs_debugfs_entry,
			       seq_client_debugfs_list, seq);
	if (rc) {
		CERROR("%s: Can't init sequence manager debugfs, rc %d\n",
		       seq->lcs_name, rc);
		goto out_cleanup;
	}

	return 0;

out_cleanup:
	seq_client_debugfs_fini(seq);
	return rc;
	ldebugfs_add_vars(seq->lcs_debugfs_entry, seq_client_debugfs_list, seq);
}

static void seq_client_fini(struct lu_client_seq *seq)
@@ -327,13 +313,9 @@ static void seq_client_fini(struct lu_client_seq *seq)
	}
}

static int seq_client_init(struct lu_client_seq *seq,
			   struct obd_export *exp,
			   enum lu_cli_type type,
			   const char *prefix)
static void seq_client_init(struct lu_client_seq *seq, struct obd_export *exp,
			    enum lu_cli_type type, const char *prefix)
{
	int rc;

	LASSERT(seq);
	LASSERT(prefix);

@@ -354,10 +336,7 @@ static int seq_client_init(struct lu_client_seq *seq,
	snprintf(seq->lcs_name, sizeof(seq->lcs_name),
		 "cli-%s", prefix);

	rc = seq_client_debugfs_init(seq);
	if (rc)
		seq_client_fini(seq);
	return rc;
	seq_client_debugfs_init(seq);
}

int client_fid_init(struct obd_device *obd,
@@ -380,12 +359,10 @@ int client_fid_init(struct obd_device *obd,
	snprintf(prefix, MAX_OBD_NAME + 5, "cli-%s", obd->obd_name);

	/* Init client side sequence-manager */
	rc = seq_client_init(cli->cl_seq, exp, type, prefix);
	seq_client_init(cli->cl_seq, exp, type, prefix);
	kfree(prefix);
	if (rc)
		goto out_free_seq;

	return rc;
	return 0;
out_free_seq:
	kfree(cli->cl_seq);
	cli->cl_seq = NULL;
+6 −24
Original line number Diff line number Diff line
@@ -217,25 +217,12 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)

static struct dentry *fld_debugfs_dir;

static int fld_client_debugfs_init(struct lu_client_fld *fld)
static void fld_client_debugfs_init(struct lu_client_fld *fld)
{
	int rc;

	fld->lcf_debugfs_entry = debugfs_create_dir(fld->lcf_name,
						    fld_debugfs_dir);

	rc = ldebugfs_add_vars(fld->lcf_debugfs_entry,
			       fld_client_debugfs_list, fld);
	if (rc) {
		CERROR("%s: Can't init FLD debufs, rc %d\n", fld->lcf_name, rc);
		goto out_cleanup;
	}

	return 0;

out_cleanup:
	fld_client_debugfs_fini(fld);
	return rc;
	ldebugfs_add_vars(fld->lcf_debugfs_entry, fld_client_debugfs_list, fld);
}

void fld_client_debugfs_fini(struct lu_client_fld *fld)
@@ -254,7 +241,7 @@ int fld_client_init(struct lu_client_fld *fld,
		    const char *prefix, int hash)
{
	int cache_size, cache_threshold;
	int rc;
	int rc = 0;

	snprintf(fld->lcf_name, sizeof(fld->lcf_name),
		 "cli-%s", prefix);
@@ -284,13 +271,8 @@ int fld_client_init(struct lu_client_fld *fld,
		goto out;
	}

	rc = fld_client_debugfs_init(fld);
	if (rc)
		goto out;
	fld_client_debugfs_init(fld);
out:
	if (rc)
		fld_client_fini(fld);
	else
	CDEBUG(D_INFO, "%s: Using \"%s\" hash\n",
	       fld->lcf_name, fld->lcf_hash->fh_name);
	return rc;
+2 −3
Original line number Diff line number Diff line
@@ -450,8 +450,7 @@ int lprocfs_exp_cleanup(struct obd_export *exp);
extern const struct file_operations lprocfs_stats_seq_fops;

/* lprocfs_status.c */
int ldebugfs_add_vars(struct dentry *parent,
		      struct lprocfs_vars *var,
void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var,
		       void *data);

void ldebugfs_remove(struct dentry **entryp);
+1 −1
Original line number Diff line number Diff line
@@ -1185,7 +1185,7 @@ void ldlm_namespace_free_prior(struct ldlm_namespace *ns,
void ldlm_namespace_free_post(struct ldlm_namespace *ns);
void ldlm_namespace_get(struct ldlm_namespace *ns);
void ldlm_namespace_put(struct ldlm_namespace *ns);
int ldlm_debugfs_setup(void);
void ldlm_debugfs_setup(void);
void ldlm_debugfs_cleanup(void);

/* resource.c - internal */
+1 −3
Original line number Diff line number Diff line
@@ -979,9 +979,7 @@ static int ldlm_setup(void)
		goto out;
	}

	rc = ldlm_debugfs_setup();
	if (rc != 0)
		goto out;
	ldlm_debugfs_setup();

	memset(&conf, 0, sizeof(conf));
	conf = (typeof(conf)) {
Loading