mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-02 12:20:51 +00:00
Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.
Requested by: jhb
This commit is contained in:
parent
d81986de07
commit
9e209b124a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89316
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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 */
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
{
|
||||
#define fhold_locked(fp) \
|
||||
do { \
|
||||
FILE_LOCK_ASSERT(fp, MA_OWNED); \
|
||||
(fp)->f_count++; \
|
||||
} while (0)
|
||||
|
||||
#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(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));
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user