From: phil Date: Sat, 3 Jan 2004 08:52:35 +0000 (+0000) Subject: high level summary: hooks up the glimpse machinery to inode_revalidate, X-Git-Tag: v1_7_100~1^248~58 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c8b40f4d39595450ed48309e7c5fe67b149ff655;p=fs%2Flustre-release.git high level summary: hooks up the glimpse machinery to inode_revalidate, so it gets used in most stat()s. A lot of little details: - the void *cookie found in about half of the DLM APIs was removed in favour of an explicit ldlm_policy_data_t *; the remaining void *cookie are used only in intent locks, to pass a request - as a result, the policy data needs to be explicitly copied between the lock and the network packets by the caller -- ldlm_lock_enqueue no longer does it for you. - add the glimpse callback machinery to the handle_enqueue path, so ldlm_server_glimpse_callback gets called at the right time - for the moment, refresh the LVB from disk after a cancel, because it's a little too much work to cram it into the cancel packet - when filter_setattr() sets the size (i.e. filter_truncate), we also refresh the LVB -> this is the only way it can decrease - on the client side, make sure to copy the LVB from the lock into the caller's structure only _after_ the completion AST returns - a temporary layering violation, in the form of lov_merge_size - the processing_policy doesn't really populate the list quite like we'd like, so I muddied the filter_intent_policy to cope until I know exactly which API I want - fix osc_enqueue to not attempt to match intent locks (yet) --- diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index 1dceb8b..8cfcf0d 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -396,6 +396,9 @@ static int lookup_it_finish(struct ptlrpc_request *request, int offset, LASSERT(lsm->lsm_object_id != 0); + /* bug 2334: drop MDS lock before acquiring OST lock */ + ll_intent_drop_lock(it); + rc = llu_extent_lock(NULL, inode, lsm, LCK_PR, &extent, &lockh); if (rc != ELDLM_OK) { diff --git a/lustre/llite/llite_close.c b/lustre/llite/llite_close.c index bf064c0..97638f9 100644 --- a/lustre/llite/llite_close.c +++ b/lustre/llite/llite_close.c @@ -120,7 +120,7 @@ void ll_queue_done_writing(struct inode *inode) static void ll_close_done_writing(struct inode *inode) { struct ll_inode_info *lli = ll_i2info(inode); - struct ldlm_extent extent = { .start = 0, .end = OBD_OBJECT_EOF }; + ldlm_policy_data_t policy = { .l_extent = {0, OBD_OBJECT_EOF } }; struct lustre_handle lockh = { 0 }; struct obdo obdo; obd_flag valid; @@ -132,7 +132,7 @@ static void ll_close_done_writing(struct inode *inode) goto rpc; rc = ll_extent_lock_no_validate(NULL, inode, lli->lli_smd, LCK_PW, - &extent, &lockh, ast_flags); + &policy, &lockh, ast_flags); if (rc != ELDLM_OK) { CERROR("lock acquisition failed (%d): unable to send " "DONE_WRITING for inode %lu/%u\n", rc, inode->i_ino, diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 4ea561c..0ac2e3c 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -285,9 +285,8 @@ int mdc_enqueue(struct obd_export *exp, mdc_get_rpc_lock(obddev->u.cli.cl_rpc_lock, it); rc = ldlm_cli_enqueue(exp, req, obddev->obd_namespace, res_id, - lock_type, NULL, 0, lock_mode, &flags, - cb_completion, cb_blocking, NULL, cb_data, 0, - NULL, lockh); + lock_type, NULL, lock_mode, &flags, cb_completion, + cb_blocking, NULL, cb_data, NULL, 0, NULL, lockh); mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it); /* Similarly, if we're going to replay this request, we don't want to @@ -425,13 +424,12 @@ int mdc_intent_lock(struct obd_export *exp, struct ll_uctxt *uctxt, mode = LCK_PR; rc = ldlm_lock_match(exp->exp_obd->obd_namespace, flags, - &res_id, LDLM_PLAIN, NULL, 0, LCK_PR, - &lockh); + &res_id, LDLM_PLAIN, NULL, LCK_PR, &lockh); if (!rc) { mode = LCK_PW; rc = ldlm_lock_match(exp->exp_obd->obd_namespace, flags, - &res_id, LDLM_PLAIN, NULL, 0, - LCK_PW, &lockh); + &res_id, LDLM_PLAIN, NULL, LCK_PW, + &lockh); } if (rc) { memcpy(&it->d.lustre.it_lock_handle, &lockh, @@ -533,7 +531,7 @@ int mdc_intent_lock(struct obd_export *exp, struct ll_uctxt *uctxt, LDLM_LOCK_PUT(lock); memcpy(&old_lock, &lockh, sizeof(lockh)); if (ldlm_lock_match(NULL, LDLM_FL_BLOCK_GRANTED, NULL, - LDLM_PLAIN, NULL, 0, LCK_NL, &old_lock)) { + LDLM_PLAIN, NULL, LCK_NL, &old_lock)) { ldlm_lock_decref_and_cancel(&lockh, it->d.lustre.it_lock_mode); memcpy(&lockh, &old_lock, sizeof(old_lock));