Commit 7f34973f authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfsv41: pass cacheThis to the the corresponding slot

parent d863ba71
...@@ -68,8 +68,9 @@ public class NFSv41Session { ...@@ -68,8 +68,9 @@ public class NFSv41Session {
return _slots.length - 1; return _slots.length - 1;
} }
public boolean updateSlot(int slot, int sequence, List<nfs_resop4> reply) throws ChimeraNFSException { public boolean updateSlot(int slot, int sequence, boolean cacheThis, List<nfs_resop4> reply)
return getSlot(slot).update(sequence, reply); throws ChimeraNFSException {
return getSlot(slot).update(sequence, reply, cacheThis);
} }
/** /**
......
...@@ -56,8 +56,6 @@ public class OperationSEQUENCE extends AbstractNFSv4Operation { ...@@ -56,8 +56,6 @@ public class OperationSEQUENCE extends AbstractNFSv4Operation {
* in a COMPOUND. Such operations will get the error NFS4ERR_OP_NOT_IN_SESSION if they do * in a COMPOUND. Such operations will get the error NFS4ERR_OP_NOT_IN_SESSION if they do
* appear at the start of a COMPOUND. * appear at the start of a COMPOUND.
* *
*
*
*/ */
...@@ -87,19 +85,17 @@ public class OperationSEQUENCE extends AbstractNFSv4Operation { ...@@ -87,19 +85,17 @@ public class OperationSEQUENCE extends AbstractNFSv4Operation {
} }
List<nfs_resop4> reply; List<nfs_resop4> reply = context.processedOperations();
if (_args.opsequence.sa_cachethis) { if(session.updateSlot(_args.opsequence.sa_slotid.value.value,
reply = context.processedOperations(); _args.opsequence.sa_sequenceid.value.value,
} else { _args.opsequence.sa_cachethis, reply)){
reply = null;
}
if (session.updateSlot(_args.opsequence.sa_slotid.value.value, _args.opsequence.sa_sequenceid.value.value, reply)) {
/* /*
* retransmit + cached reply available. * retransmit + cached reply available.
* Stop processing. * Stop processing.
*/ */
return false; return false;
} }
session.getClient().updateLeaseTime(NFSv4Defaults.NFS4_LEASE_TIME); session.getClient().updateLeaseTime(NFSv4Defaults.NFS4_LEASE_TIME);
context.setSession(session); context.setSession(session);
......
...@@ -49,7 +49,7 @@ public class SessionSlot { ...@@ -49,7 +49,7 @@ public class SessionSlot {
* @return true if retransmit is detected and cached reply available. * @return true if retransmit is detected and cached reply available.
* @throws ChimeraNFSException * @throws ChimeraNFSException
*/ */
boolean update(int sequence, List<nfs_resop4> reply) throws ChimeraNFSException { boolean update(int sequence, List<nfs_resop4> reply, boolean cacheThis) throws ChimeraNFSException {
if( sequence == _sequence ) { if( sequence == _sequence ) {
_log.info("retransmit detected"); _log.info("retransmit detected");
...@@ -85,7 +85,11 @@ public class SessionSlot { ...@@ -85,7 +85,11 @@ public class SessionSlot {
} }
_sequence = sequence; _sequence = sequence;
_reply = reply; if( cacheThis ){
_reply = reply;
}else{
_reply = null;
}
return false; return false;
} }
......
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