From: Andreas Dilger Date: Thu, 13 May 2021 10:27:49 +0000 (-0600) Subject: LU-14430 mdd: rename mti_big_buf to mdi_big_buf X-Git-Tag: 2.14.53~46 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f9f38c33ab8484102cdb3736868f4e7bece594ae LU-14430 mdd: rename mti_big_buf to mdi_big_buf Avoid serious confusion with the MDT mti_big_buf, and other fields in mdd_thread_info, since they are two separate buffers completely. mti_big_buf->mdi_big_buf mti_chlg_buf->mdi_chlg_buf mti_link_buf->mdi_link_buf mti_xattr_buf->mdi_xattr_buf The first patch of several to rename all mdd_thread_info fields. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Ib0ec91c8481e747ed058afe5c08c3f60203ebbe5 Reviewed-on: https://review.whamcloud.com/43738 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 9c01dc6..ad5ef5f 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -157,6 +157,9 @@ l_wait_condition||wait_event_idle \bMIN\(||min_t mdo2fid||mdd_object_fid mktemp||mkstemp +mti_chlg_buf||mdi_chlg_buf +mti_link_buf||mdi_link_buf +mti_xattr_buf||mdi_xattr_buf OS_STATE_DEGRADED||OS_STATFS_DEGRADED OS_STATE_READONLY||OS_STATFS_READONLY OS_STATE_NOPRECREATE||OS_STATFS_NOPRECREATE diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 1ce1c2e..8ea6adc 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -796,7 +796,7 @@ int mdd_changelog_write_header(const struct lu_env *env, } reclen = llog_data_len(sizeof(*rec) + len); - buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen); + buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_chlg_buf, reclen); if (buf->lb_buf == NULL) RETURN(-ENOMEM); rec = buf->lb_buf; @@ -2273,10 +2273,10 @@ static void mdd_key_fini(const struct lu_context *ctx, { struct mdd_thread_info *info = data; - lu_buf_free(&info->mti_big_buf); - lu_buf_free(&info->mti_link_buf); - lu_buf_free(&info->mti_xattr_buf); - lu_buf_free(&info->mti_chlg_buf); + lu_buf_free(&info->mdi_big_buf); + lu_buf_free(&info->mdi_link_buf); + lu_buf_free(&info->mdi_xattr_buf); + lu_buf_free(&info->mdi_chlg_buf); OBD_FREE_PTR(info); } diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index 5a0d54f..9500da5 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -123,7 +123,7 @@ int mdd_lookup(const struct lu_env *env, } /** Read the link EA into a temp buffer. - * Uses the mdd_thread_info::mti_link_buf since it is generally large. + * Uses the mdd_thread_info::mdi_link_buf since it is generally large. * A pointer to the buffer is stored in \a ldata::ld_buf. * * \retval 0 or error @@ -139,7 +139,7 @@ static int __mdd_links_read(const struct lu_env *env, /* First try a small buf */ LASSERT(env != NULL); - ldata->ld_buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_link_buf, + ldata->ld_buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_link_buf, PAGE_SIZE); if (ldata->ld_buf->lb_buf == NULL) return -ENOMEM; @@ -212,11 +212,11 @@ static inline int mdd_parent_fid(const struct lu_env *env, const struct lu_attr *attr, struct lu_fid *fid) { - struct mdd_thread_info *info = mdd_env_info(env); - struct linkea_data ldata = { NULL }; - struct lu_buf *buf = &info->mti_link_buf; - struct lu_name lname; - int rc = 0; + struct mdd_thread_info *info = mdd_env_info(env); + struct linkea_data ldata = { NULL }; + struct lu_buf *buf = &info->mdi_link_buf; + struct lu_name lname; + int rc = 0; ENTRY; @@ -1001,7 +1001,7 @@ int mdd_changelog_ns_store(const struct lu_env *env, LASSERT(handle != NULL); reclen = mdd_llog_record_calc_size(env, tname, sname); - buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen); + buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_chlg_buf, reclen); if (buf->lb_buf == NULL) RETURN(-ENOMEM); rec = buf->lb_buf; @@ -1079,7 +1079,7 @@ static int __mdd_links_add(const struct lu_env *env, if (rc != -ENODATA) return rc; rc = linkea_data_new(ldata, - &mdd_env_info(env)->mti_link_buf); + &mdd_env_info(env)->mdi_link_buf); if (rc) return rc; } @@ -1258,7 +1258,7 @@ static inline int mdd_links_del(const struct lu_env *env, /** Read the link EA into a temp buffer. * Uses the name_buf since it is generally large. * \retval IS_ERR err - * \retval ptr to \a lu_buf (always \a mti_link_buf) + * \retval ptr to \a lu_buf (always \a mdi_link_buf) */ struct lu_buf *mdd_links_get(const struct lu_env *env, struct mdd_object *mdd_obj) @@ -1379,15 +1379,15 @@ static int mdd_declare_link(const struct lu_env *env, } static int mdd_link(const struct lu_env *env, struct md_object *tgt_obj, - struct md_object *src_obj, const struct lu_name *lname, - struct md_attr *ma) + struct md_object *src_obj, const struct lu_name *lname, + struct md_attr *ma) { - const char *name = lname->ln_name; - struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix; - struct mdd_object *mdd_tobj = md2mdd_obj(tgt_obj); - struct mdd_object *mdd_sobj = md2mdd_obj(src_obj); - struct lu_attr *cattr = MDD_ENV_VAR(env, cattr); - struct lu_attr *tattr = MDD_ENV_VAR(env, tattr); + const char *name = lname->ln_name; + struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix; + struct mdd_object *mdd_tobj = md2mdd_obj(tgt_obj); + struct mdd_object *mdd_sobj = md2mdd_obj(src_obj); + struct lu_attr *cattr = MDD_ENV_VAR(env, cattr); + struct lu_attr *tattr = MDD_ENV_VAR(env, tattr); struct mdd_device *mdd = mdo2mdd(src_obj); struct thandle *handle; struct lu_fid *tfid = &mdd_env_info(env)->mti_fid2; @@ -2621,11 +2621,11 @@ int mdd_create(const struct lu_env *env, struct md_object *pobj, GOTO(out_free, rc = PTR_ERR(handle)); use_bigger_buffer: - acl_buf = *lu_buf_check_and_alloc(&info->mti_xattr_buf, acl_size); + acl_buf = *lu_buf_check_and_alloc(&info->mdi_xattr_buf, acl_size); if (!acl_buf.lb_buf) GOTO(out_stop, rc = -ENOMEM); - def_acl_buf = *lu_buf_check_and_alloc(&info->mti_big_buf, acl_size); + def_acl_buf = *lu_buf_check_and_alloc(&info->mdi_big_buf, acl_size); if (!def_acl_buf.lb_buf) GOTO(out_stop, rc = -ENOMEM); @@ -3386,11 +3386,11 @@ static int mdd_iterate_xattrs(const struct lu_env *env, if (list_xsize < 0) RETURN(list_xsize); - lu_buf_check_and_alloc(&info->mti_big_buf, list_xsize); - if (info->mti_big_buf.lb_buf == NULL) + lu_buf_check_and_alloc(&info->mdi_big_buf, list_xsize); + if (info->mdi_big_buf.lb_buf == NULL) RETURN(-ENOMEM); - list_xbuf.lb_buf = info->mti_big_buf.lb_buf; + list_xbuf.lb_buf = info->mdi_big_buf.lb_buf; list_xbuf.lb_len = list_xsize; rc = mdo_xattr_list(env, sobj, &list_xbuf); if (rc < 0) diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index ca63b9c..1765a85 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -199,12 +199,12 @@ struct mdd_thread_info { char mti_key[NAME_MAX + 16]; int mti_flags; char mti_name[NAME_MAX + 1]; - struct lu_buf mti_buf[4]; + struct lu_buf mdi_buf[4]; /* persistent buffers, must be handled with lu_buf_alloc/free */ - struct lu_buf mti_big_buf; - struct lu_buf mti_chlg_buf; - struct lu_buf mti_link_buf; /* buf for link ea */ - struct lu_buf mti_xattr_buf; + struct lu_buf mdi_big_buf; + struct lu_buf mdi_chlg_buf; + struct lu_buf mdi_link_buf; /* buf for link ea */ + struct lu_buf mdi_xattr_buf; struct obdo mti_oa; struct dt_allocation_hint mti_hint; struct dt_object_format mti_dof; diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index c56392e..a971817 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -250,7 +250,7 @@ struct lu_buf *mdd_buf_get(const struct lu_env *env, void *area, ssize_t len) { struct lu_buf *buf; - buf = &mdd_env_info(env)->mti_buf[0]; + buf = &mdd_env_info(env)->mdi_buf[0]; buf->lb_buf = area; buf->lb_len = len; return buf; @@ -261,7 +261,7 @@ const struct lu_buf *mdd_buf_get_const(const struct lu_env *env, { struct lu_buf *buf; - buf = &mdd_env_info(env)->mti_buf[0]; + buf = &mdd_env_info(env)->mdi_buf[0]; buf->lb_buf = (void *)area; buf->lb_len = len; return buf; @@ -911,7 +911,7 @@ static int mdd_changelog_data_store_by_fid(const struct lu_env *env, reclen = llog_data_len(LLOG_CHANGELOG_HDR_SZ + changelog_rec_offset(clf_flags & CLF_SUPPORTED, xflags & CLFE_SUPPORTED)); - buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen); + buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_chlg_buf, reclen); if (buf->lb_buf == NULL) RETURN(-ENOMEM); rec = buf->lb_buf; @@ -1458,7 +1458,7 @@ static int mdd_hsm_update_locked(const struct lu_env *env, RETURN(-ENOMEM); /* Read HSM attrs from disk */ - current_buf = lu_buf_check_and_alloc(&info->mti_xattr_buf, + current_buf = lu_buf_check_and_alloc(&info->mdi_xattr_buf, min_t(unsigned int, mdd_obj2mdd_dev(mdd_obj)->mdd_dt_conf.ddp_max_ea_size, XATTR_SIZE_MAX)); @@ -1540,8 +1540,8 @@ static int mdd_xattr_merge(const struct lu_env *env, struct md_object *md_obj, struct mdd_device *mdd = mdo2mdd(md_obj); struct mdd_object *obj = md2mdd_obj(md_obj); struct mdd_object *vic = md2mdd_obj(md_vic); - struct lu_buf *buf = &mdd_env_info(env)->mti_buf[0]; - struct lu_buf *buf_vic = &mdd_env_info(env)->mti_buf[1]; + struct lu_buf *buf = &mdd_env_info(env)->mdi_buf[0]; + struct lu_buf *buf_vic = &mdd_env_info(env)->mdi_buf[1]; struct lov_mds_md *lmm; struct thandle *handle; int rc; @@ -1770,9 +1770,9 @@ static int mdd_xattr_split(const struct lu_env *env, struct md_object *md_obj, struct mdd_device *mdd = mdo2mdd(md_obj); struct mdd_object *obj = md2mdd_obj(md_obj); struct mdd_object *vic = NULL; - struct lu_buf *buf = &mdd_env_info(env)->mti_buf[0]; - struct lu_buf *buf_save = &mdd_env_info(env)->mti_buf[1]; - struct lu_buf *buf_vic = &mdd_env_info(env)->mti_buf[2]; + struct lu_buf *buf = &mdd_env_info(env)->mdi_buf[0]; + struct lu_buf *buf_save = &mdd_env_info(env)->mdi_buf[1]; + struct lu_buf *buf_vic = &mdd_env_info(env)->mdi_buf[2]; struct lov_comp_md_v1 *lcm; struct thandle *handle; int rc; @@ -2141,7 +2141,7 @@ stop: int mdd_stripe_get(const struct lu_env *env, struct mdd_object *obj, struct lu_buf *lmm_buf, const char *name) { - struct lu_buf *buf = &mdd_env_info(env)->mti_big_buf; + struct lu_buf *buf = &mdd_env_info(env)->mdi_big_buf; int rc; ENTRY; @@ -2155,9 +2155,9 @@ int mdd_stripe_get(const struct lu_env *env, struct mdd_object *obj, repeat: rc = mdo_xattr_get(env, obj, buf, name); if (rc == -ERANGE) { - /* mti_big_buf is allocated but is too small + /* mdi_big_buf is allocated but is too small * we need to increase it */ - buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_big_buf, + buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_big_buf, buf->lb_len * 2); if (buf->lb_buf == NULL) RETURN(-ENOMEM); @@ -2174,7 +2174,7 @@ repeat: /* * we don't use lmm_buf directly, because we don't know xattr size, so - * by using mti_big_buf we can avoid calling mdo_xattr_get() twice. + * by using mdi_big_buf we can avoid calling mdo_xattr_get() twice. */ memcpy(lmm_buf->lb_buf, buf->lb_buf, rc); @@ -2386,10 +2386,10 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1, struct lu_attr *snd_la = MDD_ENV_VAR(env, tattr); struct mdd_device *mdd = mdo2mdd(obj1); struct lov_mds_md *fst_lmm, *snd_lmm; - struct lu_buf *fst_buf = &info->mti_buf[0]; - struct lu_buf *snd_buf = &info->mti_buf[1]; - struct lu_buf *fst_hsm_buf = &info->mti_buf[2]; - struct lu_buf *snd_hsm_buf = &info->mti_buf[3]; + struct lu_buf *fst_buf = &info->mdi_buf[0]; + struct lu_buf *snd_buf = &info->mdi_buf[1]; + struct lu_buf *fst_hsm_buf = &info->mdi_buf[2]; + struct lu_buf *snd_hsm_buf = &info->mdi_buf[3]; struct ost_id *saved_oi = NULL; struct thandle *handle; struct mdd_object *dom_o = NULL; @@ -2400,8 +2400,8 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1, ENTRY; - BUILD_BUG_ON(ARRAY_SIZE(info->mti_buf) < 4); - memset(info->mti_buf, 0, sizeof(info->mti_buf)); + BUILD_BUG_ON(ARRAY_SIZE(info->mdi_buf) < 4); + memset(info->mdi_buf, 0, sizeof(info->mdi_buf)); /* we have to sort the 2 obj, so locking will always * be in the same order, even in case of 2 concurrent swaps */ @@ -2781,7 +2781,7 @@ mdd_layout_update_rdonly(const struct lu_env *env, struct mdd_object *obj, struct md_layout_change *mlc, struct thandle *handle) { struct mdd_device *mdd = mdd_obj2mdd_dev(obj); - struct lu_buf *som_buf = &mdd_env_info(env)->mti_buf[1]; + struct lu_buf *som_buf = &mdd_env_info(env)->mdi_buf[1]; struct lustre_som_attrs *som = &mlc->mlc_som; int fl = 0; int rc; @@ -2877,7 +2877,7 @@ mdd_layout_update_write_pending(const struct lu_env *env, struct thandle *handle) { struct mdd_device *mdd = mdd_obj2mdd_dev(obj); - struct lu_buf *som_buf = &mdd_env_info(env)->mti_buf[1]; + struct lu_buf *som_buf = &mdd_env_info(env)->mdi_buf[1]; struct lustre_som_attrs *som = &mlc->mlc_som; int fl = 0; int rc; @@ -2969,7 +2969,7 @@ mdd_object_update_sync_pending(const struct lu_env *env, struct mdd_object *obj, struct md_layout_change *mlc, struct thandle *handle) { struct mdd_device *mdd = mdd_obj2mdd_dev(obj); - struct lu_buf *som_buf = &mdd_env_info(env)->mti_buf[1]; + struct lu_buf *som_buf = &mdd_env_info(env)->mdi_buf[1]; int fl = 0; int rc; ENTRY; diff --git a/lustre/mdd/mdd_permission.c b/lustre/mdd/mdd_permission.c index 6a136ba..b7321aa 100644 --- a/lustre/mdd/mdd_permission.c +++ b/lustre/mdd/mdd_permission.c @@ -60,11 +60,11 @@ int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode, ENTRY; - lu_buf_check_and_alloc(&mdd_env_info(env)->mti_xattr_buf, + lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_xattr_buf, min_t(unsigned int, mdd_obj2mdd_dev(o)->mdd_dt_conf.ddp_max_ea_size, XATTR_SIZE_MAX)); - buf = mdd_env_info(env)->mti_xattr_buf; + buf = mdd_env_info(env)->mdi_xattr_buf; if (buf.lb_buf == NULL) RETURN(-ENOMEM); @@ -216,11 +216,11 @@ static int mdd_check_acl(const struct lu_env *env, struct mdd_object *obj, int rc; ENTRY; - lu_buf_check_and_alloc(&mdd_env_info(env)->mti_xattr_buf, + lu_buf_check_and_alloc(&mdd_env_info(env)->mdi_xattr_buf, min_t(unsigned int, mdd_obj2mdd_dev(obj)->mdd_dt_conf.ddp_max_ea_size, XATTR_SIZE_MAX)); - buf = mdd_env_info(env)->mti_xattr_buf; + buf = mdd_env_info(env)->mdi_xattr_buf; if (buf.lb_buf == NULL) RETURN(-ENOMEM);