Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2017 01:39:05 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311151 - in head: . lib/libsysdecode usr.bin/kdump
Message-ID:  <201701030139.v031d5t0009343@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Jan  3 01:39:05 2017
New Revision: 311151
URL: https://svnweb.freebsd.org/changeset/base/311151

Log:
  Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.
  
  As a followup to r310638, update libsysdecode (and kdump) to decode the
  'mode' argument to getfsstat().  sysdecode_getfsstat_flags() has been
  renamed to sysdecode_getfsstat_mode() and now treats the argument as an
  enumerated value rather than a mask of flags.

Modified:
  head/ObsoleteFiles.inc
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/flags.c
  head/lib/libsysdecode/mktables
  head/lib/libsysdecode/sysdecode.h
  head/lib/libsysdecode/sysdecode_enum.3
  head/lib/libsysdecode/sysdecode_mask.3
  head/usr.bin/kdump/kdump.c

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/ObsoleteFiles.inc	Tue Jan  3 01:39:05 2017	(r311151)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170102: sysdecode_getfsstat_flags() renamed to sysdecode_getfsstat_mode()
+OLD_FILES+=usr/share/man/man3/sysdecode_getfsstat_flags.3.gz
 # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu
 OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu
 # 20161229: Three files from gnop tests consolidated into one

Modified: head/lib/libsysdecode/Makefile
==============================================================================
--- head/lib/libsysdecode/Makefile	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/Makefile	Tue Jan  3 01:39:05 2017	(r311151)
@@ -30,6 +30,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_aclty
 	sysdecode_enum.3 sysdecode_extattrnamespace.3 \
 	sysdecode_enum.3 sysdecode_fadvice.3 \
 	sysdecode_enum.3 sysdecode_fcntl_cmd.3 \
+	sysdecode_enum.3 sysdecode_getfsstat_mode.3 \
 	sysdecode_enum.3 sysdecode_idtype.3 \
 	sysdecode_enum.3 sysdecode_ipproto.3 \
 	sysdecode_enum.3 sysdecode_kldsym_cmd.3 \
@@ -70,7 +71,6 @@ MLINKS+=sysdecode_mask.3 sysdecode_acces
 	sysdecode_mask.3 sysdecode_fileflags.3 \
 	sysdecode_mask.3 sysdecode_filemode.3 \
 	sysdecode_mask.3 sysdecode_flock_operation.3 \
-	sysdecode_mask.3 sysdecode_getfsstat_flags.3 \
 	sysdecode_mask.3 sysdecode_mlockall_flags.3 \
 	sysdecode_mask.3 sysdecode_mmap_flags.3 \
 	sysdecode_mask.3 sysdecode_mmap_prot.3 \

Modified: head/lib/libsysdecode/flags.c
==============================================================================
--- head/lib/libsysdecode/flags.c	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/flags.c	Tue Jan  3 01:39:05 2017	(r311151)
@@ -472,11 +472,15 @@ sysdecode_flock_operation(FILE *fp, int 
 	return (print_mask_int(fp, flockops, operation, rem));
 }
 
-bool
-sysdecode_getfsstat_flags(FILE *fp, int flags, int *rem)
+static struct name_table getfsstatmode[] = {
+	X(MNT_WAIT) X(MNT_NOWAIT) XEND
+};
+
+const char *
+sysdecode_getfsstat_mode(int mode)
 {
 
-	return (print_mask_int(fp, getfsstatflags, flags, rem));
+	return (lookup_value(getfsstatmode, mode));
 }
 
 const char *

Modified: head/lib/libsysdecode/mktables
==============================================================================
--- head/lib/libsysdecode/mktables	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/mktables	Tue Jan  3 01:39:05 2017	(r311151)
@@ -94,7 +94,6 @@ gen_table "extattrns"       "EXTATTR_NAM
 gen_table "fadvisebehav"    "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+"          "sys/fcntl.h"
 gen_table "openflags"       "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+"           "sys/fcntl.h"	"O_RDONLY|O_RDWR|O_WRONLY"
 gen_table "flockops"        "LOCK_[A-Z]+[[:space:]]+0x[0-9]+"              "sys/fcntl.h"
-gen_table "getfsstatflags"  "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*"            "sys/mount.h"
 gen_table "kldsymcmd"       "KLDSYM_[A-Z]+[[:space:]]+[0-9]+"              "sys/linker.h"
 gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+"       "sys/linker.h"
 gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+"              "aio.h"

