[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] stat: add support for more file system types
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] stat: add support for more file system types |
Date: |
Tue, 22 Dec 2009 12:20:20 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 |
On 22/12/09 10:18, Pádraig Brady wrote:
On 22/12/09 10:01, Jim Meyering wrote:
Thanks for the additions and typo fix.
For the ext4-adding part, I'm a little reluctant,
because it may break scripts that test via e.g.,
test "$(stat -f -c %T .)" = ext2/ext3&& ...
rather than the more portable -- in potential retrospect:
case $(stat -f -c %T .) in
ext2/ext3*) ... ;
esac
Yes I was a little wary, and I've just noticed:
http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00160.html
I'll leave out the ext4 bit for the moment.
I pushed forgetting about gfs and ocfs.
OK to ammend with this...
From fb4161df19d9c97b504dbbb0c11df61c17a4324a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Tue, 22 Dec 2009 12:21:45 +0000
Subject: [PATCH] stat: Recognize gfs2, ocfs2 file system types
* src/stat.c (human_fstype): Add gfs2 and ocfs2 to the list.
* NEWS: Update the stat -f entry.
---
NEWS | 2 +-
src/stat.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/NEWS b/NEWS
index c16dacd..aaaa044 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ 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.
+ stat -f recognizes more file system types: fuseblk, gfs2, ocfs2, rpc_pipefs.
Also Minix V3 is displayed correctly as minix3, not minux3.
[bug introduced in coreutils-8.1]
diff --git a/src/stat.c b/src/stat.c
index 2fdaffe..3511d95 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -268,6 +268,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
return "fusectl";
case S_MAGIC_FUTEXFS: /* 0x0BAD1DEA */
return "futexfs";
+ case S_MAGIC_GFS2: /* 0x1161970 */
+ return "gfs2";
case S_MAGIC_HFS: /* 0x4244 */
return "hfs";
case S_MAGIC_HPFS: /* 0xF995E849 */
@@ -314,6 +316,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
return "ntfs";
case S_MAGIC_OPENPROM: /* 0x9FA1 */
return "openprom";
+ case S_MAGIC_OCFS2: /* 0x7461636f */
+ return "ocfs2";
case S_MAGIC_PROC: /* 0x9FA0 */
return "proc";
case S_MAGIC_QNX4: /* 0x002F */
--
1.6.2.5