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.
struct mdc_open_data {
struct obd_client_handle *mod_och;
+ struct ptlrpc_request *mod_open_req;
struct ptlrpc_request *mod_close_req;
};