summaryrefslogtreecommitdiffstats
path: root/lib/libutil/quotafile.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2009-11-16 18:59:04 +0000
committermckusick <mckusick@FreeBSD.org>2009-11-16 18:59:04 +0000
commiteb9113cb7d8cee39cc223654d45fe20e9db3a07d (patch)
tree8850988982a36bf51d9451cdd87870d2424e1b01 /lib/libutil/quotafile.c
parent9aab49b0ca88e792c6fbb6a7809af8ce6fc4ecc5 (diff)
downloadFreeBSD-src-eb9113cb7d8cee39cc223654d45fe20e9db3a07d.zip
FreeBSD-src-eb9113cb7d8cee39cc223654d45fe20e9db3a07d.tar.gz
Add and document new quoat_on and quota_off functions.
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