changes to bio hypercalls, part 3/n:
retire the filemmap/memsync hypercalls, they're no longer used
This commit is contained in:
parent
22f4b7d3e7
commit
696d8241ab
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.c,v 1.38 2013/04/29 12:56:04 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.c,v 1.39 2013/04/29 13:19:11 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
|
||||
|
@ -28,7 +28,7 @@
|
|||
#include "rumpuser_port.h"
|
||||
|
||||
#if !defined(lint)
|
||||
__RCSID("$NetBSD: rumpuser.c,v 1.38 2013/04/29 12:56:04 pooka Exp $");
|
||||
__RCSID("$NetBSD: rumpuser.c,v 1.39 2013/04/29 13:19:11 pooka Exp $");
|
||||
#endif /* !lint */
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
@ -282,53 +282,6 @@ rumpuser_unmap(void *addr, size_t len)
|
|||
assert(rv == 0);
|
||||
}
|
||||
|
||||
void *
|
||||
rumpuser_filemmap(int fd, off_t offset, size_t len, int flags, int *error)
|
||||
{
|
||||
void *rv;
|
||||
int mmflags, prot;
|
||||
|
||||
if (flags & RUMPUSER_FILEMMAP_TRUNCATE) {
|
||||
if (ftruncate(fd, offset + len) == -1) {
|
||||
seterror(errno);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* it's implicit */
|
||||
#if defined(__sun__) && !defined(MAP_FILE)
|
||||
#define MAP_FILE 0
|
||||
#endif
|
||||
|
||||
mmflags = MAP_FILE;
|
||||
if (flags & RUMPUSER_FILEMMAP_SHARED)
|
||||
mmflags |= MAP_SHARED;
|
||||
else
|
||||
mmflags |= MAP_PRIVATE;
|
||||
|
||||
prot = 0;
|
||||
if (flags & RUMPUSER_FILEMMAP_READ)
|
||||
prot |= PROT_READ;
|
||||
if (flags & RUMPUSER_FILEMMAP_WRITE)
|
||||
prot |= PROT_WRITE;
|
||||
|
||||
rv = mmap(NULL, len, PROT_READ|PROT_WRITE, mmflags, fd, offset);
|
||||
if (rv == MAP_FAILED) {
|
||||
seterror(errno);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
seterror(0);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
rumpuser_memsync(void *addr, size_t len, int *error)
|
||||
{
|
||||
|
||||
DOCALL_KLOCK(int, (msync(addr, len, MS_SYNC)));
|
||||
}
|
||||
|
||||
int
|
||||
rumpuser_open(const char *path, int ruflags, int *error)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.h,v 1.89 2013/04/29 12:56:03 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.h,v 1.90 2013/04/29 13:19:11 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2013 Antti Kantee. All Rights Reserved.
|
||||
|
@ -57,13 +57,7 @@ void *rumpuser_malloc(size_t, int);
|
|||
void rumpuser_free(void *, size_t);
|
||||
|
||||
void *rumpuser_anonmmap(void *, size_t, int, int, int *);
|
||||
#define RUMPUSER_FILEMMAP_READ 0x01
|
||||
#define RUMPUSER_FILEMMAP_WRITE 0x02
|
||||
#define RUMPUSER_FILEMMAP_TRUNCATE 0x04
|
||||
#define RUMPUSER_FILEMMAP_SHARED 0x08
|
||||
void *rumpuser_filemmap(int fd, off_t, size_t, int, int *);
|
||||
void rumpuser_unmap(void *, size_t);
|
||||
int rumpuser_memsync(void *, size_t, int *);
|
||||
|
||||
#define RUMPUSER_OPEN_RDONLY 0x0000
|
||||
#define RUMPUSER_OPEN_WRONLY 0x0001
|
||||
|
|
Loading…
Reference in New Issue