* GPL HEADER END
*/
/*
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann@whamcloud.com>
* \param env - is the environment passed by the caller
* \param dtobj - is the accounting object
* \param dtrec - is the record to fill with space usage information
- * \param dtkey - is the id the of the user or group for which we would
+ * \param dtkey - is the id of the user or group for which we would
* like to access disk usage.
*
* \retval +ve - success : exact match
const struct dt_key *dtkey)
{
struct osd_thread_info *info = osd_oti_get(env);
-#ifdef HAVE_DQUOT_FS_DISK_QUOTA
+#if defined(HAVE_DQUOT_QC_DQBLK)
+ struct qc_dqblk *dqblk = &info->oti_qdq;
+#elif defined(HAVE_DQUOT_FS_DISK_QUOTA)
struct fs_disk_quota *dqblk = &info->oti_fdq;
#else
struct if_dqblk *dqblk = &info->oti_dqblk;
__u64 id = *((__u64 *)dtkey);
int rc;
#ifdef HAVE_DQUOT_KQID
- struct kqid qid;
+ struct kqid qid;
#endif
ENTRY;
- memset((void *)dqblk, 0, sizeof(struct obd_dqblk));
+ memset(dqblk, 0, sizeof(*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);
+ rc = sb->s_qcop->get_dqblk(sb, obj2type(dtobj), (qid_t)id, dqblk);
#endif
if (rc)
RETURN(rc);
-#ifdef HAVE_DQUOT_FS_DISK_QUOTA
+#if defined(HAVE_DQUOT_QC_DQBLK)
+ rec->bspace = dqblk->d_space;
+ rec->ispace = dqblk->d_ino_count;
+#elif defined(HAVE_DQUOT_FS_DISK_QUOTA)
rec->bspace = dqblk->d_bcount;
rec->ispace = dqblk->d_icount;
#else
struct lquota_id_info *qi, struct osd_object *obj,
bool enforce, int *flags)
{
- struct osd_device *dev = osd_dt_dev(oh->ot_super.th_dev);
- struct qsd_instance *qsd = dev->od_quota_slave;
+ struct osd_device *dev;
+ struct qsd_instance *qsd;
struct inode *inode = NULL;
int i, rc = 0, crd;
bool found = false;
LASSERTF(oh->ot_id_cnt <= OSD_MAX_UGID_CNT, "count=%d\n",
oh->ot_id_cnt);
+ dev = osd_dt_dev(oh->ot_super.th_dev);
+ LASSERT(dev != NULL);
+
+ qsd = dev->od_quota_slave;
+
for (i = 0; i < oh->ot_id_cnt; i++) {
if (oh->ot_id_array[i] == qi->lqi_id.qid_uid &&
osd_qid_type(oh, i) == qi->lqi_type) {