static int mdd_declare_object_initialize(const struct lu_env *env,
struct mdd_object *parent,
struct mdd_object *child,
- struct lu_attr *attr,
+ const struct lu_attr *attr,
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));
- 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);
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
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 &&