Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-1714 lnet: Properly initialize sg_magic value
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
linux
/
linux-crypto.c
diff --git
a/libcfs/libcfs/linux/linux-crypto.c
b/libcfs/libcfs/linux/linux-crypto.c
index
002b241
..
aaffa61
100644
(file)
--- a/
libcfs/libcfs/linux/linux-crypto.c
+++ b/
libcfs/libcfs/linux/linux-crypto.c
@@
-167,7
+167,7
@@
int cfs_crypto_hash_digest(unsigned char alg_id,
unsigned char *key, unsigned int key_len,
unsigned char *hash, unsigned int *hash_len)
{
unsigned char *key, unsigned int key_len,
unsigned char *hash, unsigned int *hash_len)
{
- struct scatterlist sl
= {0}
;
+ struct scatterlist sl;
struct hash_desc hdesc;
int err;
const struct cfs_crypto_hash_type *type;
struct hash_desc hdesc;
int err;
const struct cfs_crypto_hash_type *type;
@@
-184,7
+184,7
@@
int cfs_crypto_hash_digest(unsigned char alg_id,
crypto_free_hash(hdesc.tfm);
return -ENOSPC;
}
crypto_free_hash(hdesc.tfm);
return -ENOSPC;
}
- sg_
set_buf
(&sl, (void *)buf, buf_len);
+ sg_
init_one
(&sl, (void *)buf, buf_len);
hdesc.flags = 0;
err = crypto_hash_digest(&hdesc, &sl, sl.length, hash);
hdesc.flags = 0;
err = crypto_hash_digest(&hdesc, &sl, sl.length, hash);
@@
-221,8
+221,9
@@
int cfs_crypto_hash_update_page(struct cfs_crypto_hash_desc *hdesc,
cfs_page_t *page, unsigned int offset,
unsigned int len)
{
cfs_page_t *page, unsigned int offset,
unsigned int len)
{
- struct scatterlist
sl = {0}
;
+ struct scatterlist
sl
;
+ sg_init_table(&sl, 1);
sg_set_page(&sl, page, len, offset & ~CFS_PAGE_MASK);
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
sg_set_page(&sl, page, len, offset & ~CFS_PAGE_MASK);
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
@@
-232,9
+233,9
@@
EXPORT_SYMBOL(cfs_crypto_hash_update_page);
int cfs_crypto_hash_update(struct cfs_crypto_hash_desc *hdesc,
const void *buf, unsigned int buf_len)
{
int cfs_crypto_hash_update(struct cfs_crypto_hash_desc *hdesc,
const void *buf, unsigned int buf_len)
{
- struct scatterlist
sl = {0}
;
+ struct scatterlist
sl
;
- sg_
set_buf
(&sl, (void *)buf, buf_len);
+ sg_
init_one
(&sl, (void *)buf, buf_len);
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
}
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
}