From: shaver Date: Thu, 13 Feb 2003 07:25:49 +0000 (+0000) Subject: New transno regimen: X-Git-Tag: v1_7_110~2^11~192 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0b09dc92178e2e4c14c0cfaaa567587f2b05dd86;p=fs%2Flustre-release.git New transno regimen: - no more transno semaphore: the LDLM is the one true source of concurrency control - allocate transnos and log requests for failed requests too - record request status and open-disposition in last_rcvd as well - mds_finish_transno commits the handle, if there is one (and creates its own for the last_rcvd update, if needed). Much nicer (IMO) error-handling in mds_reint.c and such. At the least, 85% fewer gotos. Rename "last_rcvd" to "(last_)transno" in various places, because it's clearer that way (again, IMO). Warning (type mismatch) fixes in osc_request that were bugging me. --- diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 88bee8d..ab2275c 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -47,9 +47,8 @@ extern kmem_cache_t *mds_file_cache; extern inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req); -extern void mds_start_transno(struct mds_obd *mds); -extern int mds_finish_transno(struct mds_obd *mds, void *handle, - struct ptlrpc_request *req, int rc); +int mds_finish_transno(struct mds_obd *mds, struct inode *i, void *handle, + struct ptlrpc_request *req, int rc, __u32 op_data); extern int enqueue_ordered_locks(int lock_mode, struct obd_device *obd, struct ldlm_res_id *p1_res_id, struct ldlm_res_id *p2_res_id, @@ -130,18 +129,18 @@ int mds_open(struct mds_update_record *rec, int offset, if ((rec->ur_flags & O_CREAT) && !dchild->d_inode) { int err; void *handle; - mds_start_transno(mds); rep->lock_policy_res1 |= IT_OPEN_CREATE; handle = fsfilt_start(obd, parent->d_inode, FSFILT_OP_CREATE); if (IS_ERR(handle)) { rc = PTR_ERR(handle); - mds_finish_transno(mds, handle, req, rc); + mds_finish_transno(mds, parent->d_inode, handle, req, + rc, rep->lock_policy_res1); GOTO(out_step_3, rc); } rc = vfs_create(parent->d_inode, dchild, rec->ur_mode); - rc = mds_finish_transno(mds, handle, req, rc); - err = fsfilt_commit(obd, parent->d_inode, handle); - if (rc || err) { + err = mds_finish_transno(mds, parent->d_inode, handle, req, rc, + rep->lock_policy_res1); + if (err) { CERROR("error on commit: err = %d\n", err); if (!rc) rc = err;