From: yury Date: Tue, 25 Apr 2006 12:58:58 +0000 (+0000) Subject: - few renames in LMV module to make it more understandable and in same time shorter. X-Git-Tag: v1_8_0_110~486^2~1933 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ee64a65c7ef5553ae3bb5a88c83c30bc8037d159;p=fs%2Flustre-release.git - few renames in LMV module to make it more understandable and in same time shorter. --- diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index a1730a3..b41fc87 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -175,7 +175,7 @@ repeat: /* directory got splitted. time to update local object and * repeat the request with proper MDS */ LASSERT(lu_fid_eq(pid, &rpid)); - rc = lmv_get_mea_and_update_object(exp, &rpid); + rc = lmv_handle_split(exp, &rpid); if (rc == 0) { ptlrpc_req_finished(*reqp); goto repeat; @@ -223,7 +223,7 @@ repeat: cid = &body->fid1; obj = lmv_obj_grab(obd, cid); - if (!obj && (mea = lmv_splitted_dir_body(*reqp, 1))) { + if (!obj && (mea = lmv_get_mea(*reqp, 1))) { /* wow! this is splitted dir, we'd like to handle it */ obj = lmv_obj_create(exp, &body->fid1, mea); if (IS_ERR(obj)) @@ -356,7 +356,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid, cid = &body->fid1; obj2 = lmv_obj_grab(obd, cid); - if (!obj2 && (mea = lmv_splitted_dir_body(*reqp, 1))) { + if (!obj2 && (mea = lmv_get_mea(*reqp, 1))) { /* wow! this is splitted dir, we'd like to handle it. */ body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body)); LASSERT(body != NULL); @@ -602,7 +602,7 @@ repeat: rc = lmv_intent_remote(exp, lmm, lmmsize, it, flags, reqp, cb_blocking, extra_lock_flags); - if (rc == 0 && (mea = lmv_splitted_dir_body(*reqp, 1))) { + if (rc == 0 && (mea = lmv_get_mea(*reqp, 1))) { /* wow! this is splitted dir, we'd like to handle it */ body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body)); LASSERT(body != NULL); diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index ec6a2a8..8aa3a12 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -124,13 +124,13 @@ int lmv_revalidate_slaves(struct obd_export *, struct ptlrpc_request **, ldlm_blocking_callback cb_blocking, int extra_lock_flags); -int lmv_get_mea_and_update_object(struct obd_export *, struct lu_fid *); +int lmv_handle_split(struct obd_export *, struct lu_fid *); int lmv_dirobj_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, void *, int); int lmv_fld_lookup(struct obd_device *obd, struct lu_fid *fid); static inline struct lmv_stripe_md * -lmv_splitted_dir_body(struct ptlrpc_request *req, int offset) +lmv_get_mea(struct ptlrpc_request *req, int offset) { struct mdt_body *body; struct lmv_stripe_md *mea; diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 5819a04..06692cf 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -906,8 +906,9 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data, RETURN(rc); } -int lmv_get_mea_and_update_object(struct obd_export *exp, - struct lu_fid *fid) +/* called in the case MDS returns -ERESTART on create on open, what means that + * directory is splitted and its LMV presentation object has to be updated. */ +int lmv_handle_split(struct obd_export *exp, struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1004,11 +1005,9 @@ repeat: CDEBUG(D_OTHER, "created. "DFID3"\n", PFID3(&op_data->fid1)); } else if (rc == -ERESTART) { - /* - * directory got splitted. time to update local object and - * repeat the request with proper MDS. - */ - rc = lmv_get_mea_and_update_object(exp, &op_data->fid1); + /* directory got splitted. time to update local object and + * repeat the request with proper MDS. */ + rc = lmv_handle_split(exp, &op_data->fid1); if (rc == 0) { ptlrpc_req_finished(*request); goto repeat; @@ -1250,7 +1249,7 @@ repeat: } else if (rc == -ERESTART) { /* directory got splitted. time to update local object and * repeat the request with proper MDS */ - rc = lmv_get_mea_and_update_object(exp, &rid); + rc = lmv_handle_split(exp, &rid); if (rc == 0) { ptlrpc_req_finished(*request); goto repeat;