Add flags NOPERM, STALLED, SWAPPABLE, DOOMED to -v output.
authorkrw <krw@openbsd.org>
Wed, 10 Jul 2024 13:29:23 +0000 (13:29 +0000)
committerkrw <krw@openbsd.org>
Wed, 10 Jul 2024 13:29:23 +0000 (13:29 +0000)
Brings -v output into line with MNT_BITS used in vfs_mount_print().

ok deraadt@

usr.sbin/pstat/pstat.c

index 5e24424..84881a3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pstat.c,v 1.129 2022/02/22 17:35:01 deraadt Exp $     */
+/*     $OpenBSD: pstat.c,v 1.130 2024/07/10 13:29:23 krw Exp $ */
 /*     $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $   */
 
 /*-
@@ -739,6 +739,11 @@ mount_print(struct mount *mp)
                        flags &= ~MNT_NODEV;
                        comma = ",";
                }
+               if (flags & MNT_NOPERM) {
+                       (void)printf("%snoperm", comma);
+                       flags &= ~MNT_NOPERM;
+                       comma = ",";
+               }
                if (flags & MNT_ASYNC) {
                        (void)printf("%sasync", comma);
                        flags &= ~MNT_ASYNC;
@@ -810,6 +815,16 @@ mount_print(struct mount *mp)
                        flags &= ~MNT_FORCE;
                        comma = ",";
                }
+               if (flags & MNT_STALLED) {
+                       (void)printf("%sstalled", comma);
+                       flags &= ~MNT_STALLED;
+                       comma = ",";
+               }
+               if (flags & MNT_SWAPPABLE) {
+                       (void)printf("%sswappable", comma);
+                       flags &= ~MNT_SWAPPABLE;
+                       comma = ",";
+               }
                if (flags & MNT_WANTRDWR) {
                        (void)printf("%swantrdwr", comma);
                        flags &= ~MNT_WANTRDWR;
@@ -820,6 +835,11 @@ mount_print(struct mount *mp)
                        flags &= ~MNT_SOFTDEP;
                        comma = ",";
                }
+               if (flags & MNT_DOOMED) {
+                       (void)printf("%sdoomed", comma);
+                       flags &= ~MNT_DOOMED;
+                       comma = ",";
+               }
                if (flags)
                        (void)printf("%sunknown_flags:%x", comma, flags);
                (void)printf(")");