Do not use an lu_buf just to declare the changelog record. This
only needs llog_rec_hdr to pass in lrh_len, so declaring rec_hdr
on the stack avoids the overhead of using the lu_buf.
Fixes:
f3d03bc38a ("LU-14430 mdd: fix inheritance of big default ACLs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I7b6f1d761aa98aa6ecb023894bde03dce23ebbe5
Reviewed-on: https://review.whamcloud.com/43683
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
const struct lu_name *sname,
struct thandle *handle)
{
const struct lu_name *sname,
struct thandle *handle)
{
- struct obd_device *obd = mdd2obd_dev(mdd);
- struct llog_ctxt *ctxt;
- struct llog_changelog_rec *rec;
- struct lu_buf *buf;
- struct thandle *llog_th;
- int reclen;
- int rc;
+ struct obd_device *obd = mdd2obd_dev(mdd);
+ struct llog_ctxt *ctxt;
+ struct llog_rec_hdr rec_hdr;
+ struct thandle *llog_th;
+ int rc;
if (!mdd_changelog_enabled(env, mdd, type))
return 0;
if (!mdd_changelog_enabled(env, mdd, type))
return 0;
- reclen = mdd_llog_record_calc_size(env, tname, sname);
- buf = lu_buf_check_and_alloc(&mdd_env_info(env)->mti_chlg_buf, reclen);
- if (buf->lb_buf == NULL)
- return -ENOMEM;
-
- rec = buf->lb_buf;
- rec->cr_hdr.lrh_len = reclen;
- rec->cr_hdr.lrh_type = CHANGELOG_REC;
+ rec_hdr.lrh_len = mdd_llog_record_calc_size(env, tname, sname);
+ rec_hdr.lrh_type = CHANGELOG_REC;
ctxt = llog_get_context(obd, LLOG_CHANGELOG_ORIG_CTXT);
if (ctxt == NULL)
ctxt = llog_get_context(obd, LLOG_CHANGELOG_ORIG_CTXT);
if (ctxt == NULL)
if (IS_ERR(llog_th))
GOTO(out_put, rc = PTR_ERR(llog_th));
if (IS_ERR(llog_th))
GOTO(out_put, rc = PTR_ERR(llog_th));
- rc = llog_declare_add(env, ctxt->loc_handle, &rec->cr_hdr, llog_th);
+ rc = llog_declare_add(env, ctxt->loc_handle, &rec_hdr, llog_th);
out_put:
llog_ctxt_put(ctxt);
out_put:
llog_ctxt_put(ctxt);