This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/native/java/io/RandomAccessFile.c#l83 | |
*/ | |
Java_java_io_RandomAccessFile_writeBytes(JNIEnv *env, | |
jobject this, jbyteArray bytes, jint off, jint len) { | |
writeBytes(env, this, bytes, off, len, JNI_FALSE, raf_fd); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/native/java/io/io_util.c#l145 | |
*/ | |
void | |
writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, | |
jint off, jint len, jboolean append, jfieldID fid) | |
{ | |
jint n; | |
char stackBuf[BUF_SIZE]; | |
char *buf = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/native/java/io/io_util_md.h#l71 | |
*/ | |
#define IO_Write handleWrite | |
#define IO_Append handleWrite | |
// ... | |
/* | |
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/native/java/io/io_util_md.c#l160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c#l111 | |
*/ | |
Java_sun_nio_ch_FileDispatcherImpl_pwrite0(JNIEnv *env, jclass clazz, jobject fdo, | |
jlong address, jint len, jlong offset) | |
{ | |
jint fd = fdval(env, fdo); | |
void *buf = (void *)jlong_to_ptr(address); | |
return convertReturnVal(env, pwrite64(fd, buf, len, offset), JNI_FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/nio/channels/FileChannel.java#l778 | |
*/ | |
public abstract int write(ByteBuffer src, long position) throws IOException; | |
// ... | |
/* | |
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/nio/ch/FileChannelImpl.java#l703 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/nio/ch/IOUtil.java#l46 | |
*/ | |
static int write(FileDescriptor fd, ByteBuffer src, long position, | |
NativeDispatcher nd) | |
throws IOException | |
{ | |
if (src instanceof DirectBuffer) | |
return writeFromNativeBuffer(fd, src, position, nd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c#l111 | |
*/ | |
Java_sun_nio_ch_FileDispatcherImpl_pwrite0(JNIEnv *env, jclass clazz, jobject fdo, | |
jlong address, jint len, jlong offset) | |
{ | |
jint fd = fdval(env, fdo); | |
void *buf = (void *)jlong_to_ptr(address); | |
return convertReturnVal(env, pwrite64(fd, buf, len, offset), JNI_FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java#l63 | |
*/ | |
int pwrite(FileDescriptor fd, long address, int len, long position) | |
throws IOException | |
{ | |
return pwrite0(fd, address, len, position); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) | |
{ | |
struct iovec iov = { .iov_base = buf, .iov_len = len }; | |
struct kiocb kiocb; | |
struct iov_iter iter; | |
ssize_t ret; | |
init_sync_kiocb(&kiocb, filp); | |
kiocb.ki_pos = *ppos; | |
kiocb.ki_nbytes = len; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xfs_file_read_iter( | |
struct kiocb *iocb, | |
struct iov_iter *to) | |
{ | |
... | |
xfs_rw_ilock(ip, XFS_IOLOCK_SHARED); | |
... | |
ret = generic_file_read_iter(iocb, to); | |
... | |
xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED); |