Created
June 24, 2012 13:54
-
-
Save hiboma/2983301 to your computer and use it in GitHub Desktop.
quotactl(2) to get xfs project quota
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/quota.h> | |
#include <xfs/xfs.h> | |
#include <xfs/xqm.h> | |
int main(int argc, const char *argv[]) { | |
fs_disk_quota_t d; | |
uint id; | |
uint type; | |
const char *dev = "/dev/vdc1"; | |
fs_disk_quota_t c; | |
if(quotactl(QCMD(Q_XGETQUOTA,XFS_PROJ_QUOTA), dev, 9999999, (caddr_t)&c) < 0) { | |
perror("quotactl(Q_XGETQUOTA|XFS_PROJ_QUOTA)"); | |
exit(1); | |
} | |
printf("%d\n", c.d_id); | |
printf("%d %d\n", c.d_bcount >> 1, c.d_blk_softlimit >> 1); | |
printf("%d\n", c.d_ino_softlimit); | |
printf("%d\n", c.d_ino_hardlimit); | |
exit(0); | |
} |
Author
hiboma
commented
Jun 24, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment