coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] stat: replace file system type "ext2/ext3" by "ext2/ext3/ext


From: Pádraig Brady
Subject: Re: [PATCH] stat: replace file system type "ext2/ext3" by "ext2/ext3/ext4"
Date: Sun, 09 Dec 2012 12:06:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 12/08/2012 07:07 PM, Bernhard Voelker wrote:
I noticed that my ext4 file system was reported as
"ext2/ext3" by "stat -f". Would it harm to add "ext4"?

Have a nice day,
Berny

From 12056448f26596cb620e7e5fb62636a1dd05bf1f Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Sat, 8 Dec 2012 19:59:17 +0100
Subject: [PATCH] stat: replace file system type "ext2/ext3" by
  "ext2/ext3/ext4"

* src/stat.c (human_fstype): Do the above replacement in the
Linux case S_MAGIC_EXT2 and in the GNU case FSTYPE_EXT2FS.
* NEWS (Changes in behavior): Mention the change.
---
  NEWS       |    3 +++
  src/stat.c |    4 ++--
  2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 0e1414c..20ec3f7 100644
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,9 @@ GNU coreutils NEWS                                    -*- 
outline -*-
    nl no longer supports the --page-increment option which was deprecated
    since coreutils-7.5.  Use --line-increment instead.

+  stat -f now reports the file system type 0xEF53 as "ext2/ext3/ext4".
+  Before, it would only print "ext2/ext3".
+
  ** Build-related

    Perl is now more of a prerequisite.  It has long been required in order
diff --git a/src/stat.c b/src/stat.c
index 51f4b90..3df89f8 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -291,7 +291,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
      case S_MAGIC_EXT: /* 0x137D local */
        return "ext";
      case S_MAGIC_EXT2: /* 0xEF53 local */
-      return "ext2/ext3";
+      return "ext2/ext3/ext4";
      case S_MAGIC_EXT2_OLD: /* 0xEF51 local */
        return "ext2";
      case S_MAGIC_FAT: /* 0x4006 local */
@@ -478,7 +478,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:


Yes that is tempting, however...
http://lists.gnu.org/archive/html/bug-coreutils/2009-02/threads.html#00160

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]