Commit c4f4e135 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland
Browse files

fs: dlm: get recovery sequence number as parameter



This patch removes a read of the ls->ls_recover_seq uint64_t number in
_create_rcom(). If the ls->ls_recover_seq is readed the ls_recover_lock
need to held. However this number was always readed before when any rcom
message is received and it's not necessary to read it again from a per
lockspace variable to use it for the replying message. This patch will
pass the sequence number as parameter so another read of ls->ls_recover_seq
and holding the ls->ls_recover_lock is not required.

Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 643f5cfa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ void dlm_recover_dir_nodeid(struct dlm_ls *ls)
	up_read(&ls->ls_root_sem);
}

int dlm_recover_directory(struct dlm_ls *ls)
int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq)
{
	struct dlm_member *memb;
	char *b, *last_name = NULL;
@@ -90,7 +90,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
			}

			error = dlm_rcom_names(ls, memb->nodeid,
					       last_name, last_len);
					       last_name, last_len, seq);
			if (error)
				goto out_free;

+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
int dlm_dir_nodeid(struct dlm_rsb *rsb);
int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash);
void dlm_recover_dir_nodeid(struct dlm_ls *ls);
int dlm_recover_directory(struct dlm_ls *ls);
int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq);
void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
	char *outbuf, int outlen, int nodeid);

+3 −2
Original line number Diff line number Diff line
@@ -5464,7 +5464,8 @@ int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
}

/* needs at least dlm_rcom + rcom_lock */
int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc,
			     uint64_t seq)
{
	struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf;
	struct dlm_rsb *r;
@@ -5509,7 +5510,7 @@ int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
			  lkid, le32_to_cpu(rc->rc_header.h_nodeid), remid,
			  result);
	
		dlm_send_rcom_lock(r, lkb);
		dlm_send_rcom_lock(r, lkb, seq);
		goto out;
	case -EEXIST:
	case 0:
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ void dlm_recover_grant(struct dlm_ls *ls);
int dlm_recover_waiters_post(struct dlm_ls *ls);
void dlm_recover_waiters_pre(struct dlm_ls *ls);
int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc,
			     uint64_t seq);

int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
	uint32_t flags, void *name, unsigned int namelen);
+3 −3
Original line number Diff line number Diff line
@@ -449,7 +449,7 @@ static void make_member_array(struct dlm_ls *ls)

/* send a status request to all members just to establish comms connections */

static int ping_members(struct dlm_ls *ls)
static int ping_members(struct dlm_ls *ls, uint64_t seq)
{
	struct dlm_member *memb;
	int error = 0;
@@ -459,7 +459,7 @@ static int ping_members(struct dlm_ls *ls)
			error = -EINTR;
			break;
		}
		error = dlm_rcom_status(ls, memb->nodeid, 0);
		error = dlm_rcom_status(ls, memb->nodeid, 0, seq);
		if (error)
			break;
	}
@@ -607,7 +607,7 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
	make_member_array(ls);
	*neg_out = neg;

	error = ping_members(ls);
	error = ping_members(ls, rv->seq);
	log_rinfo(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
	return error;
}
Loading