From owner-svn-src-all@FreeBSD.ORG Thu Jun 16 15:55:24 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3AE106564A; Thu, 16 Jun 2011 15:55:24 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.freebsd.org (Postfix) with ESMTP id AB3218FC17; Thu, 16 Jun 2011 15:55:24 +0000 (UTC) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id A96D02EC686B; Thu, 16 Jun 2011 23:55:23 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mmlab.cse.yzu.edu.tw; s=test; t=1308239723; bh=FO+8xoIU1RsOhIHFOTfrVATig110AQV5YtevZ5IzuGo=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=OJUfLhmhIpKSxmrYAOeE1ZYC4/XrAZ3pYmLriVgcHNDrSKfQhqEf23ZuQ3RYgSAu/ P5ZjRrpmCIVTXlWXHDzHE5C1nx8dzlTY8De4Zv7ayo51ADKGVfOkGQmaihEJ8i3meD OofAn5guFgbRoaaUNK/ihdGuJdqOpvA73YYXAZxs= Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id A754B2EC6866; Thu, 16 Jun 2011 23:55:23 +0800 (CST) Date: Thu, 16 Jun 2011 23:55:23 +0800 (CST) From: Tai-hwa Liang To: Bruce Evans In-Reply-To: <20110617000654.W1926@besplex.bde.org> Message-ID: <1106162352252.45438@www.mmlab.cse.yzu.edu.tw> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at> <20110616175314.R935@besplex.bde.org> <1106161923211.44181@www.mmlab.cse.yzu.edu.tw> <20110617000654.W1926@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , src-committers@FreeBSD.org Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:55:25 -0000 On Fri, 17 Jun 2011, Bruce Evans wrote: > On Thu, 16 Jun 2011, Tai-hwa Liang wrote: >> On Thu, 16 Jun 2011, Bruce Evans wrote: >>> It might be a style bug (like typedefing a struct) to use enums for >>> anything. They are impossible to declare opaquely. >> >> Does that mean we have to #include in userland >> makefs/ffs/ffs_bswap.c? > > It means that you should implement headers properly, so that they don't > depend on other headers to begin with or grow dependencies on other > headers. Though the should-be-kernel-only header has some > parts including `enum vtype' that have already escaped to userland, other > headers shouldn't grow dependencies on these. How about wrapping offended sections with #ifdef _KERNEL? Should be less intrusive IMHO: Index: ffs_extern.h =================================================================== --- ffs_extern.h (revision 223146) +++ ffs_extern.h (working copy) @@ -33,7 +33,6 @@ #ifndef _UFS_FFS_EXTERN_H #define _UFS_FFS_EXTERN_H -enum vtype; struct buf; struct cg; struct fid; @@ -57,8 +56,10 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_startoffset, int a_size, struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); +#ifdef _KERNEL void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); +#endif /* _KERNEL */ ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -82,8 +83,10 @@ ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); +#ifdef _KERNEL int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); +#endif /* _KERNEL */ void ffs_snapremove(struct vnode *vp); int ffs_snapshot(struct mount *mp, char *snapfile); void ffs_snapshot_mount(struct mount *mp);