Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/quotacheck If -a, we do not want to pay the cost of...



details:   https://anonhg.NetBSD.org/src/rev/449e0b2a7521
branches:  trunk
changeset: 467906:449e0b2a7521
user:      abs <abs%NetBSD.org@localhost>
date:      Tue Mar 30 23:56:26 1999 +0000

description:
If -a, we do not want to pay the cost of processing every group and password
entry if there are no filesystems with quotas. Speeds up boot on a large YP
site without quotas considerably. If a filesystem has quotas we process
/etc/fstab twice, which is very cheap in relative terms.

diffstat:

 usr.sbin/quotacheck/quotacheck.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 2850813f1ad8 -r 449e0b2a7521 usr.sbin/quotacheck/quotacheck.c
--- a/usr.sbin/quotacheck/quotacheck.c  Tue Mar 30 22:35:21 1999 +0000
+++ b/usr.sbin/quotacheck/quotacheck.c  Tue Mar 30 23:56:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: quotacheck.c,v 1.19 1998/08/27 20:31:01 ross Exp $     */
+/*     $NetBSD: quotacheck.c,v 1.20 1999/03/30 23:56:26 abs Exp $      */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)quotacheck.c       8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: quotacheck.c,v 1.19 1998/08/27 20:31:01 ross Exp $");
+__RCSID("$NetBSD: quotacheck.c,v 1.20 1999/03/30 23:56:26 abs Exp $");
 #endif
 #endif /* not lint */
 
@@ -180,6 +180,21 @@
                gflag++;
                uflag++;
        }
+
+       /* If -a, we do not want to pay the cost of processing every
+        * group and password entry if there are no filesystems with quotas
+        */
+       if (aflag) {
+               i = 0;
+               while ((fs = getfsent()) != NULL) {
+                       if (needchk(fs))
+                               i=1;
+               }
+               endfsent();
+               if (!i) /* No filesystems with quotas */
+                       exit(0);
+       }
+
        if (gflag) {
                setgrent();
                while ((gr = getgrent()) != 0)



Home | Main Index | Thread Index | Old Index