mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8189963: Remove version of FileChannelImpl::open without the 'direct' parameter
Remove old version of FileChannelImpl::open and update call sites Reviewed-by: rriggs
This commit is contained in:
parent
9615ad79e8
commit
18cbe428c1
5 changed files with 7 additions and 11 deletions
|
@ -385,7 +385,8 @@ class FileInputStream extends InputStream
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
fc = this.channel;
|
fc = this.channel;
|
||||||
if (fc == null) {
|
if (fc == null) {
|
||||||
this.channel = fc = FileChannelImpl.open(fd, path, true, false, this);
|
this.channel = fc = FileChannelImpl.open(fd, path, true,
|
||||||
|
false, false, this);
|
||||||
if (closed) {
|
if (closed) {
|
||||||
try {
|
try {
|
||||||
// possible race with close(), benign since
|
// possible race with close(), benign since
|
||||||
|
|
|
@ -410,7 +410,8 @@ class FileOutputStream extends OutputStream
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
fc = this.channel;
|
fc = this.channel;
|
||||||
if (fc == null) {
|
if (fc == null) {
|
||||||
this.channel = fc = FileChannelImpl.open(fd, path, false, true, this);
|
this.channel = fc = FileChannelImpl.open(fd, path, false,
|
||||||
|
true, false, this);
|
||||||
if (closed) {
|
if (closed) {
|
||||||
try {
|
try {
|
||||||
// possible race with close(), benign since
|
// possible race with close(), benign since
|
||||||
|
|
|
@ -298,7 +298,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
fc = this.channel;
|
fc = this.channel;
|
||||||
if (fc == null) {
|
if (fc == null) {
|
||||||
this.channel = fc = FileChannelImpl.open(fd, path, true, rw, this);
|
this.channel = fc = FileChannelImpl.open(fd, path, true,
|
||||||
|
rw, false, this);
|
||||||
if (closed.get()) {
|
if (closed.get()) {
|
||||||
try {
|
try {
|
||||||
fc.close();
|
fc.close();
|
||||||
|
|
|
@ -140,13 +140,6 @@ public class FileChannelImpl
|
||||||
|
|
||||||
// Used by FileInputStream.getChannel(), FileOutputStream.getChannel
|
// Used by FileInputStream.getChannel(), FileOutputStream.getChannel
|
||||||
// and RandomAccessFile.getChannel()
|
// and RandomAccessFile.getChannel()
|
||||||
public static FileChannel open(FileDescriptor fd, String path,
|
|
||||||
boolean readable, boolean writable,
|
|
||||||
Object parent)
|
|
||||||
{
|
|
||||||
return new FileChannelImpl(fd, path, readable, writable, false, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FileChannel open(FileDescriptor fd, String path,
|
public static FileChannel open(FileDescriptor fd, String path,
|
||||||
boolean readable, boolean writable,
|
boolean readable, boolean writable,
|
||||||
boolean direct, Object parent)
|
boolean direct, Object parent)
|
||||||
|
|
|
@ -110,7 +110,7 @@ class UnixChannelFactory {
|
||||||
static FileChannel newFileChannel(int fd, String path, boolean reading, boolean writing) {
|
static FileChannel newFileChannel(int fd, String path, boolean reading, boolean writing) {
|
||||||
FileDescriptor fdObj = new FileDescriptor();
|
FileDescriptor fdObj = new FileDescriptor();
|
||||||
fdAccess.set(fdObj, fd);
|
fdAccess.set(fdObj, fd);
|
||||||
return FileChannelImpl.open(fdObj, path, reading, writing, null);
|
return FileChannelImpl.open(fdObj, path, reading, writing, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue