summaryrefslogtreecommitdiffstats
path: root/lib/libutil/quotafile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/quotafile.c')
-rw-r--r--lib/libutil/quotafile.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libutil/quotafile.c b/lib/libutil/quotafile.c
index 4c63a17..9017c4e 100644
--- a/lib/libutil/quotafile.c
+++ b/lib/libutil/quotafile.c
@@ -61,7 +61,6 @@ static const char *qfextension[] = INITQFNAMES;
/*
* Check to see if a particular quota is to be enabled.
- * XXX merge into quota_open
*/
static int
hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize)
@@ -73,7 +72,6 @@ hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize)
static char initname, usrname[100], grpname[100];
/*
- * XXX
* 1) we only need one of these
* 2) fstab may specify a different filename
*/
@@ -207,6 +205,22 @@ quota_close(struct quotafile *qf)
free(qf);
}
+int
+quota_on(struct quotafile *qf)
+{
+ int qcmd;
+
+ qcmd = QCMD(Q_QUOTAON, qf->quotatype);
+ return (quotactl(qf->fsname, qcmd, 0, qf->qfname));
+}
+
+int
+quota_off(struct quotafile *qf)
+{
+
+ return (quotactl(qf->fsname, QCMD(Q_QUOTAOFF, qf->quotatype), 0, 0));
+}
+
const char *
quota_fsname(const struct quotafile *qf)
{
OpenPOWER on IntegriCloud