From 2d44df497660e96f2fecf3327956d090d8b4a971 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 10 Oct 2003 08:18:04 +0000 Subject: [PATCH] b=2104 Clean up a spaghetti of pointers between the open request, close request, obd_client_handle, and mdc_open_data. Notable changes: - the obd_client_handle points to the mdc_open_data, and the mdc_open_data points back to the och. Previously, och pointed to open_req, and open_req pointed to mod. - mod also points to open_req and close_req, which both point back to mod in the req_cb_data. Previously, open_req pointed to mod, close_req pointed to open_req, and mod only pointed to close_req. - we no longer avoid the normal decref at the end of open (ll_file_open and ll_lov_setstripe), only to "balance" that with a decref in mdc_commit_close. Instead, we decref at the end of open and rely on open_req->rq_replay to pin the request until mdc_commit_close sets rq_replay to 0. - mdc_commit_open does a better job of cleaning up, by clearing mod->close_req->rq_cb_data - mdc_commit_close now recognizes the possibility that open_req was freed before close_req (when the import is invalidated, for example), and handles the missing mdc_open_data with grace - the new pointer arrangement requires mdc_pin/unpin to alloc/free an mdc_open_data - mdc_close, in an error case which returned an open request without a transno, would "manually" commit that request by calling the commit_cb, which I found distasteful. Instead, the more general after_reply(), if it does not save a request for replay, calls commit_cb. --- lustre/mdc/mdc_internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/mdc/mdc_internal.h b/lustre/mdc/mdc_internal.h index 7757d8a..0605261 100644 --- a/lustre/mdc/mdc_internal.h +++ b/lustre/mdc/mdc_internal.h @@ -26,6 +26,7 @@ void mdc_rename_pack(struct ptlrpc_request *req, int offset, struct mdc_open_data { struct obd_client_handle *mod_och; + struct ptlrpc_request *mod_open_req; struct ptlrpc_request *mod_close_req; }; -- 1.8.3.1