Commit f4f8407f authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/fid: Get rid of lcs_srv in lu_client_seq

Since we know lcs_srv is always NULL, just get rid of it completely
and fix up all the code to assumee it was never there.
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 997f0eed
...@@ -150,19 +150,15 @@ int seq_client_alloc_super(struct lu_client_seq *seq, ...@@ -150,19 +150,15 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
if (seq->lcs_srv) { /* Check whether the connection to seq controller has been
rc = 0; * setup (lcs_exp != NULL) */
} else { if (!seq->lcs_exp) {
/* Check whether the connection to seq controller has been mutex_unlock(&seq->lcs_mutex);
* setup (lcs_exp != NULL) */ return -EINPROGRESS;
if (seq->lcs_exp == NULL) {
mutex_unlock(&seq->lcs_mutex);
return -EINPROGRESS;
}
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_SUPER, "super");
} }
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_SUPER, "super");
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
return rc; return rc;
} }
...@@ -173,18 +169,14 @@ static int seq_client_alloc_meta(const struct lu_env *env, ...@@ -173,18 +169,14 @@ static int seq_client_alloc_meta(const struct lu_env *env,
{ {
int rc; int rc;
if (seq->lcs_srv) { do {
rc = 0; /* If meta server return -EINPROGRESS or EAGAIN,
} else { * it means meta server might not be ready to
do { * allocate super sequence from sequence controller
/* If meta server return -EINPROGRESS or EAGAIN, * (MDT0)yet */
* it means meta server might not be ready to rc = seq_client_rpc(seq, &seq->lcs_space,
* allocate super sequence from sequence controller SEQ_ALLOC_META, "meta");
* (MDT0)yet */ } while (rc == -EINPROGRESS || rc == -EAGAIN);
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
} while (rc == -EINPROGRESS || rc == -EAGAIN);
}
return rc; return rc;
} }
...@@ -395,8 +387,6 @@ static void seq_client_fini(struct lu_client_seq *seq) ...@@ -395,8 +387,6 @@ static void seq_client_fini(struct lu_client_seq *seq)
class_export_put(seq->lcs_exp); class_export_put(seq->lcs_exp);
seq->lcs_exp = NULL; seq->lcs_exp = NULL;
} }
seq->lcs_srv = NULL;
} }
static int seq_client_init(struct lu_client_seq *seq, static int seq_client_init(struct lu_client_seq *seq,
...@@ -409,7 +399,6 @@ static int seq_client_init(struct lu_client_seq *seq, ...@@ -409,7 +399,6 @@ static int seq_client_init(struct lu_client_seq *seq,
LASSERT(seq != NULL); LASSERT(seq != NULL);
LASSERT(prefix != NULL); LASSERT(prefix != NULL);
seq->lcs_srv = NULL;
seq->lcs_type = type; seq->lcs_type = type;
mutex_init(&seq->lcs_mutex); mutex_init(&seq->lcs_mutex);
...@@ -422,10 +411,7 @@ static int seq_client_init(struct lu_client_seq *seq, ...@@ -422,10 +411,7 @@ static int seq_client_init(struct lu_client_seq *seq,
/* Make sure that things are clear before work is started. */ /* Make sure that things are clear before work is started. */
seq_client_flush(seq); seq_client_flush(seq);
if (exp != NULL) seq->lcs_exp = class_export_get(exp);
seq->lcs_exp = class_export_get(exp);
else if (type == LUSTRE_SEQ_METADATA)
LASSERT(seq->lcs_srv != NULL);
snprintf(seq->lcs_name, sizeof(seq->lcs_name), snprintf(seq->lcs_name, sizeof(seq->lcs_name),
"cli-%s", prefix); "cli-%s", prefix);
......
...@@ -204,8 +204,6 @@ ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused) ...@@ -204,8 +204,6 @@ ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused)
if (seq->lcs_exp != NULL) { if (seq->lcs_exp != NULL) {
cli = &seq->lcs_exp->exp_obd->u.cli; cli = &seq->lcs_exp->exp_obd->u.cli;
seq_printf(m, "%s\n", cli->cl_target_uuid.uuid); seq_printf(m, "%s\n", cli->cl_target_uuid.uuid);
} else {
seq_printf(m, "%s\n", seq->lcs_srv->lss_name);
} }
return 0; return 0;
......
...@@ -330,8 +330,6 @@ enum lu_mgr_type { ...@@ -330,8 +330,6 @@ enum lu_mgr_type {
LUSTRE_SEQ_CONTROLLER LUSTRE_SEQ_CONTROLLER
}; };
struct lu_server_seq;
/* Client sequence manager interface. */ /* Client sequence manager interface. */
struct lu_client_seq { struct lu_client_seq {
/* Sequence-controller export. */ /* Sequence-controller export. */
...@@ -366,9 +364,6 @@ struct lu_client_seq { ...@@ -366,9 +364,6 @@ struct lu_client_seq {
*/ */
__u64 lcs_width; __u64 lcs_width;
/* Seq-server for direct talking */
struct lu_server_seq *lcs_srv;
/* wait queue for fid allocation and update indicator */ /* wait queue for fid allocation and update indicator */
wait_queue_head_t lcs_waitq; wait_queue_head_t lcs_waitq;
int lcs_update; int lcs_update;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment