* GPL HEADER END
*/
/*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann@whamcloud.com>
struct lquota_acct_rec *rec = (struct lquota_acct_rec *)dtrec;
__u64 id = *((__u64 *)dtkey);
int rc;
+#ifdef HAVE_DQUOT_KQID
+ struct kqid qid;
+#endif
ENTRY;
memset((void *)dqblk, 0, sizeof(struct obd_dqblk));
+#ifdef HAVE_DQUOT_KQID
+ qid = make_kqid(&init_user_ns, obj2type(dtobj), id);
+ rc = sb->s_qcop->get_dqblk(sb, qid, dqblk);
+#else
rc = sb->s_qcop->get_dqblk(sb, obj2type(dtobj), (qid_t) id, dqblk);
+#endif
if (rc)
RETURN(rc);
#ifdef HAVE_DQUOT_FS_DISK_QUOTA
memset(it, 0, sizeof(*it));
lu_object_get(lo);
it->oiq_obj = obj;
- CFS_INIT_LIST_HEAD(&it->oiq_list);
+ INIT_LIST_HEAD(&it->oiq_list);
/* LUSTRE_DQTREEOFF is the initial offset where the tree can be found */
it->oiq_blk[0] = LUSTRE_DQTREEOFF;
lu_object_put(env, &it->oiq_obj->oo_dt.do_lu);
- cfs_list_for_each_entry_safe(leaf, tmp, &it->oiq_list, oql_link) {
- cfs_list_del_init(&leaf->oql_link);
+ list_for_each_entry_safe(leaf, tmp, &it->oiq_list, oql_link) {
+ list_del_init(&leaf->oql_link);
OBD_FREE_PTR(leaf);
}
EXIT;
OBD_ALLOC_PTR(leaf);
if (leaf == NULL)
RETURN(-ENOMEM);
- CFS_INIT_LIST_HEAD(&leaf->oql_link);
+ INIT_LIST_HEAD(&leaf->oql_link);
leaf->oql_blk = it->oiq_blk[depth];
- cfs_list_add_tail(&leaf->oql_link, &it->oiq_list);
+ list_add_tail(&leaf->oql_link, &it->oiq_list);
RETURN(0);
}
struct inode *inode;
int rc;
struct iam_container *bag = &(osd_dt_obj(dt))->oo_dir->od_container;
+ struct lu_buf *lb = &osd_oti_get(env)->oti_buf;
ENTRY;
LASSERT(bag->ic_root_bh != NULL);
inode = osd_dt_obj(dt)->oo_inode;
LASSERT(inode);
- rc = dt_declare_record_write(env, dt, inode->i_sb->s_blocksize * 2, 0, th);
+ /* iam_lfix_create() writes two blocks at the beginning */
+ lb->lb_len = osd_sb(osd)->s_blocksize * 2;
+ rc = dt_declare_record_write(env, dt, lb, 0, th);
if (rc)
GOTO(out, rc);
struct dt_object *root, *parent = NULL, *admin = NULL;
dt_obj_version_t version;
char *fname;
- bool isblk, converted = false;
+ bool isblk = false, converted = false;
int rc;
ENTRY;