Commit 11b19a6d authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs4-client: CompoundBuilder#withGetdeviceinfo should accept layout type

if client supports multiple layout types, then we need a way to specify which
one is needed.

Acked-by: Paul Millar
Target: master
parent d2ed5a55
Pipeline #3340 passed with stage
in 1 minute and 16 seconds
......@@ -1142,7 +1142,7 @@ public class Main {
IOException {
COMPOUND4args args = new CompoundBuilder()
.withGetdeviceinfo(deviceId)
.withGetdeviceinfo(deviceId, clientLayoutType)
.withTag("get_deviceinfo")
.build();
COMPOUND4res compound4res = sendCompoundInSession(args);
......@@ -1191,7 +1191,7 @@ public class Main {
COMPOUND4args args = new CompoundBuilder()
.withPutfh(_rootFh)
.withGetdevicelist()
.withGetdevicelist(clientLayoutType)
.withTag("get_devicelist")
.build();
......
/*
* Copyright (c) 2009 - 2020 Deutsches Elektronen-Synchroton,
* Copyright (c) 2009 - 2021 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
*
* This library is free software; you can redistribute it and/or modify
......@@ -369,7 +369,7 @@ public class CompoundBuilder {
return this;
}
public CompoundBuilder withGetdevicelist() {
public CompoundBuilder withGetdevicelist(layouttype4 layoutType) {
nfs_argop4 op = new nfs_argop4();
op.argop = nfs_opnum4.OP_GETDEVICELIST;
op.opgetdevicelist = new GETDEVICELIST4args();
......@@ -379,19 +379,19 @@ public class CompoundBuilder {
op.opgetdevicelist.gdla_cookieverf = new verifier4();
op.opgetdevicelist.gdla_cookieverf.value = new byte[nfs4_prot.NFS4_VERIFIER_SIZE];
op.opgetdevicelist.gdla_layout_type = layouttype4.LAYOUT4_NFSV4_1_FILES.getValue();
op.opgetdevicelist.gdla_layout_type = layoutType.getValue();
op.opgetdevicelist.gdla_maxdevices = new count4(256);
ops.add(op);
return this;
}
public CompoundBuilder withGetdeviceinfo(deviceid4 devId) {
public CompoundBuilder withGetdeviceinfo(deviceid4 devId, layouttype4 layoutType) {
nfs_argop4 op = new nfs_argop4();
op.argop = nfs_opnum4.OP_GETDEVICEINFO;
op.opgetdeviceinfo = new GETDEVICEINFO4args();
op.opgetdeviceinfo.gdia_device_id = devId;
op.opgetdeviceinfo.gdia_layout_type = layouttype4.LAYOUT4_NFSV4_1_FILES.getValue();
op.opgetdeviceinfo.gdia_layout_type = layoutType.getValue();
op.opgetdeviceinfo.gdia_maxcount = new count4(1024);
op.opgetdeviceinfo.gdia_notify_types = new bitmap4();
......
......@@ -37,7 +37,7 @@ public class OperationGETDEVICEINFOTest {
.build();
COMPOUND4args gdiArgs = new CompoundBuilder()
.withGetdeviceinfo(new deviceid4(new byte[] {0x7}))
.withGetdeviceinfo(new deviceid4(new byte[] {0x7}), layouttype4.LAYOUT4_NFSV4_1_FILES)
.build();
COMPOUND4res res = execute(context, gdiArgs);
......
Markdown is supported
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