diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-23 00:27:28 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-24 14:46:14 +0200 |
commit | 2753b921ca2d486e023de8f8d10b606e25ad1387 (patch) | |
tree | 9f030fde5ab2b53044346f67ed79dd9d201d3cd2 /libdiskfs | |
parent | c6c9d7a69dea26e04bba7010582e7bcd612e710c (diff) |
[__USE_EXTERN_INLINES]: Use glibc's __extern_inline machinery.
* libdiskfs/diskfs.h: Apply inline optimization only #ifdef
__USE_EXTERN_INLINES. Use __extern_inline instead of extern inline.
* libftpconn/ftpconn.h: Likewise.
* libpipe/pipe.h: Likewise.
* libpipe/pq.h: Likewise.
* libshouldbeinlibc/idvec.h: Likewise.
* libshouldbeinlibc/maptime.h: Likewise.
* libshouldbeinlibc/ugids.h: Likewise.
* libstore/store.h: Likewise.
* libthreads/rwlock.h: Likewise.
* libdiskfs/extern-inline.c: Adapt to these changes.
* libftpconn/xinl.c: Likewise. And don't #include "priv.h".
* libpipe/pipe-funcs.c: Likewise.
* libpipe/pq-funcs.c: Likewise.
* libshouldbeinlibc/idvec-funcs.c: Likewise.
* libshouldbeinlibc/maptime-funcs.c: Likewise. And remove superfluous
includes.
* libshouldbeinlibc/ugids-xinl.c: Likewise.
* libstore/xinl.c: Likewise.
* libthreads/rwlock.c: Likewise.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/diskfs.h | 41 | ||||
-rw-r--r-- | libdiskfs/extern-inline.c | 7 |
2 files changed, 30 insertions, 18 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 9a61964c..bb139fc2 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -28,10 +28,6 @@ #include <hurd/iohelp.h> #include <idvec.h> -#ifndef DISKFS_EXTERN_INLINE -#define DISKFS_EXTERN_INLINE extern inline -#endif - /* Each user port referring to a file points to one of these (with the aid of the ports library). */ struct protid @@ -784,21 +780,12 @@ void diskfs_finish_protid (struct protid *cred, struct iouser *user); /* Called by MiG to translate ports into struct protid *. fsmutations.h arranges for this to happen for the io and fs interfaces. */ -DISKFS_EXTERN_INLINE struct protid * -diskfs_begin_using_protid_port (file_t port) -{ - return ports_lookup_port (diskfs_port_bucket, port, diskfs_protid_class); -} +struct protid *diskfs_begin_using_protid_port (file_t port); /* Called by MiG after server routines have been run; this balances begin_using_protid_port, and is arranged for the io and fs interfaces by fsmutations.h. */ -DISKFS_EXTERN_INLINE void -diskfs_end_using_protid_port (struct protid *cred) -{ - if (cred) - ports_port_deref (cred); -} +void diskfs_end_using_protid_port (struct protid *cred); /* Called when a protid CRED has no more references. (Because references\ to protids are maintained by the port management library, this is @@ -978,5 +965,29 @@ struct store *diskfs_init_main (struct argp *startup_argp, /* Make errors go somewhere reasonable. */ void diskfs_console_stdio (); + +/* Inlining optimizations. */ + +#include <features.h> + +#ifdef __USE_EXTERN_INLINES +# ifndef DISKFS_H_EXTERN_INLINE +# define DISKFS_H_EXTERN_INLINE __extern_inline +# endif + +DISKFS_H_EXTERN_INLINE struct protid * +diskfs_begin_using_protid_port (file_t port) +{ + return ports_lookup_port (diskfs_port_bucket, port, diskfs_protid_class); +} + +DISKFS_H_EXTERN_INLINE void +diskfs_end_using_protid_port (struct protid *cred) +{ + if (cred) + ports_port_deref (cred); +} + +#endif /* __USE_EXTERN_INLINES */ #endif /* hurd/diskfs.h */ diff --git a/libdiskfs/extern-inline.c b/libdiskfs/extern-inline.c index 0abcc4cc..efcb7b6c 100644 --- a/libdiskfs/extern-inline.c +++ b/libdiskfs/extern-inline.c @@ -1,5 +1,6 @@ /* Run time callable functions for extern inlines. - Copyright (C) 2001 Free Software Foundation, Inc. + + Copyright (C) 2001, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -15,6 +16,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define DISKFS_EXTERN_INLINE - +#define __USE_EXTERN_INLINES +#define DISKFS_H_EXTERN_INLINE #include "diskfs.h" |