summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/obdclass/capa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/capa.c')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/capa.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/capa.c b/drivers/staging/lustre/lustre/obdclass/capa.c
index be1c613383a6..5af61a8c0b85 100644
--- a/drivers/staging/lustre/lustre/obdclass/capa.c
+++ b/drivers/staging/lustre/lustre/obdclass/capa.c
@@ -48,12 +48,12 @@
#include <linux/module.h>
#include <linux/crypto.h>
-#include <obd_class.h>
-#include <lustre_debug.h>
-#include <lustre/lustre_idl.h>
+#include "../include/obd_class.h"
+#include "../include/lustre_debug.h"
+#include "../include/lustre/lustre_idl.h"
#include <linux/list.h>
-#include <lustre_capa.h>
+#include "../include/lustre_capa.h"
#define NR_CAPAHASH 32
#define CAPA_HASH_SIZE 3000 /* for MDS & OSS */
@@ -143,9 +143,9 @@ static inline int capa_hashfn(struct lu_fid *fid)
* client renew right after obtaining it. */
static inline int capa_is_to_expire(struct obd_capa *oc)
{
- return cfs_time_before(cfs_time_sub(oc->c_expiry,
- cfs_time_seconds(oc->c_capa.lc_timeout)*2/3),
- cfs_time_current());
+ return time_before(cfs_time_sub(oc->c_expiry,
+ cfs_time_seconds(oc->c_capa.lc_timeout)*2/3),
+ cfs_time_current());
}
static struct obd_capa *find_capa(struct lustre_capa *capa,
@@ -279,6 +279,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
}
keylen = alg->ha_keylen;
+ sg_init_table(&sl, 1);
sg_set_page(&sl, virt_to_page(capa),
offsetof(struct lustre_capa, lc_hmac),
(unsigned long)(capa) % PAGE_CACHE_SIZE);
@@ -320,9 +321,11 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
GOTO(out, rc);
}
+ sg_init_table(&sd, 1);
sg_set_page(&sd, virt_to_page(d), 16,
(unsigned long)(d) % PAGE_CACHE_SIZE);
+ sg_init_table(&ss, 1);
sg_set_page(&ss, virt_to_page(s), 16,
(unsigned long)(s) % PAGE_CACHE_SIZE);
desc.tfm = tfm;
@@ -370,9 +373,11 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
GOTO(out, rc);
}
+ sg_init_table(&sd, 1);
sg_set_page(&sd, virt_to_page(d), 16,
(unsigned long)(d) % PAGE_CACHE_SIZE);
+ sg_init_table(&ss, 1);
sg_set_page(&ss, virt_to_page(s), 16,
(unsigned long)(s) % PAGE_CACHE_SIZE);
@@ -406,8 +411,8 @@ void _debug_capa(struct lustre_capa *c,
va_list args;
va_start(args, fmt);
libcfs_debug_vmsg2(msgdata, fmt, args,
- " capability@%p fid "DFID" opc "LPX64" uid "LPU64
- " gid "LPU64" flags %u alg %d keyid %u timeout %u "
+ " capability@%p fid "DFID" opc %#llx uid %llu"
+ " gid %llu flags %u alg %d keyid %u timeout %u "
"expiry %u\n", c, PFID(capa_fid(c)), capa_opc(c),
capa_uid(c), capa_gid(c), capa_flags(c),
capa_alg(c), capa_keyid(c), capa_timeout(c),