Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2016 18:14:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305903 - in head: lib/libprocstat sys/ufs/ufs
Message-ID:  <201609171814.u8HIEVG6095612@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Sep 17 18:14:31 2016
New Revision: 305903
URL: https://svnweb.freebsd.org/changeset/base/305903

Log:
  Fix libprocstat build after r305902.
  - Use _Bool to not require userspace to include stdbool.h.
  - Make extattr.h usable without vnode_if.h.
  - Follow i_ump to get cdev pointer.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/lib/libprocstat/common_kvm.c
  head/sys/ufs/ufs/extattr.h
  head/sys/ufs/ufs/inode.h

Modified: head/lib/libprocstat/common_kvm.c
==============================================================================
--- head/lib/libprocstat/common_kvm.c	Sat Sep 17 16:47:34 2016	(r305902)
+++ head/lib/libprocstat/common_kvm.c	Sat Sep 17 18:14:31 2016	(r305903)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/mount.h>
 #include <ufs/ufs/quota.h>
 #include <ufs/ufs/inode.h>
+#include <ufs/ufs/extattr.h>
+#include <ufs/ufs/ufsmount.h>
 #include <fs/devfs/devfs.h>
 #include <fs/devfs/devfs_int.h>
 #undef _KERNEL
@@ -88,17 +90,22 @@ int
 ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
 {
 	struct inode inode;
+	struct ufsmount um;
 
 	if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) {
 		warnx("can't read inode at %p", (void *)VTOI(vp));
 		return (1);
 	}
+	if (!kvm_read_all(kd, (unsigned long)inode.i_ump, &um, sizeof(um))) {
+		warnx("can't read ufsmount at %p", (void *)inode.i_ump);
+		return (1);
+	}
 	/*
 	 * The st_dev from stat(2) is a dev_t. These kernel structures
 	 * contain cdev pointers. We need to convert to dev_t to make
 	 * comparisons
 	 */
-	vn->vn_fsid = dev2udev(kd, inode.i_dev);
+	vn->vn_fsid = dev2udev(kd, um.um_dev);
 	vn->vn_fileid = inode.i_number;
 	vn->vn_mode = (mode_t)inode.i_mode;
 	vn->vn_size = inode.i_size;

Modified: head/sys/ufs/ufs/extattr.h
==============================================================================
--- head/sys/ufs/ufs/extattr.h	Sat Sep 17 16:47:34 2016	(r305902)
+++ head/sys/ufs/ufs/extattr.h	Sat Sep 17 18:14:31 2016	(r305903)
@@ -133,6 +133,10 @@ struct ufs_extattr_per_mount {
 	int	uepm_flags;
 };
 
+struct vop_getextattr_args;
+struct vop_deleteextattr_args;
+struct vop_setextattr_args;
+
 void	ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm);
 void	ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm);
 int	ufs_extattr_start(struct mount *mp, struct thread *td);

Modified: head/sys/ufs/ufs/inode.h
==============================================================================
--- head/sys/ufs/ufs/inode.h	Sat Sep 17 16:47:34 2016	(r305902)
+++ head/sys/ufs/ufs/inode.h	Sat Sep 17 18:14:31 2016	(r305903)
@@ -145,14 +145,14 @@ struct inode {
 #define	ITOFS(ip)	(ITOUMP(ip)->um_fs)
 #define	ITOVFS(ip)	((ip)->i_vnode->v_mount)
 
-static inline bool
+static inline _Bool
 I_IS_UFS1(const struct inode *ip)
 {
 
 	return ((ip->i_flag & IN_UFS2) == 0);
 }
 
-static inline bool
+static inline _Bool
 I_IS_UFS2(const struct inode *ip)
 {
 



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