diff options
author | alfred <alfred@FreeBSD.org> | 2002-01-13 21:37:49 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-01-13 21:37:49 +0000 |
commit | 5e2f4cf200203b968666acb6979aaccf7d62bbf5 (patch) | |
tree | 6c0138650247c4667d104eeda26a13d70947bdb2 | |
parent | 2624e483f082b443613da8ffb57521327188691e (diff) | |
download | FreeBSD-src-5e2f4cf200203b968666acb6979aaccf7d62bbf5.zip FreeBSD-src-5e2f4cf200203b968666acb6979aaccf7d62bbf5.tar.gz |
Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.
Requested by: jhb
-rw-r--r-- | sys/contrib/ipfilter/netinet/fil.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_auth.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_fil.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_frag.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_log.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_nat.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_proxy.c | 3 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_state.c | 3 | ||||
-rw-r--r-- | sys/dev/aac/aac.c | 2 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 1 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vnops.c | 1 | ||||
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 1 | ||||
-rw-r--r-- | sys/fs/portalfs/portal_vfsops.c | 1 | ||||
-rw-r--r-- | sys/kern/init_main.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_cache.c | 1 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 1 | ||||
-rw-r--r-- | sys/sys/file.h | 41 | ||||
-rw-r--r-- | sys/sys/filedesc.h | 4 |
18 files changed, 49 insertions, 30 deletions
diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index bd7cd1f..a5abb95 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -7,6 +7,9 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if defined(__NetBSD__) && (NetBSD >= 199905) && !defined(IPFILTER_LKM) && \ defined(_KERNEL) diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 26ed004..0cc29ac 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -7,6 +7,9 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if !defined(_KERNEL) && !defined(KERNEL) # include <stdio.h> diff --git a/sys/contrib/ipfilter/netinet/ip_fil.c b/sys/contrib/ipfilter/netinet/ip_fil.c index 5e5bfce..dbe1834 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.c +++ b/sys/contrib/ipfilter/netinet/ip_fil.c @@ -34,6 +34,9 @@ #endif #include <sys/errno.h> #include <sys/types.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if __FreeBSD_version >= 220000 && defined(_KERNEL) # include <sys/fcntl.h> diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 622d0cc..d0623c5 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -11,6 +11,9 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if !defined(_KERNEL) && !defined(KERNEL) # include <stdio.h> diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index b3f1e56..9d2c9a3 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -47,6 +47,9 @@ # endif # include <sys/errno.h> # include <sys/types.h> +# if (__FreeBSD_version >= 500028) +# include <sys/queue.h> +# endif # include <sys/file.h> # if __FreeBSD_version >= 220000 && defined(_KERNEL) # include <sys/fcntl.h> diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 363ab24..1f0c0f3 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -14,6 +14,9 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if defined(__NetBSD__) && (NetBSD >= 199905) && !defined(IPFILTER_LKM) && \ defined(_KERNEL) diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 1fee6b7..6428516 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -12,6 +12,9 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/time.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if !defined(__FreeBSD_version) # include <sys/ioctl.h> diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 585929f..5584f65 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -7,6 +7,9 @@ #include <sys/errno.h> #include <sys/types.h> #include <sys/param.h> +#if (__FreeBSD_version >= 500028) +#include <sys/queue.h> +#endif #include <sys/file.h> #if defined(__NetBSD__) && (NetBSD >= 199905) && !defined(IPFILTER_LKM) && \ defined(_KERNEL) diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index f456f3f..3a7c063 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -41,6 +41,8 @@ #include <sys/malloc.h> #include <sys/kernel.h> #include <sys/kthread.h> +#include <sys/lock.h> +#include <sys/mutex.h> #include <sys/sysctl.h> #include <sys/poll.h> #if __FreeBSD_version >= 500005 diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 541358f..329eab9 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -47,6 +47,7 @@ #include <sys/filedesc.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/malloc.h> #include <sys/mount.h> #include <sys/proc.h> diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index eb6f0db..3326375 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -49,6 +49,7 @@ #include <sys/filedesc.h> #include <sys/kernel.h> /* boottime */ #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/malloc.h> #include <sys/file.h> /* Must come after sys/malloc.h */ #include <sys/mount.h> diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 3597cbb..9fea7a2 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -39,6 +39,7 @@ #include <sys/unistd.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/malloc.h> #include <sys/vnode.h> #include <sys/proc.h> /* XXXKSE */ diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index bc71fa5..caf9b6d 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -48,6 +48,7 @@ #include <sys/filedesc.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/malloc.h> #include <sys/file.h> /* Must come after sys/malloc.h */ #include <sys/mount.h> diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index e984aec..a36fbcd 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -45,9 +45,9 @@ #include "opt_init_path.h" #include <sys/param.h> +#include <sys/kernel.h> #include <sys/file.h> #include <sys/filedesc.h> -#include <sys/kernel.h> #include <sys/ktr.h> #include <sys/lock.h> #include <sys/mount.h> diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index d0b412d..cccb69d 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -41,6 +41,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/sysctl.h> #include <sys/mount.h> #include <sys/vnode.h> diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 66d27af..689190b 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -45,6 +45,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/lock.h> +#include <sys/mutex.h> #include <sys/namei.h> #include <sys/vnode.h> #include <sys/mount.h> diff --git a/sys/sys/file.h b/sys/sys/file.h index a97482d..d8dbf48 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -44,9 +44,8 @@ #ifdef _KERNEL #include <sys/types.h> -#include <sys/lock.h> -#include <sys/mutex.h> -#include <sys/sx.h> +#include <sys/_lock.h> +#include <sys/_mutex.h> #include <sys/queue.h> struct stat; @@ -122,8 +121,6 @@ extern int maxfilesperproc; /* per process limit on number of open files */ extern int nfiles; /* (fl) actual number of open files */ extern struct sx filelist_lock; /* sx to protect filelist and nfiles */ -static __inline struct file * fhold __P((struct file *fp)); -static __inline struct file * fhold_locked __P((struct file *fp)); int fget __P((struct thread *td, int fd, struct file **fpp)); int fget_read __P((struct thread *td, int fd, struct file **fpp)); int fget_write __P((struct thread *td, int fd, struct file **fpp)); @@ -143,28 +140,18 @@ int fgetvp_write __P((struct thread *td, int fd, struct vnode **vpp)); int fgetsock __P((struct thread *td, int fd, struct socket **spp, u_int *fflagp)); void fputsock __P((struct socket *sp)); -static __inline struct file * -fhold_locked(fp) - struct file *fp; -{ - -#ifdef INVARIANTS - FILE_LOCK_ASSERT(fp, MA_OWNED); -#endif - fp->f_count++; - return (fp); -} - -static __inline struct file * -fhold(fp) - struct file *fp; -{ - - FILE_LOCK(fp); - fhold_locked(fp); - FILE_UNLOCK(fp); - return (fp); -} +#define fhold_locked(fp) \ + do { \ + FILE_LOCK_ASSERT(fp, MA_OWNED); \ + (fp)->f_count++; \ + } while (0) + +#define fhold(fp) \ + do { \ + FILE_LOCK(fp); \ + fhold_locked(fp); \ + FILE_UNLOCK(fp); \ + } while (0) static __inline int fo_read __P((struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td)); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 40c6bf0..4419c21 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -37,8 +37,8 @@ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ -#include <sys/lock.h> -#include <sys/mutex.h> +#include <sys/_lock.h> +#include <sys/_mutex.h> #include <sys/queue.h> #include <sys/sx.h> |