[5413] in Athena Bugs
quota enhancement
daemon@ATHENA.MIT.EDU (John Carr)
Wed Jul 4 19:20:39 1990
To: bugs@ATHENA.MIT.EDU
Date: Wed, 04 Jul 90 19:20:28 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
This adds an option "-f" to select only certain filesystems to display.
Users can in general be told "run quota -v ~" with this addition, to avoid
confusion with multiple filesystems.
Note: I do not claim this gets quota for the filesystem containing the
argument to -f. Given a string, it prints quotas for all NFS filesystems
the mountpoints of which (as recorded in mtab) begin with that string. This
is usually, but not always, the same.
*** /source/bsd-4.3/common/ucb/quota/quota.c Wed Jun 27 11:39:35 1990
--- quota.c Wed Jul 4 19:12:36 1990
***************
*** 47,52 ****
--- 47,54 ----
#define QFNAME "quotas"
#define kb(n) (howmany(dbtob(n), 1024))
+ char *fslist[16];
+ int fsind = 0;
main(argc, argv)
char *argv[];
***************
*** 66,71 ****
--- 68,84 ----
gflag=1;
break;
+ case 'f':
+ if(fsind < 16)
+ {
+ fslist[fsind++] = argv[1];
+ argv++;
+ argc--;
+ break;
+ } else {
+ fprintf(stderr, "quota: too many filesystems\n");
+ exit(2);
+ }
default:
fprintf(stderr, "quota: %c: unknown option\n",
*cp);
***************
*** 193,198 ****
--- 206,220 ----
if (getlocalquota(mntp, id, &qvalues)) continue;
}
else if (!localflag && (strcmp(mntp->mnt_type, MNTTYPE_NFS) == 0)){
+ if (fsind)
+ {
+ int i, l = strlen(mntp->mnt_dir);
+ for(i = 0;i < fsind;i++)
+ if(!strncmp(mntp->mnt_dir, fslist[i], l))
+ break;
+ if(i == fsind)
+ continue;
+ }
if (!getnfsquota(mntp, id, &qvalues)) continue;
}
else {