Motr  M0
m0_rpc_item_ops Struct Reference

#include <item.h>

Collaboration diagram for m0_rpc_item_ops:
Collaboration graph

Data Fields

void(* rio_sent )(struct m0_rpc_item *item)
 
void(* rio_replied )(struct m0_rpc_item *item)
 

Detailed Description

Definition at line 256 of file item.h.

Field Documentation

◆ rio_replied

void(* rio_replied) (struct m0_rpc_item *item)

RPC layer executes this callback only for request items when,

  • a reply is received to the request item;
  • or any failure has occured (including timeout, item not posted due to service being cancelled) in which case item->ri_error != 0

If item->ri_error != 0, then item->ri_reply may or may not be NULL.

For a request, sender can receive one of following two types of replies:

  • generic-reply (m0_fop_generic_reply): This type of reply is received when operation fails in generic fom phases;
  • operation specific reply.

Implementation of rio_replied() should check three levels of error, in specified sequence, to determine operation status:

  1. item->ri_error;
  2. error reported by generic-reply fop;
  3. error code in operation specific part of fop.
    See also
    m0_rpc_session_terminate_reply_received() for example.
    m0_rpc_item_is_generic_reply_fop()
    m0_rpc_item_generic_reply_rc()
    IMP: Called with rpc-machine mutex held. Do not reenter in RPC. Implementation of rio_replied() should avoid taking any locks, to ensure there are no lock ordering violations within application locks and rpc-machine lock. If taking application level lock is essential then consider using AST. See rm/rm_fops.c:rm_reply_process() for example.

Definition at line 300 of file item.h.

◆ rio_sent

void(* rio_sent) (struct m0_rpc_item *item)

RPC layer executes this callback when,

  • item is sent over the network;
  • or item sending failed in which case item->ri_error != 0.

Note that it does not state anything about whether item is received on receiver or not.

IMP: Called with rpc-machine mutex held. Do not reenter in RPC.

Definition at line 267 of file item.h.


The documentation for this struct was generated from the following file: