Skip to contentSkip to conversation

lustre: remove unnecessary 'magic' from lustre_pack_request

PATCH Dave Jones 2 participants 2 messages Jan 30, 2014 – Feb 1, 2014 Staging

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

This probably made more sense when the code supported multiple protocol versions, but now it's just obfuscation.

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +1 -9
index 464479c0f00b..c319f74b04f6 100644
@@ -244,15 +244,7 @@ int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count,
 	LASSERT(lens[MSG_PTLRPC_BODY_OFF] == sizeof(struct ptlrpc_body));
 
 	/* only use new format, we don't need to be compatible with 1.4 */
-	magic = LUSTRE_MSG_MAGIC_V2;
-
-	switch (magic) {
-	case LUSTRE_MSG_MAGIC_V2:
-		return lustre_pack_request_v2(req, count, lens, bufs);
-	default:
-		LASSERTF(0, "incorrect message magic: %08x\n", magic);
-		return -EINVAL;
-	}
+	return lustre_pack_request_v2(req, count, lens, bufs);
 }
 EXPORT_SYMBOL(lustre_pack_request);
 
#1 lore raw

Hello!

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count, · line 246

Quoted 13 lines · Dave Jones

This probably made more sense when the code supported multiple protocol versions, but now it's just obfuscation.

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +0 -0
index 464479c0f00b..c319f74b04f6 100644
@@ -244,15 +244,7 @@ int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count,
 	LASSERT(lens[MSG_PTLRPC_BODY_OFF] == sizeof(struct ptlrpc_body));
 
 	/* only use new format, we don't need to be compatible with 1.4 */

Can you get rid of this line too please?

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c int lustre_pack_request(struct ptlrpc_request *req, __u32 magic, int count, · line 247

Quoted 1 line
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +0 -1
-	magic = LUSTRE_MSG_MAGIC_V2;

Bye,
Oleg