summaryrefslogtreecommitdiffstats
path: root/cryptodev_main.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-23 08:28:15 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-23 08:28:15 +0200
commit8243a470ec9a7e2ffea5f70539c468341100aef8 (patch)
treeafa3038213763be835cdd014703968bc98e3e8cd /cryptodev_main.c
parent8383ca063d2473a87e585c20d80138d68d7d4dbf (diff)
downloadkernel-crypto-8243a470ec9a7e2ffea5f70539c468341100aef8.tar.gz
kernel-crypto-8243a470ec9a7e2ffea5f70539c468341100aef8.tar.xz
kernel-crypto-8243a470ec9a7e2ffea5f70539c468341100aef8.zip
Revert "initial support for userspace data."
This reverts commit e7828004e40592c8cffc9235f72440c802905e16.
Diffstat (limited to 'cryptodev_main.c')
-rw-r--r--cryptodev_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c
index 2a0503c3154..0316a74dbb9 100644
--- a/cryptodev_main.c
+++ b/cryptodev_main.c
@@ -495,7 +495,7 @@ __crypto_run_std(struct csession *ses_ptr, struct crypt_op *cop)
#ifndef DISABLE_ZCOPY
-void release_user_pages(struct page **pg, int pagecount)
+static void release_user_pages(struct page **pg, int pagecount)
{
while (pagecount--) {
if (!PageReserved(pg[pagecount]))
@@ -504,11 +504,16 @@ void release_user_pages(struct page **pg, int pagecount)
}
}
+/* last page - first page + 1 */
+#define PAGECOUNT(buf, buflen) \
+ ((((unsigned long)(buf + buflen - 1) & PAGE_MASK) >> PAGE_SHIFT) - \
+ (((unsigned long) buf & PAGE_MASK) >> PAGE_SHIFT) + 1)
+
/* offset of buf in it's first page */
#define PAGEOFFSET(buf) ((unsigned long)buf & ~PAGE_MASK)
/* fetch the pages addr resides in into pg and initialise sg with them */
-int __get_userbuf(uint8_t *addr, uint32_t len, int write,
+static int __get_userbuf(uint8_t *addr, uint32_t len, int write,
int pgcount, struct page **pg, struct scatterlist *sg)
{
int ret, pglen, i = 0;