From 69056411a354300a17d1e92027435c988508655d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 25 Mar 2012 22:13:55 +0200 Subject: Fix extern inline use * ext2fs/Makefile (SRCS): Add xinl.c * libtreefs/Makefile (OTHERSRCS): Likewise. * term/Makefile (SRCS): Likewise. * ufs/Makefile (SRCS): Likewise. * hostmux/hostmux-xinl.c: Define HOSTMUX_DEFINE_EI instead of HOSTMUX_EI. * libdiskfs/extern-inline.c: Define DISKFS_DEFINE_EXTERN_INLINE instead of DISKFS_EXTERN_INLINE. * libftpconn/xinl.c: Define FTP_CONN_DEFINE_EI instead of FTP_CONN_EI. * libpipe/pipe-funcs.c: Define PIPE_DEFINE_EI instead of PIPE_EI. * libpipe/pq-funcs.c: Define PQ_DEFINE_EI instead of PQ_EI. * libshouldbeinlibc/idvec-funcs.c: Define IDVEC_DEFINE_EI instead of IDVEC_EI. * libshouldbeinlibc/maptime-funcs.c: Define MAPTIME_DEFINE_EI instead of MAPTIME_EI. * libshouldbeinlibc/ugids-xinl.c: Define UGIDS_DEFINE_EI instead of UGIDS_EI. * libstore/xinl.c: Define STORE_DEFINE_EI instead of STORE_EI. * libthreads/rwlock.c: Define RWLOCK_DEFINE_EI instead of RWLOCK_EI. * ext2fs/xinl.c: New file, define EXT2FS_DEFINE_EI and include "ext2fs.h" * libtreefs/xinl.c: New file, define TREEFS_DEFINE_EI and include "treefs.h" and "mig-decls.h". * term/xinl.c: New file, define TERM_DEFINE_EI and include "term.h". * ufs/xinl.c: New file, define UFS_DEFINE_EI and include "ufs.h" * ext2fs/ext2fs.h: Include , define EXT2FS_EI to __extern_inline instead of "extern inline", define it to empty when EXT2FS_DEFINE_EI is defined. Always declare extern inline prototypes, and define extern inlines content only if __USE_EXTERN_INLINES or EXT2FS_DEFINE_EI is defined. * libdiskfs/diskfs.h: Likewise with DISKFS_EXTERN_INLINE and DISKFS_DEFINE_EXTERN_INLINE. * libftpconn/ftpconn.h: Likewise with FTP_CONN_EI and FTP_CONN_DEFINE_EI. * libftpconn/priv.h: Likewise. * libpipe/pipe.h: Likewise with PIPE_EI and PIPE_DEFINE_EI. * libpipe/pq.h: Likewise with PQ_EI and PQ_DEFINE_EI. * libshouldbeinlibc/idvec.h: Likewise with IDVEC_EI and IDVEC_DEFINE_EI. * libshouldbeinlibc/maptime.h: Likewise with MAPTIME_EI and MAPTIME_DEFINE_EI. * libshouldbeinlibc/ugids.h: Likewise with UGIDS_EI and UGIDS_DEFINE_EI. * libstore/store.h: Likewise with STORE_EI and STORE_DEFINE_EI. * libthreads/rwlock.h: Likewise with RWLOCK_EI and RWLOCK_DEFINE_EI. * term/term.h: Likewise with TERM_EI and TERM_DEFINE_EI. * ufs/ufs.h: Likewise with UFS_EI and UFS_DEFINE_EI. * libtreefs/treefs.h: Include , define TREE_FS_EI to __extern_inline, or to empty when TREEFS_DEFINE_EI is defined. Use TREEFS_EI instead of "extern inline". * libtreefs/mig-decls.h: Use TREEFS_EI instead of "extern inline". --- libstore/store.h | 14 +++++++++++--- libstore/xinl.c | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'libstore') diff --git a/libstore/store.h b/libstore/store.h index fd250448..ae334a1d 100644 --- a/libstore/store.h +++ b/libstore/store.h @@ -33,11 +33,13 @@ #include #include #include +#include -#ifndef STORE_EI -#define STORE_EI extern inline +#ifdef STORE_DEFINE_EI +#define STORE_EI +#else +#define STORE_EI __extern_inline #endif - /* Type for addresses inside the store. */ typedef off64_t store_offset_t; @@ -270,6 +272,10 @@ error_t store_set_child_flags (struct store *store, int flags); STORE's flags. */ error_t store_clear_child_flags (struct store *store, int flags); +extern int store_is_securely_returnable (struct store *store, int open_flags); + +#if defined(__USE_EXTERN_INLINES) || defined(STORE_DEFINE_EI) + /* Returns true if STORE can safely be returned to a user who has accessed it via a node using OPEN_FLAGS, without compromising security. */ STORE_EI int @@ -283,6 +289,8 @@ store_is_securely_returnable (struct store *store, int open_flags) || (flags & STORE_HARD_READONLY))); } +#endif /* Use extern inlines. */ + /* Fills in the values of the various fields in STORE that are derivable from the set of runs & the block size. */ void _store_derive (struct store *store); diff --git a/libstore/xinl.c b/libstore/xinl.c index a603d621..90242212 100644 --- a/libstore/xinl.c +++ b/libstore/xinl.c @@ -1,2 +1,2 @@ -#define STORE_EI +#define STORE_DEFINE_EI #include "store.h" -- cgit v1.2.3