def op_cb_layoutrecall(self, arg, env): log_cb.info("In CB_LAYOUTRECALL") self.prehook(arg, env) res = self.posthook(arg, env, res=NFS4_OK) if res is not NFS4_OK: return encode_status(res) op_lorecall = arg.opcblayoutrecall lo_type = op_lorecall.clora_type lo_iomode = op_lorecall.clora_iomode lo_recall = op_lorecall.clora_recall lo_recalltype = lo_recall.lor_recalltype if lo_recalltype is LAYOUTRECALL4_FILE: rclayout = lo_recall.lor_layout ops = [ op.putfh(rclayout.lor_fh), op.layoutreturn( False, lo_type, lo_iomode, layoutreturn4( LAYOUTRETURN4_FILE, layoutreturn_file4(rclayout.lor_offset, rclayout.lor_length, rclayout.lor_stateid, ""), ), ), ] env.session.compound(ops) elif lo_recalltype not in [LAYOUTRECALL4_FSID, LAYOUTRECALL4_ALL]: res = NFS4ERR_NOTSUPP return encode_status(res)
def op_cb_sequence(self, arg, env): log_cb.info("In CB_SEQUENCE") if env.index != 0: return encode_status(NFS4ERR_SEQUENCE_POS) session = self.sessions.get(arg.csa_sessionid, None) if session is None: return encode_status(NFS4ERR_BADSESSION) # STUB - check connectino binding and creds channel = session.back_channel # STUB bounds checking try: slot = channel.slots[arg.csa_slotid] except IndexError: return encode_status(NFS4ERR_BADSLOT) env.cache = slot.check_seqid(arg.csa_sequenceid) # AT this point we are not allowed to return an error env.caching = arg.csa_cachethis env.session = session res = CB_SEQUENCE4resok(session.sessionid, slot.seqid, arg.csa_slotid, channel.maxrequests, channel.maxrequests)# STUB res = self.posthook(arg, env, res) return encode_status(NFS4_OK, res)
def op_cb_layoutrecall(self, arg, env): log_cb.info("In CB_LAYOUTRECALL") self.prehook(arg, env) res = self.posthook(arg, env, res=NFS4_OK) if res is not NFS4_OK: return encode_status(res) op_lorecall = arg.opcblayoutrecall lo_type = op_lorecall.clora_type lo_iomode = op_lorecall.clora_iomode lo_recall = op_lorecall.clora_recall lo_recalltype = lo_recall.lor_recalltype if lo_recalltype is LAYOUTRECALL4_FILE: rclayout = lo_recall.lor_layout ops = [op.putfh(rclayout.lor_fh), op.layoutreturn(False, lo_type, lo_iomode, layoutreturn4(LAYOUTRETURN4_FILE, layoutreturn_file4(rclayout.lor_offset, rclayout.lor_length, \ rclayout.lor_stateid, "")))] env.session.compound(ops) elif lo_recalltype not in [LAYOUTRECALL4_FSID, LAYOUTRECALL4_ALL]: res = NFS4ERR_NOTSUPP return encode_status(res)
def op_cb_recall(self, arg, env): log_cb.info("In CB_RECALL") self.prehook(arg, env) res = self.posthook(arg, env, res=NFS4_OK) return encode_status(res)
def op_cb_async_read(self, arg, env): log_cb.info("In CB_ASYNC_READ") self.prehook(arg, env) res = self.posthook(arg, env, res=NFS4_OK) return encode_status(res)