Commit fbb6b56d authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfsv41: make use of varargs in ip to device_addr4 encoding

Acked-By: Paul
Patch: http://rb.dcache.org/r/1734/
parent 5d610994
......@@ -72,9 +72,7 @@ public class DeviceManager implements NFSv41DeviceManager {
}
//hard coded for now
InetSocketAddress[] addresses = new InetSocketAddress[1];
addresses[0] = new InetSocketAddress(addr, 2052);
device_addr4 deviceAddr = deviceAddrOf( addresses );
device_addr4 deviceAddr = deviceAddrOf( new InetSocketAddress(addr, 2052) );
NFS4IoDevice newDevice = new NFS4IoDevice(deviceId , deviceAddr);
......@@ -136,12 +134,12 @@ public class DeviceManager implements NFSv41DeviceManager {
}
/**
* Create a mulipath based NFSv4.1 file layout address.
* Create a multipath based NFSv4.1 file layout address.
*
* @param deviceAddress
* @return device address
*/
public static device_addr4 deviceAddrOf(InetSocketAddress[] deviceAddress) {
public static device_addr4 deviceAddrOf(InetSocketAddress ... deviceAddress) {
nfsv4_1_file_layout_ds_addr4 file_type = new nfsv4_1_file_layout_ds_addr4();
......
......@@ -13,7 +13,6 @@ import org.dcache.chimera.nfs.v4.xdr.nfs_opnum4;
import org.dcache.chimera.nfs.v4.xdr.GETDEVICELIST4res;
import org.dcache.chimera.nfs.v4.xdr.GETDEVICELIST4resok;
import org.dcache.chimera.nfs.ChimeraNFSException;
import java.net.InetSocketAddress;
import java.util.List;
import org.apache.log4j.Logger;
......@@ -65,10 +64,8 @@ public class OperationGETDEVICELIST extends AbstractNFSv4Operation {
DeviceID mdsID = DeviceID.valueOf(0);
InetSocketAddress[] addresses = new InetSocketAddress[1];
addresses[0] = context.getRpcCall().getTransport().getLocalSocketAddress();
device_addr4 deviceAddr = DeviceManager.deviceAddrOf( addresses );
device_addr4 deviceAddr =
DeviceManager.deviceAddrOf( context.getRpcCall().getTransport().getLocalSocketAddress() );
NFS4IoDevice newDevice = new NFS4IoDevice(mdsID , deviceAddr);
context.getDeviceManager().addIoDevice(newDevice, layoutiomode4.LAYOUTIOMODE4_ANY);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment