diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-03-25 22:13:55 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-03-25 22:33:49 +0200 |
commit | 69056411a354300a17d1e92027435c988508655d (patch) | |
tree | 0d3741400b400cef79c7bf52625adc8966f2207f /ext2fs | |
parent | f605070d37c741436b5f82745eae2a5c018e304d (diff) |
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 <features.h>, 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 <features.h>, 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".
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/Makefile | 2 | ||||
-rw-r--r-- | ext2fs/ext2fs.h | 26 | ||||
-rw-r--r-- | ext2fs/xinl.c | 2 |
3 files changed, 27 insertions, 3 deletions
diff --git a/ext2fs/Makefile b/ext2fs/Makefile index e0419d46..e83aab26 100644 --- a/ext2fs/Makefile +++ b/ext2fs/Makefile @@ -21,7 +21,7 @@ makemode := server target = ext2fs SRCS = balloc.c dir.c ext2fs.c getblk.c hyper.c ialloc.c \ - inode.c pager.c pokel.c truncate.c storeinfo.c msg.c + inode.c pager.c pokel.c truncate.c storeinfo.c msg.c xinl.c OBJS = $(SRCS:.c=.o) LCLHDRS = ext2fs.h ext2_fs.h ext2_fs_i.h bitmap.c HURDLIBS = diskfs pager iohelp fshelp store threads ports ihash shouldbeinlibc diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index 1d490861..2ad4a9df 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -101,8 +101,11 @@ void pokel_flush (struct pokel *pokel); /* Transfer all regions from FROM to POKEL, which must have the same pager. */ void pokel_inherit (struct pokel *pokel, struct pokel *from); -#ifndef EXT2FS_EI -#define EXT2FS_EI extern inline +#include <features.h> +#ifdef EXT2FS_DEFINE_EI +#define EXT2FS_EI +#else +#define EXT2FS_EI __extern_inline #endif /* ---------------------------------------------------------------- */ @@ -110,6 +113,11 @@ void pokel_inherit (struct pokel *pokel, struct pokel *from); #include <stdint.h> +extern int test_bit (unsigned num, char *bitmap); + +extern int set_bit (unsigned num, char *bitmap); + +#if defined(__USE_EXTERN_INLINES) || defined(EXT2FS_DEFINE_EI) /* Returns TRUE if bit NUM is set in BITMAP. */ EXT2FS_EI int test_bit (unsigned num, char *bitmap) @@ -138,6 +146,7 @@ clear_bit (unsigned num, char *bitmap) const uint_fast32_t mask = 1 << (num & 31); return (*bw & mask) ? (*bw &= ~mask, mask) : 0; } +#endif /* Use extern inlines. */ /* ---------------------------------------------------------------- */ @@ -294,6 +303,9 @@ struct ext2_group_desc *group_desc_image; #define inode_group_num(inum) (((inum) - 1) / sblock->s_inodes_per_group) +extern struct ext2_inode *dino (ino_t inum); + +#if defined(__USE_EXTERN_INLINES) || defined(EXT2FS_DEFINE_EI) /* Convert an inode number to the dinode on disk. */ EXT2FS_EI struct ext2_inode * dino (ino_t inum) @@ -305,6 +317,7 @@ dino (ino_t inum) block_t block = bg->bg_inode_table + (group_inum / inodes_per_block); return ((struct ext2_inode *)bptr(block)) + group_inum % inodes_per_block; } +#endif /* Use extern inlines. */ /* ---------------------------------------------------------------- */ /* inode.c */ @@ -333,6 +346,14 @@ struct pokel global_pokel; char *modified_global_blocks; spin_lock_t modified_global_blocks_lock; +extern int global_block_modified (block_t block); +extern void record_global_poke (void *ptr); +extern void sync_global_ptr (void *bptr, int wait); +extern void record_indir_poke (struct node *node, void *ptr); +extern void sync_global (int wait); +extern void alloc_sync (struct node *np); + +#if defined(__USE_EXTERN_INLINES) || defined(EXT2FS_DEFINE_EI) /* Marks the global block BLOCK as being modified, and returns true if we think it may have been clean before (but we may not be sure). Note that this isn't enough to cause the block to be synced; you must call @@ -401,6 +422,7 @@ alloc_sync (struct node *np) diskfs_set_hypermetadata (1, 0); } } +#endif /* Use extern inlines. */ /* ---------------------------------------------------------------- */ /* getblk.c */ diff --git a/ext2fs/xinl.c b/ext2fs/xinl.c new file mode 100644 index 00000000..9f37e166 --- /dev/null +++ b/ext2fs/xinl.c @@ -0,0 +1,2 @@ +#define EXT2FS_DEFINE_EI +#include "ext2fs.h" |