mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Test for quota support the same way the user tools do.
This commit is contained in:
+3
-2
@@ -140,6 +140,9 @@ hasxfsquota(int type, int q, char *device)
|
||||
fs_quota_stat_t qstat;
|
||||
int qcmd;
|
||||
|
||||
if (q == 0)
|
||||
return (access("/proc/fs/xfs/xqm", F_OK) < 0);
|
||||
|
||||
memset(&qstat, 0, sizeof(fs_quota_stat_t));
|
||||
qcmd = QCMD(Q_XGETQSTAT, type);
|
||||
if (quotactl(qcmd, device, 0, (caddr_t)&qstat) < 0) {
|
||||
@@ -147,8 +150,6 @@ hasxfsquota(int type, int q, char *device)
|
||||
perror("quotactl");
|
||||
return (1);
|
||||
}
|
||||
else if (q == 0)
|
||||
return (0);
|
||||
else if (q == XFS_QUOTA_UDQ_ENFD && qstat.qs_flags & XFS_QUOTA_UDQ_ENFD)
|
||||
return (0);
|
||||
else if (q == XFS_QUOTA_GDQ_ENFD && qstat.qs_flags & XFS_QUOTA_GDQ_ENFD)
|
||||
|
||||
Reference in New Issue
Block a user