Modified: head/lib/libsysdecode/sysdecode.h
==============================================================================
--- head/lib/libsysdecode/sysdecode.h	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/sysdecode.h	Tue Jan  3 01:39:05 2017	(r311151)
@@ -54,7 +54,7 @@ bool	sysdecode_fileflags(FILE *_fp, ffla
 bool	sysdecode_filemode(FILE *_fp, int _mode, int *_rem);
 bool	sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem);
 int	sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error);
-bool	sysdecode_getfsstat_flags(FILE *_fp, int _flags, int *_rem);
+const char *sysdecode_getfsstat_mode(int _mode);
 const char *sysdecode_idtype(int _idtype);
 const char *sysdecode_ioctlname(unsigned long _val);
 const char *sysdecode_ipproto(int _protocol);

Modified: head/lib/libsysdecode/sysdecode_enum.3
==============================================================================
--- head/lib/libsysdecode/sysdecode_enum.3	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/sysdecode_enum.3	Tue Jan  3 01:39:05 2017	(r311151)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd January 2, 2017
 .Dt sysdecode_enum 3
 .Os
 .Sh NAME
@@ -35,6 +35,7 @@
 .Nm sysdecode_extattrnamespace ,
 .Nm sysdecode_fadvice ,
 .Nm sysdecode_fcntl_cmd ,
+.Nm sysdecode_getfsstat_mode ,
 .Nm sysdecode_idtype ,
 .Nm sysdecode_ipproto ,
 .Nm sysdecode_kldsym_cmd ,
@@ -86,6 +87,8 @@
 .Ft const char *
 .Fn sysdecode_fcntl_cmd "int cmd"
 .Ft const char *
+.Fn sysdecode_getfsstat_mode "int mode"
+.Ft const char *
 .Fn sysdecode_idtype "int idtype"
 .Ft const char *
 .Fn sysdecode_ipproto "int protocol"
@@ -168,6 +171,7 @@ Most of these functions decode an argume
 .It Fn sysdecode_extattrnamespace Ta Xr extattr_get_fd 2 Ta Fa attrnamespace
 .It Fn sysdecode_fadvice Ta Xr posix_fadvise 2 Ta Fa advice
 .It Fn sysdecode_fcntl_cmd Ta Xr fcntl 2 Ta Fa cmd
+.It Fn sysdecode_getfsstat_mode Ta Xr getfsstat 2 Ta Fa mode
 .It Fn sysdecode_idtype Ta
 .Xr procctl 2 ,
 .Xr waitid 2

Modified: head/lib/libsysdecode/sysdecode_mask.3
==============================================================================
--- head/lib/libsysdecode/sysdecode_mask.3	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/lib/libsysdecode/sysdecode_mask.3	Tue Jan  3 01:39:05 2017	(r311151)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd January 2, 2017
 .Dt sysdecode_mask 3
 .Os
 .Sh NAME
@@ -36,7 +36,6 @@
 .Nm sysdecode_fileflags ,
 .Nm sysdecode_filemode ,
 .Nm sysdecode_flock_operation ,
-.Nm sysdecode_getfsstat_flags ,
 .Nm sysdecode_mlockall_flags ,
 .Nm sysdecode_mmap_flags ,
 .Nm sysdecode_mmap_prot ,
@@ -153,7 +152,6 @@ Most of these functions decode an argume
 .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags
 .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode
 .It Fn sysdecode_flock_operation Ta Xr flock 2 Ta Fa operation
-.It Fn sysdecode_getfsstat_flags Ta Xr getfsstatflags 2 Ta Fa flags
 .It Fn sysdecode_mlockall_flags Ta Xr mlockall 2 Ta Fa flags
 .It Fn sysdecode_mmap_flags Ta Xr mmap 2 Ta Fa flags
 .It Fn sysdecode_mmap_prot Ta Xr mmap 2 Ta Fa prot

Modified: head/usr.bin/kdump/kdump.c
==============================================================================
--- head/usr.bin/kdump/kdump.c	Tue Jan  3 00:26:10 2017	(r311150)
+++ head/usr.bin/kdump/kdump.c	Tue Jan  3 01:39:05 2017	(r311151)
@@ -943,7 +943,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
 				print_number(ip, narg, c);
 				print_number(ip, narg, c);
 				putchar(',');
-				print_mask_arg(sysdecode_getfsstat_flags, *ip);
+				print_integer_arg(sysdecode_getfsstat_mode, *ip);
 				ip++;
 				narg--;
 				break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701030139.v031d5t0009343>