Date: Thu, 19 Dec 2019 16:39:52 +0000 (UTC) From: Doug Moore <dougm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355913 - head/sys/fs/tmpfs Message-ID: <201912191639.xBJGdqkQ075457@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dougm Date: Thu Dec 19 16:39:52 2019 New Revision: 355913 URL: https://svnweb.freebsd.org/changeset/base/355913 Log: Including <sys/tmpfs.h> into non-kernel software leads to a compilation error because, without _KERNEL defined, the macro TMPFS_VALIDATE_DIR is invoked, but never defined. User-level software that includes sys/tmpfs.h must define _KERNEL to make the definition of TMPFS_VALIDATE_DIR visible. This change puts all the inline functions that, directly or indirectly, invoke MPASS into the scope of the _KERNEL block, allowing many user-space includers of <sys/tmpfs.h> to stop defining _KERNEL. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22874 Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Dec 19 15:36:00 2019 (r355912) +++ head/sys/fs/tmpfs/tmpfs.h Thu Dec 19 16:39:52 2019 (r355913) @@ -493,8 +493,6 @@ size_t tmpfs_pages_used(struct tmpfs_mount *tmp); void tmpfs_subr_init(void); void tmpfs_subr_uninit(void); -#endif - /* * Macros/functions to convert from generic data structures to tmpfs * specific ones. @@ -536,5 +534,6 @@ tmpfs_use_nc(struct vnode *vp) return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc)); } +#endif /* _KERNEL */ #endif /* _FS_TMPFS_TMPFS_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912191639.xBJGdqkQ075457>