summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_swap_encrypt.h
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-05-06 04:00:11 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-05-06 04:00:11 +0000
commit56bd73cead74f0b3a21c0ef4ae8f8647d83e04ab (patch)
tree8a03dd4e2ebe69f52d98c50fccb48fc8ccbf21ea /sys/uvm/uvm_swap_encrypt.h
parent89622a4d2764079009502ff9b5ecd2d24f0bf0e3 (diff)
make SWAP_KEY_GET symmetrical with SWAP_KEY_PUT by having it call
a function in uvm_swap_encrypt.c instead of doing stuff inline. lets me remove an extern from the header too. ok kettenis@
Diffstat (limited to 'sys/uvm/uvm_swap_encrypt.h')
-rw-r--r--sys/uvm/uvm_swap_encrypt.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/uvm/uvm_swap_encrypt.h b/sys/uvm/uvm_swap_encrypt.h
index 3545ae02be5..e883f6b758b 100644
--- a/sys/uvm/uvm_swap_encrypt.h
+++ b/sys/uvm/uvm_swap_encrypt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap_encrypt.h,v 1.9 2009/03/23 22:10:04 oga Exp $ */
+/* $OpenBSD: uvm_swap_encrypt.h,v 1.10 2015/05/06 04:00:10 dlg Exp $ */
/*
* Copyright 1999 Niels Provos <provos@citi.umich.edu>
@@ -61,13 +61,9 @@ void swap_decrypt(struct swap_key *,caddr_t, caddr_t, u_int64_t, size_t);
void swap_key_cleanup(struct swap_key *);
void swap_key_prepare(struct swap_key *, int);
-extern u_int uvm_swpkeyscreated;
-
#define SWAP_KEY_GET(s,x) do { \
if ((x)->refcount == 0) { \
- arc4random_buf((x)->key,\
- sizeof((x)->key)); \
- uvm_swpkeyscreated++; \
+ swap_key_create(x); \
} \
(x)->refcount++; \
} while(0);
@@ -79,6 +75,7 @@ extern u_int uvm_swpkeyscreated;
} \
} while(0);
+void swap_key_create(struct swap_key *);
void swap_key_delete(struct swap_key *);
extern int uvm_doswapencrypt; /* swapencrypt enabled/disabled */