diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-11-16 12:31:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-11-16 12:31:02 +0000 |
commit | 84110ac1ecd0b90236884f584c62f0aba5630fc2 (patch) | |
tree | fad09b733c1e1122314b073b82f6d36a1024e050 /sys/tmpfs/tmpfs_subr.c | |
parent | cbbf1bf46622bbdb478ef4df4e4e027e0b83fc62 (diff) |
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
Diffstat (limited to 'sys/tmpfs/tmpfs_subr.c')
-rw-r--r-- | sys/tmpfs/tmpfs_subr.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; |