3 * Deal with NFS partition types
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
6 * For copying and distribution information, please see the file
11 #include <mit-copyright.h>
26 * Table of fs type names.
29 static struct pair fs_names[] = {
30 { MR_FS_STUDENT, "Student" },
31 { MR_FS_FACULTY, "Faculty" },
32 { MR_FS_STAFF, "Staff" },
33 { MR_FS_MISC, "Other" },
34 { MR_FS_GROUPQUOTA, "GroupQuota" },
35 /* Insert new entries before the 0,0 pair */
40 * Given a numeric string containing a filesystem status value, return
41 * a string indicating what allocation type it is.
43 char *format_filesys_type(char *fs_status)
49 int stat = atoi(fs_status);
53 for (pp = fs_names; pp->type; pp++)
59 strcat(buf, pp->name);
70 sprintf(buf1, "Unknown bits 0x%x", stat);
79 * Given a string describing a filesystem allocation type, return the
82 char *parse_filesys_type(char *fs_type_name)
85 char *cp = fs_type_name;
91 /* Copy next component of type to temp */
92 char *t = strchr(cp, ',');
95 memcpy(temp, cp, t - cp);
97 cp = t + 1; /* one after the comma */
105 t = strtrim(temp); /* nuke leading and trailing whitespace */
107 for (pp = fs_names; pp->type; pp++)
109 if (!strcasecmp(pp->name, t))
117 sprintf(temp, "%d", flags);