as dt_create() will set the attributes we need. also, we can save
couple dt_record_write() in tgt_txn_start_cb() as one is not needed
with multislot enabled while another is not needed at all.
these changes decrease disk/memory reservation from ~33MB to 6MB.
Change-Id: I65e537dd053eb7b4e4d2cccab41973096072b1db
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/19132
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
static int mdd_declare_object_initialize(const struct lu_env *env,
struct mdd_object *parent,
struct mdd_object *child,
static int mdd_declare_object_initialize(const struct lu_env *env,
struct mdd_object *parent,
struct mdd_object *child,
+ const struct lu_attr *attr,
struct thandle *handle)
{
int rc;
ENTRY;
struct thandle *handle)
{
int rc;
ENTRY;
- /*
- * inode mode has been set in creation time, and it's based on umask,
- * la_mode and acl, don't set here again! (which will go wrong
- * because below function doesn't consider umask).
- * I'd suggest set all object attributes in creation time, see above.
- */
LASSERT(attr->la_valid & (LA_MODE | LA_TYPE));
LASSERT(attr->la_valid & (LA_MODE | LA_TYPE));
- attr->la_valid &= ~(LA_MODE | LA_TYPE);
- rc = mdo_declare_attr_set(env, child, attr, handle);
- attr->la_valid |= LA_MODE | LA_TYPE;
- if (rc != 0 || !S_ISDIR(attr->la_mode))
- RETURN(rc);
+ if (!S_ISDIR(attr->la_mode))
+ RETURN(0);
rc = mdo_declare_index_insert(env, child, mdo2fid(child), S_IFDIR,
dot, handle);
rc = mdo_declare_index_insert(env, child, mdo2fid(child), S_IFDIR,
dot, handle);
if (tsi->tsi_exp == NULL)
return 0;
if (tsi->tsi_exp == NULL)
return 0;
- dto = dt_object_locate(tgt->lut_last_rcvd, th->th_dev);
- tti_buf_lcd(tti);
-
- rc = dt_declare_record_write(env, dto, &tti->tti_buf,
- tsi->tsi_exp->exp_target_data.ted_lr_off,
- th);
- if (rc)
- return rc;
-
- tti_buf_lsd(tti);
- rc = dt_declare_record_write(env, dto, &tti->tti_buf, 0, th);
- if (rc)
- return rc;
-
if (tgt_is_multimodrpcs_client(tsi->tsi_exp)) {
/*
* Use maximum possible file offset for declaration to ensure
if (tgt_is_multimodrpcs_client(tsi->tsi_exp)) {
/*
* Use maximum possible file offset for declaration to ensure
tti->tti_off, th);
if (rc)
return rc;
tti->tti_off, th);
if (rc)
return rc;
+ } else {
+ dto = dt_object_locate(tgt->lut_last_rcvd, th->th_dev);
+ tti_buf_lcd(tti);
+ tti->tti_off = tsi->tsi_exp->exp_target_data.ted_lr_off;
+ rc = dt_declare_record_write(env, dto, &tti->tti_buf,
+ tti->tti_off, th);
+ if (rc)
+ return rc;
}
if (tsi->tsi_vbr_obj != NULL &&
}
if (tsi->tsi_vbr_obj != NULL &&