Properly decrement inode refcounts when finishing a request.
[bluesky.git] / nfs3 / nfs3_prot.h
index 6a3e316..01ed7b5 100644 (file)
@@ -655,6 +655,13 @@ typedef struct {
     int frag_hdr_bytes;
 } 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 {
@@ -684,6 +691,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);