struct md_object *obj, struct lu_buf *buf,
const char *name);
+int mdd_data_get(const struct lu_env *env, struct mdd_object *obj,
+ void **data)
+{
+ LASSERTF(mdd_object_exists(obj), "FID is "DFID"\n",
+ PFID(mdd_object_fid(obj)));
+ mdo_data_get(env, obj, data);
+ return 0;
+}
+
int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
struct lu_attr *la, struct lustre_capa *capa)
{
return buf;
}
-/* preserve old data */
+/** Increase the size of the \a mti_big_buf.
+ * preserves old data in buffer
+ * old buffer remains unchanged on error
+ * \retval 0 or -ENOMEM
+ */
int mdd_buf_grow(const struct lu_env *env, ssize_t len)
{
struct lu_buf *oldbuf = &mdd_env_info(env)->mti_big_buf;
/* Get parent fid and object name */
mdd_read_lock(env, mdd_obj, MOR_TGT_CHILD);
buf = mdd_links_get(env, mdd_obj);
- if (IS_ERR(buf))
- GOTO(out, rc = PTR_ERR(buf));
mdd_read_unlock(env, mdd_obj);
mdd_object_put(env, mdd_obj);
- if (rc < 0)
- GOTO(out, rc);
+ if (IS_ERR(buf))
+ GOTO(out, rc = PTR_ERR(buf));
leh = buf->lb_buf;
lee = (struct link_ea_entry *)(leh + 1); /* link #0 */
/* get file quota for new owner */
lquota_chkquota(mds_quota_interface_ref, obd,
qnids[USRQUOTA], qnids[GRPQUOTA], 1,
- &inode_pending, NULL, 0);
+ &inode_pending, NULL, 0, NULL, 0);
block_count = (la_tmp->la_blocks + 7) >> 3;
- if (block_count)
+ if (block_count) {
+ void *data = NULL;
+ mdd_data_get(env, mdd_obj, &data);
/* get block quota for new owner */
lquota_chkquota(mds_quota_interface_ref, obd,
qnids[USRQUOTA],
qnids[GRPQUOTA],
block_count, &block_pending,
- NULL, LQUOTA_FLAGS_BLK);
+ NULL, LQUOTA_FLAGS_BLK,
+ data, 1);
+ }
}
}
#endif
if (inode_pending)
lquota_pending_commit(mds_quota_interface_ref, obd,
qnids[USRQUOTA], qnids[GRPQUOTA],
- 1, 0);
+ inode_pending, 0);
if (block_pending)
lquota_pending_commit(mds_quota_interface_ref, obd,
qnids[USRQUOTA], qnids[GRPQUOTA],
- block_count, 1);
+ block_pending, 1);
/* Trigger dqrel/dqacq for original owner and new owner.
* If failed, the next call for lquota_chkquota will
* process it. */
mdd_quota_wrapper(&ma->ma_attr, qids);
/* get file quota for child */
lquota_chkquota(mds_quota_interface_ref, obd, qids[USRQUOTA],
- qids[GRPQUOTA], 1, &inode_pending, NULL, 0);
+ qids[GRPQUOTA], 1, &inode_pending, NULL, 0,
+ NULL, 0);
switch (ma->ma_attr.la_mode & S_IFMT) {
case S_IFLNK:
case S_IFDIR:
lquota_chkquota(mds_quota_interface_ref, obd,
qids[USRQUOTA], qids[GRPQUOTA],
block_count, &block_pending, NULL,
- LQUOTA_FLAGS_BLK);
+ LQUOTA_FLAGS_BLK, NULL, 0);
}
#endif
if (inode_pending)
lquota_pending_commit(mds_quota_interface_ref, obd,
qids[USRQUOTA], qids[GRPQUOTA],
- 1, 0);
+ inode_pending, 0);
if (block_pending)
lquota_pending_commit(mds_quota_interface_ref, obd,
qids[USRQUOTA], qids[GRPQUOTA],
- block_count, 1);
+ block_pending, 1);
/* Trigger dqacq on the owner of child. If failed,
* the next call for lquota_chkquota will process it. */
lquota_adjust(mds_quota_interface_ref, obd, qids, 0, rc,