svn commit: r223169 - in head: sys/ufs/ffs usr.sbin/makefs/ffs

Kirk McKusick mckusick at FreeBSD.org
Thu Jun 16 23:40:11 UTC 2011


Author: mckusick
Date: Thu Jun 16 23:40:10 2011
New Revision: 223169
URL: http://svn.freebsd.org/changeset/base/223169

Log:
  Drop the include of <ufs/ffs/ffs_extern.h> from usr.sbin/makefs/ffs/ffs_bswap.c
  and usr.sbin/makefs/ffs/ffs_subr.c as they have no need of anything in that
  file.  No other programs or libraries include <ufs/ffs/ffs_extern.h> (nor
  should they as it is totally in-kernel interfaces). For added protection
  I enclosed the entire contents of <ufs/ffs/ffs_extern.h> in ifdef _KERNEL.
  
  Feedback from:	Bruce Evans and Tai-hwa Liang

Modified:
  head/sys/ufs/ffs/ffs_extern.h
  head/usr.sbin/makefs/ffs/ffs_bswap.c
  head/usr.sbin/makefs/ffs/ffs_subr.c

Modified: head/sys/ufs/ffs/ffs_extern.h
==============================================================================
--- head/sys/ufs/ffs/ffs_extern.h	Thu Jun 16 23:36:01 2011	(r223168)
+++ head/sys/ufs/ffs/ffs_extern.h	Thu Jun 16 23:40:10 2011	(r223169)
@@ -33,7 +33,10 @@
 #ifndef _UFS_FFS_EXTERN_H
 #define	_UFS_FFS_EXTERN_H
 
-enum vtype;
+#ifndef _KERNEL
+#error "No user-serving parts inside"
+#else
+
 struct buf;
 struct cg;
 struct fid;
@@ -168,7 +171,6 @@ void	softdep_freework(struct workhead *)
 
 int	ffs_rdonly(struct inode *);
 
-#ifdef _KERNEL
 TAILQ_HEAD(snaphead, inode);
 
 struct snapdata {
@@ -178,6 +180,7 @@ struct snapdata {
 	daddr_t *sn_blklist;
 	struct lock sn_lock;
 };
+
 #endif /* _KERNEL */
 
 #endif /* !_UFS_FFS_EXTERN_H */

Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu Jun 16 23:36:01 2011	(r223168)
+++ head/usr.sbin/makefs/ffs/ffs_bswap.c	Thu Jun 16 23:40:10 2011	(r223169)
@@ -41,14 +41,6 @@ __FBSDID("$FreeBSD$");
 #include <ufs/ufs/dinode.h>
 #include "ffs/ufs_bswap.h"
 #include <ufs/ffs/fs.h>
-/* XXX temporary */
-struct ufsmount;
-struct bufobj;
-struct mount;
-struct vnode;
-typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags,
-                    struct vnode **vpp);
-#include <ufs/ffs/ffs_extern.h>
 
 #if !defined(_KERNEL)
 #include <stddef.h>

Modified: head/usr.sbin/makefs/ffs/ffs_subr.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_subr.c	Thu Jun 16 23:36:01 2011	(r223168)
+++ head/usr.sbin/makefs/ffs/ffs_subr.c	Thu Jun 16 23:40:10 2011	(r223169)
@@ -38,15 +38,8 @@ __FBSDID("$FreeBSD$");
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
-/* XXX temporary */
-struct ufsmount;
-struct bufobj;
-struct mount;
-struct vnode;
-typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags,
-                    struct vnode **vpp);
-#include <ufs/ffs/ffs_extern.h>
 #include "ffs/ufs_bswap.h"
+
 void    panic __P((const char *, ...))
     __attribute__((__noreturn__,__format__(__printf__,1,2)));
 


More information about the svn-src-head mailing list