From: lsy Date: Tue, 20 Sep 2005 15:52:39 +0000 (+0000) Subject: add debug for capa_key. X-Git-Tag: v1_7_100~645 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;ds=sidebyside;h=b28541af454592e69b24ec786d4a8060c1175f2e;p=fs%2Flustre-release.git add debug for capa_key. --- diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c index 92335c6..4d27fef 100644 --- a/lustre/obdclass/capa.c +++ b/lustre/obdclass/capa.c @@ -340,6 +340,14 @@ struct obd_capa *capa_renew(struct lustre_capa *capa, int type) return ocapa; } +static void dump_capa_key(char *buf, char *key) +{ + int i, n = 0; + + for (i = 0; i < CAPA_KEY_LEN; i++) + n += sprintf(buf + n, "%02x", (unsigned char) key[i]); +} + void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa) { int keylen = CAPA_KEY_LEN; @@ -351,6 +359,15 @@ void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa) LASSERT(tfm); crypto_hmac(tfm, key, &keylen, &sl, 1, capa->lc_hmac); + { + char *buf; + + OBD_ALLOC(key, keylen * 2 + 1); + if (key) { + dump_capa_key(buf, key); + DEBUG_CAPA(D_INODE, capa, "hmac with %s", buf); + } + } } void capa_dup(void *dst, struct obd_capa *ocapa)