8202261: (fc) FileChannel.map and RandomAccessFile.setLength should not preallocate space

Reviewed-by: bpb
This commit is contained in:
Alan Bateman 2018-04-26 09:04:18 +01:00
parent ccc74fdd60
commit 2df7aa7b9f
9 changed files with 101 additions and 144 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -74,6 +74,10 @@ class FileDispatcherImpl extends FileDispatcher {
return writev0(fd, address, len);
}
long seek(FileDescriptor fd, long offset) throws IOException {
return seek0(fd, offset);
}
int force(FileDescriptor fd, boolean metaData) throws IOException {
return force0(fd, metaData);
}
@ -82,10 +86,6 @@ class FileDispatcherImpl extends FileDispatcher {
return truncate0(fd, size);
}
int allocate(FileDescriptor fd, long size) throws IOException {
return allocate0(fd, size);
}
long size(FileDescriptor fd) throws IOException {
return size0(fd);
}
@ -156,10 +156,10 @@ class FileDispatcherImpl extends FileDispatcher {
static native int force0(FileDescriptor fd, boolean metaData)
throws IOException;
static native int truncate0(FileDescriptor fd, long size)
static native long seek0(FileDescriptor fd, long offset)
throws IOException;
static native int allocate0(FileDescriptor fd, long size)
static native int truncate0(FileDescriptor fd, long size)
throws IOException;
static native long size0(FileDescriptor fd) throws IOException;