rsocket-branch: Review comment C from Brian - rename dispatcher rsocket-branch
authorchegar
Thu, 31 Jan 2019 14:22:46 +0000
branchrsocket-branch
changeset 57130 3e1ebe33554c
parent 57129 1e1db86ea836
child 57131 abd18a34acbf
rsocket-branch: Review comment C from Brian - rename dispatcher Contributed-by: Lucy Lu <yingqi.lu@intel.com>
src/jdk.net/linux/classes/jdk/internal/net/rdma/LinuxRdmaSocketDispatcherImpl.java
src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketDispatcher.java
src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketDispatcherImpl.java
src/jdk.net/linux/native/libextnet/LinuxRdmaSocketDispatcherImpl.c
--- a/src/jdk.net/linux/classes/jdk/internal/net/rdma/LinuxRdmaSocketDispatcherImpl.java	Thu Jan 31 14:12:49 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.internal.net.rdma;
-
-import java.io.FileDescriptor;
-import java.io.IOException;
-import sun.nio.ch.IOUtil;
-
-public class LinuxRdmaSocketDispatcherImpl {
-
-    static {
-        java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction<Void>() {
-                    public Void run() {
-                        System.loadLibrary("extnet");
-                        return null;
-                    }
-                });
-        IOUtil.load();
-        init();
-    }
-
-    LinuxRdmaSocketDispatcherImpl() { }
-
-
-    // -- Native methods --
-
-    static native int read0(FileDescriptor fd, long address, int len)
-            throws IOException;
-
-    static native long readv0(FileDescriptor fd, long address, int len)
-            throws IOException;
-
-    static native int write0(FileDescriptor fd, long address, int len)
-            throws IOException;
-
-    static native long writev0(FileDescriptor fd, long address, int len)
-            throws IOException;
-
-    static native void close0(FileDescriptor fd) throws IOException;
-
-    static native void init();
-}
--- a/src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketDispatcher.java	Thu Jan 31 14:12:49 2019 +0000
+++ b/src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketDispatcher.java	Thu Jan 31 14:22:46 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -27,8 +27,6 @@
 
 import java.io.FileDescriptor;
 import java.io.IOException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import sun.nio.ch.SocketDispatcher;
 
 /**
@@ -40,26 +38,26 @@
 {
     protected int read(FileDescriptor fd, long address, int len)
             throws IOException {
-        return LinuxRdmaSocketDispatcherImpl.read0(fd, address, len);
+        return RdmaSocketDispatcherImpl.read0(fd, address, len);
     }
 
     protected long readv(FileDescriptor fd, long address, int len)
             throws IOException {
-        return LinuxRdmaSocketDispatcherImpl.readv0(fd, address, len);
+        return RdmaSocketDispatcherImpl.readv0(fd, address, len);
     }
 
     protected int write(FileDescriptor fd, long address, int len)
             throws IOException {
-        return LinuxRdmaSocketDispatcherImpl.write0(fd, address, len);
+        return RdmaSocketDispatcherImpl.write0(fd, address, len);
     }
 
     protected long writev(FileDescriptor fd, long address, int len)
             throws IOException {
-        return LinuxRdmaSocketDispatcherImpl.writev0(fd, address, len);
+        return RdmaSocketDispatcherImpl.writev0(fd, address, len);
     }
 
     protected void close(FileDescriptor fd) throws IOException {
-        LinuxRdmaSocketDispatcherImpl.close0(fd);
+        RdmaSocketDispatcherImpl.close0(fd);
     }
 
     public void preClose(FileDescriptor fd) throws IOException {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketDispatcherImpl.java	Thu Jan 31 14:22:46 2019 +0000
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.net.rdma;
+
+import java.io.FileDescriptor;
+import java.io.IOException;
+import sun.nio.ch.IOUtil;
+
+public class RdmaSocketDispatcherImpl {
+
+    static {
+        java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("extnet");
+                        return null;
+                    }
+                });
+        IOUtil.load();
+        init();
+    }
+
+    RdmaSocketDispatcherImpl() { }
+
+
+    // -- Native methods --
+
+    static native int read0(FileDescriptor fd, long address, int len)
+            throws IOException;
+
+    static native long readv0(FileDescriptor fd, long address, int len)
+            throws IOException;
+
+    static native int write0(FileDescriptor fd, long address, int len)
+            throws IOException;
+
+    static native long writev0(FileDescriptor fd, long address, int len)
+            throws IOException;
+
+    static native void close0(FileDescriptor fd) throws IOException;
+
+    static native void init();
+}
--- a/src/jdk.net/linux/native/libextnet/LinuxRdmaSocketDispatcherImpl.c	Thu Jan 31 14:12:49 2019 +0000
+++ b/src/jdk.net/linux/native/libextnet/LinuxRdmaSocketDispatcherImpl.c	Thu Jan 31 14:22:46 2019 +0000
@@ -23,7 +23,7 @@
  * questions.
  */
 
-#include "jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl.h"
+#include "jdk_internal_net_rdma_RdmaSocketDispatcherImpl.h"
 #include "nio.h"
 #include "nio_util.h"
 #include <Rsocket.h>
@@ -75,7 +75,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_init(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_init(JNIEnv *env,
         jclass cl) {
     loadRdmaFuncs(env);
     CHECK_NULL(cl = (*env)->FindClass(env, "java/io/FileDescriptor"));
@@ -83,7 +83,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_read0(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_read0(JNIEnv *env,
         jclass clazz, jobject fdo, jlong address, jint len) {
     jint fd = (*env)->GetIntField(env, fdo, fd_fdID);
     void *buf = (void *)jlong_to_ptr(address);
@@ -91,7 +91,7 @@
 }
 
 JNIEXPORT jlong JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_readv0(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_readv0(JNIEnv *env,
         jclass clazz, jobject fdo, jlong address, jint len) {
     jint fd = (*env)->GetIntField(env, fdo, fd_fdID);
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
@@ -99,7 +99,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_write0(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_write0(JNIEnv *env,
         jclass clazz, jobject fdo, jlong address, jint len) {
     jint fd = (*env)->GetIntField(env, fdo, fd_fdID);
     void *buf = (void *)jlong_to_ptr(address);
@@ -107,7 +107,7 @@
 }
 
 JNIEXPORT jlong JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_writev0(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_writev0(JNIEnv *env,
         jclass clazz, jobject fdo, jlong address, jint len) {
     jint fd = (*env)->GetIntField(env, fdo, fd_fdID);
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
@@ -123,7 +123,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_jdk_internal_net_rdma_LinuxRdmaSocketDispatcherImpl_close0(JNIEnv *env,
+Java_jdk_internal_net_rdma_RdmaSocketDispatcherImpl_close0(JNIEnv *env,
         jclass clazz, jobject fdo) {
     jint fd = (*env)->GetIntField(env, fdo, fd_fdID);
     closeFileDescriptor(env, fd);