coreutils
[Top][All Lists]
Advanced

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

[PATCH] stat,tail: sync with latest Linux file systems


From: Pádraig Brady
Subject: [PATCH] stat,tail: sync with latest Linux file systems
Date: Tue, 28 May 2024 13:40:26 +0100

* src/stat.c (human_fstype): Rename "FUSEBLK" to "FUSE" to sync with
kernel adjustments.  Add "bcachefs", and "pidfs".  Both are local,
with the latter being similar to "proc" which is also local.
* NEWS: Mention the change in behavior, and the improvement.
---
 NEWS       | 7 +++++++
 src/stat.c | 8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index febb9ac68..6251a2f68 100644
--- a/NEWS
+++ b/NEWS
@@ -26,11 +26,18 @@ GNU coreutils NEWS                                    -*- 
outline -*-
   equivalent because -f no longer ignores an earlier -l.  The new
   behavior is more orthogonal and is compatible with FreeBSD.
 
+  stat -f -c%T now reports the "fuseblk" file system type as "fuse",
+  given that there is no longer a distinct "ctl" fuse variant file system.
+
 ** Improvements
 
   sort operates more efficiently when used on pseudo files with
   an apparent size of 0, like those in /proc.
 
+  stat and tail now know about the "bcachefs", and "pidfs" file system types.
+  stat -f -c%T now reports the file system type,
+  and tail -f uses inotify for these file systems.
+
   wc now reads a minimum of 256KiB at a time.
   This was previously 16KiB and increasing to 256KiB was seen to increase
   wc -l performance by about 10% when reading cached files on modern systems.
diff --git a/src/stat.c b/src/stat.c
index 91795471f..e73abf07a 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -301,6 +301,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "autofs";
     case S_MAGIC_BALLOON_KVM: /* 0x13661366 local */
       return "balloon-kvm-fs";
+    case S_MAGIC_BCACHEFS: /* 0xCA451A4E local */
+      return "bcachefs";
     case S_MAGIC_BEFS: /* 0x42465331 local */
       return "befs";
     case S_MAGIC_BDEVFS: /* 0x62646576 local */
@@ -373,8 +375,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "fat";
     case S_MAGIC_FHGFS: /* 0x19830326 remote */
       return "fhgfs";
-    case S_MAGIC_FUSEBLK: /* 0x65735546 remote */
-      return "fuseblk";
+    case S_MAGIC_FUSE: /* 0x65735546 remote */
+      return "fuse";
     case S_MAGIC_FUSECTL: /* 0x65735543 remote */
       return "fusectl";
     case S_MAGIC_FUTEXFS: /* 0x0BAD1DEA local */
@@ -458,6 +460,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "overlayfs";
     case S_MAGIC_PANFS: /* 0xAAD7AAEA remote */
       return "panfs";
+    case S_MAGIC_PID_FS: /* 0x50494446 local */
+      return "pidfs";
     case S_MAGIC_PIPEFS: /* 0x50495045 remote */
       /* FIXME: change syntax or add an optional attribute like "inotify:no".
          pipefs and prlfs are labeled as "remote" so that tail always polls,
-- 
2.44.0




reply via email to

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