X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfs3_prot.h;h=1a442bada7445e14b1a20265af2cda749782dde4;hb=d514caf49faff9295d0e497d3b6b8856fe83f8d0;hp=42b46ba110601eb6a3dbf71203028083dd5c8286;hpb=604e560bdd2475c6e9df1eadd1bf2f85d0b07ef2;p=bluesky.git diff --git a/nfs3/nfs3_prot.h b/nfs3/nfs3_prot.h index 42b46ba..1a442ba 100644 --- a/nfs3/nfs3_prot.h +++ b/nfs3/nfs3_prot.h @@ -653,14 +653,28 @@ typedef struct { /* If frag_len is zero: the number of bytes of the fragment header that * have been read so far. */ int frag_hdr_bytes; + + /* Mutex protecting send operations on the socket (to ensure that replies + * are not accidentally interleaved). */ + GMutex *send_lock; } RPCConnection; +/* Linked list of cleanup functions to call when a request is completed. */ +struct cleanup_list { + void (*func)(void *arg); + void *arg; + struct cleanup_list *next; +}; + /* Used to track a single outstanding RPC request. Not all of the fields are * initially filled in, but more are filled in as the request is processed. */ typedef struct { /* The corresponding connection on which the request was made. */ RPCConnection *connection; + /* Timining information for generating statistics about response times. */ + int64_t time_start; + /* Transaction ID of the request, in host byte order. */ uint32_t xid; @@ -681,6 +695,10 @@ typedef struct { /* Procedure to be used for encoding the eventual return value into XDR. */ xdrproc_t xdr_result; + + /* Functions to be called when the response is sent to clean up any + * resources. */ + struct cleanup_list *cleanup; } RPCRequest; extern void async_rpc_send_reply(RPCRequest *req, void *result);