From ff13f23f848d45f203a360b8cbb3f6275c1bd242 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Thu, 16 Jun 2011 23:40:10 +0000 Subject: [PATCH] Drop the include of 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 (nor should they as it is totally in-kernel interfaces). For added protection I enclosed the entire contents of in ifdef _KERNEL. Feedback from: Bruce Evans and Tai-hwa Liang --- sys/ufs/ffs/ffs_extern.h | 7 +++++-- usr.sbin/makefs/ffs/ffs_bswap.c | 8 -------- usr.sbin/makefs/ffs/ffs_subr.c | 9 +-------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index fb1b1fb2bc67..1fd01444cdee 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -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 */ diff --git a/usr.sbin/makefs/ffs/ffs_bswap.c b/usr.sbin/makefs/ffs/ffs_bswap.c index 18ace03123fc..a1a1c46c5360 100644 --- a/usr.sbin/makefs/ffs/ffs_bswap.c +++ b/usr.sbin/makefs/ffs/ffs_bswap.c @@ -41,14 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include "ffs/ufs_bswap.h" #include -/* 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 #if !defined(_KERNEL) #include diff --git a/usr.sbin/makefs/ffs/ffs_subr.c b/usr.sbin/makefs/ffs/ffs_subr.c index 5f9b6f2b7dc9..b857a581b9c8 100644 --- a/usr.sbin/makefs/ffs/ffs_subr.c +++ b/usr.sbin/makefs/ffs/ffs_subr.c @@ -38,15 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* 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 #include "ffs/ufs_bswap.h" + void panic __P((const char *, ...)) __attribute__((__noreturn__,__format__(__printf__,1,2)));