--- quota-fs.c.orig	2006-06-26 11:23:30.000000000 +0900
+++ quota-fs.c	2006-06-26 11:27:52.000000000 +0900
@@ -191,7 +191,7 @@
 		     /* BSD, AIX */
 		     root->mount->device_path, QCMD(Q_GETQUOTA, USRQUOTA),
 #endif
-		     root->uid, (void *)&dqblk) < 0) {
+		     root->uid, (caddr_t)&dqblk) < 0) {
 		i_error("quotactl(Q_GETQUOTA, %s) failed: %m",
 			root->mount->device_path);
 		quota_set_error(_root->setup->quota, "Internal quota error");
@@ -211,8 +211,13 @@
 		return -1;
 	}
 #endif
+#if _LINUX_QUOTA_VERSION < 2
 	*value_r = (uint64_t)dqblk.dqb_curblocks *
 		(uint64_t)root->mount->blk_size / 1024 / 4096;
+#else
+	*value_r = (uint64_t)dqblk.dqb_curspace *
+		(uint64_t)root->mount->blk_size / 1024 / 4096;
+#endif
 	*limit_r = (uint64_t)dqblk.dqb_bsoftlimit *
 		(uint64_t)root->mount->blk_size / 1024 / 4;
 	return 1;