ocfs2/dlm: Clean up struct dlm_lock_name

For master mle, the name it stored in the attached lockres in struct qstr.
For block and migration mle, the name is stored inline in struct dlm_lock_name.
This patch attempts to make struct dlm_lock_name look like a struct qstr. While
we could use struct qstr, we don't because we want to avoid having to malloc
and free the lockname string as the mle's lifetime is fairly short.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
This commit is contained in:
Sunil Mushran
2009-02-26 15:00:38 -08:00
committed by Mark Fasheh
parent 1c0845773a
commit f77a9a78c3
3 changed files with 53 additions and 44 deletions

View File

@@ -288,15 +288,15 @@ static int dump_mle(struct dlm_master_list_entry *mle, char *buf, int len)
{
int out = 0;
unsigned int namelen;
const char *name;
unsigned char *name;
char *mle_type;
if (mle->type != DLM_MLE_MASTER) {
namelen = mle->u.name.len;
name = mle->u.name.name;
name = mle->u.mlename.name;
namelen = mle->u.mlename.len;
} else {
namelen = mle->u.res->lockname.len;
name = mle->u.res->lockname.name;
name = (unsigned char *)mle->u.mleres->lockname.name;
namelen = mle->u.mleres->lockname.len;
}
if (mle->type == DLM_MLE_BLOCK)