summaryrefslogtreecommitdiffstats
path: root/crypto/userspace/cryptodev_main.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-23 18:07:42 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-23 18:07:42 +0200
commitda3eeeff5744e8ea4bcdb819db3afad6437f5231 (patch)
treee9e92f4856b03aed9bcd1098625e0db060512140 /crypto/userspace/cryptodev_main.c
parent732e36a02b032e6cacd26694da55629b5e32c3bd (diff)
parent16ace6317db2c47b36b08b0addfe91356151c08d (diff)
downloadkernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.tar.gz
kernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.tar.xz
kernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.zip
Merge branch 'standalone-rename' into userspace-crypto
Conflicts: .gitignore
Diffstat (limited to 'crypto/userspace/cryptodev_main.c')
-rw-r--r--crypto/userspace/cryptodev_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/userspace/cryptodev_main.c b/crypto/userspace/cryptodev_main.c
index e8830bff5f0..6e93060e872 100644
--- a/crypto/userspace/cryptodev_main.c
+++ b/crypto/userspace/cryptodev_main.c
@@ -494,7 +494,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]))
@@ -503,11 +503,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;