From 84110ac1ecd0b90236884f584c62f0aba5630fc2 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 16 Nov 2014 12:31:02 +0000 Subject: Replace a plethora of historical protection options with just PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis --- sys/tmpfs/tmpfs_subr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/tmpfs/tmpfs_subr.c') diff --git a/sys/tmpfs/tmpfs_subr.c b/sys/tmpfs/tmpfs_subr.c index 88a4717a12b..89026cda0b5 100644 --- a/sys/tmpfs/tmpfs_subr.c +++ b/sys/tmpfs/tmpfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_subr.c,v 1.6 2014/03/28 17:57:11 mpi Exp $ */ +/* $OpenBSD: tmpfs_subr.c,v 1.7 2014/11/16 12:31:00 deraadt Exp $ */ /* $NetBSD: tmpfs_subr.c,v 1.79 2012/03/13 18:40:50 elad Exp $ */ /* @@ -1227,10 +1227,10 @@ tmpfs_uiomove(tmpfs_node_t *node, struct uio *uio, vsize_t len) if (len >= TMPFS_UIO_MAXBYTES) { sz = TMPFS_UIO_MAXBYTES; - adv = UVM_ADV_NORMAL; + adv = POSIX_MADV_NORMAL; } else { sz = len; - adv = UVM_ADV_SEQUENTIAL; + adv = POSIX_MADV_SEQUENTIAL; } if (tmpfs_uio_cached(node)) @@ -1239,8 +1239,8 @@ tmpfs_uiomove(tmpfs_node_t *node, struct uio *uio, vsize_t len) uao_reference(node->tn_uobj); error = uvm_map(kernel_map, &va, round_page(pgoff + sz), node->tn_uobj, - trunc_page(uio->uio_offset), 0, UVM_MAPFLAG(UVM_PROT_RW, - UVM_PROT_RW, UVM_INH_NONE, adv, 0)); + trunc_page(uio->uio_offset), 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, + PROT_READ | PROT_WRITE, UVM_INH_NONE, adv, 0)); if (error) { uao_detach(node->tn_uobj); /* Drop reference. */ return error; @@ -1266,8 +1266,8 @@ tmpfs_zeropg(tmpfs_node_t *node, voff_t pgnum, vaddr_t pgoff) uao_reference(node->tn_uobj); error = uvm_map(kernel_map, &va, PAGE_SIZE, node->tn_uobj, pgnum, 0, - UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_NONE, UVM_ADV_NORMAL, - 0)); + UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, + UVM_INH_NONE, POSIX_MADV_NORMAL, 0)); if (error) { uao_detach(node->tn_uobj); /* Drop reference. */ return error; -- cgit v1.2.3