diff options
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" |