>From f3953d89bfdeb0d875a9d8347723648a593888f0 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= Date: Mon, 21 Dec 2009 14:55:17 +0000 Subject: [PATCH] stat: add support for more file system types *src/stat.c (human_fstype): Add the following FS types: fuseblk, rpc_pipefs. Also fix a typo of minux3 to minix3 and add ext4 to the ext2/ext3 name. Also mention the fs-magic-compare make target to help update the list. * NEWS: Mention the fix. --- NEWS | 3 +++ src/stat.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 6d71e0f..5791e2e 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ GNU coreutils NEWS -*- outline -*- a commmand of the above form would fail for all subdirectories. [bug introduced in coreutils-8.0] + stat -f recognizes more file system types: fuseblk, rpc_pipefs. + Also minux3 is renamed to minix3 and ext4 is added to the ext2/ext3 name. + tail -f (inotify-enabled) once again works with remote files. The use of inotify with remote files meant that any changes to those files that was not done from the local system would go unnoticed. diff --git a/src/stat.c b/src/stat.c index 2d4a956..67b9068 100644 --- a/src/stat.c +++ b/src/stat.c @@ -208,7 +208,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) diff -u sym_stat sym_libc */ - /* Also sync from the list in "man 2 statfs". */ + /* Also compare with the list in "man 2 statfs" using the + fs-magic-compare make target. */ /* IMPORTANT NOTE: Each of the following `case S_MAGIC_...:' statements must be followed by a hexadecimal constant in @@ -256,11 +257,13 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) case S_MAGIC_EXT: /* 0x137D */ return "ext"; case S_MAGIC_EXT2: /* 0xEF53 */ - return "ext2/ext3"; + return "ext2/ext3/ext4"; case S_MAGIC_EXT2_OLD: /* 0xEF51 */ return "ext2"; case S_MAGIC_FAT: /* 0x4006 */ return "fat"; + case S_MAGIC_FUSEBLK: /* 0x65735546 */ + return "fuseblk"; case S_MAGIC_FUSECTL: /* 0x65735543 */ return "fusectl"; case S_MAGIC_FUTEXFS: /* 0x0BAD1DEA */ @@ -296,7 +299,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) case S_MAGIC_MINIX_V2_30: /* 0x2478 */ return "minix v2 (30 char.)"; case S_MAGIC_MINIX_V3: /* 0x4D5A */ - return "minux3"; + return "minix3"; case S_MAGIC_MSDOS: /* 0x4D44 */ return "msdos"; case S_MAGIC_NCP: /* 0x564C */ @@ -321,6 +324,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) return "reiserfs"; case S_MAGIC_ROMFS: /* 0x7275 */ return "romfs"; + case S_MAGIC_RPC_PIPEFS: /* 0x67596969 */ + return "rpc_pipefs"; case S_MAGIC_SECURITYFS: /* 0x73636673 */ return "securityfs"; case S_MAGIC_SELINUX: /* 0xF97CFF8C */ @@ -406,7 +411,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf) case FSTYPE_MISC: return "misc"; case FSTYPE_EXT2FS: - return "ext2/ext3"; + return "ext2/ext3/ext4"; case FSTYPE_HTTP: return "http"; case FSTYPE_MEMFS: -- 1.6.2.5