[patch-2.3.99-pre7-8] /proc/filesystems update

From: Tigran Aivazian (tigran@veritas.com)
Date: Tue May 09 2000 - 09:18:58 EST


Hi Linus,

With the rich variety of FS_ flags now available it makes sense to update
/proc/filesystems output to include them, e.g.:

$ cat /proc/filesystems
nodev,single shm
nodev,single,nomount pipefs
dev ext2
nodev,single proc
nodev devfs
nodev devpts

Hence the patch below in the same spirit as /proc/mounts stuff, tested
fully.

Regards,
Tigran.

--- linux/fs/super.c Tue May 9 08:40:26 2000
+++ work/fs/super.c Tue May 9 15:08:11 2000
@@ -243,19 +243,38 @@
         return retval;
 }
 
+static struct proc_fs_type {
+ int flag;
+ const char *str;
+} fs_types[] = {
+ {FS_NO_DCACHE, ",nodcache"},
+ {FS_NO_PRELIM, ",noprelim"},
+ {FS_SINGLE, ",single"},
+ {FS_NOMOUNT, ",nomount"},
+ {0, NULL}
+};
+
 int get_filesystem_list(char * buf)
 {
         int len = 0;
         struct file_system_type * tmp;
+ struct proc_fs_type *fs_typep;
 
         read_lock(&file_systems_lock);
         tmp = file_systems;
         while (tmp && len < PAGE_SIZE - 80) {
- len += sprintf(buf+len, "%s\t%s\n",
- (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev",
- tmp->name);
+ len += sprintf(buf+len, "%s",
+ (tmp->fs_flags & FS_REQUIRES_DEV) ? "dev" : "nodev");
+ for (fs_typep = fs_types; fs_typep->flag; fs_typep++) {
+ if (tmp->fs_flags & fs_typep->flag) {
+ strcpy(buf + len, fs_typep->str);
+ len += strlen(fs_typep->str);
+ }
+ }
+ len += sprintf(buf+len, " %s\n", tmp->name);
                 tmp = tmp->next;
         }
+
         read_unlock(&file_systems_lock);
         return len;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:13 EST