]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota-fs: Default to quota API v2 if _LINUX_QUOTA_VERSION is undefined.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 18 Oct 2017 13:21:52 +0000 (16:21 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 27 Oct 2017 18:38:26 +0000 (21:38 +0300)
glibc v2.25 drops v1 support in sys/quota.h and doesn't define
_LINUX_QUOTA_VERSION.

src/plugins/quota/quota-fs.c

index 750019a194ce93c8c54f9ed3a2be0c01722e8673..fbd80aaed3f438bdd6861bdd77fa9948bb73a0ce 100644 (file)
 #  define dqb_curblocks dqb_curspace
 #endif
 
-/* Older sys/quota.h doesn't define _LINUX_QUOTA_VERSION at all, which means
-   it supports only v1 quota */
+/* Very old sys/quota.h doesn't define _LINUX_QUOTA_VERSION at all, which means
+   it supports only v1 quota. However, new sys/quota.h (glibc 2.25) removes
+   support for v1 entirely and again it doesn't define it. I guess we can just
+   assume v2 now, and if someone still wants v1 support they can add
+   -D_LINUX_QUOTA_VERSION=1 to CFLAGS. */
 #ifndef _LINUX_QUOTA_VERSION
-#  define _LINUX_QUOTA_VERSION 1
+#  define _LINUX_QUOTA_VERSION 2
 #endif
 
 #define mount_type_is_nfs(mount) \