Module Name:    src
Committed By:   matt
Date:           Fri Sep  5 05:42:50 UTC 2014

Modified Files:
        src/sys/sys: exec.h file.h namei.h pool.h sysctl.h wapbl.h

Log Message:
Don't nest structure definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/sys/exec.h
cvs rdiff -u -r1.75 -r1.76 src/sys/sys/file.h
cvs rdiff -u -r1.89 -r1.90 src/sys/sys/namei.h
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/pool.h
cvs rdiff -u -r1.213 -r1.214 src/sys/sys/sysctl.h
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/wapbl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/exec.h
diff -u src/sys/sys/exec.h:1.145 src/sys/sys/exec.h:1.146
--- src/sys/sys/exec.h:1.145	Thu Mar  6 09:30:37 2014
+++ src/sys/sys/exec.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.h,v 1.145 2014/03/06 09:30:37 matt Exp $	*/
+/*	$NetBSD: exec.h,v 1.146 2014/09/05 05:42:50 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -181,6 +181,10 @@ struct exec_vmcmd_set {
 };
 
 #define	EXEC_DEFAULT_VMCMD_SETSIZE	9	/* # of cmds in set to start */
+struct exec_fakearg {
+	char *fa_arg;
+	size_t fa_len;
+};
 
 struct exec_package {
 	const char *ep_name;		/* file's name */
@@ -205,10 +209,7 @@ struct exec_package {
 	vaddr_t	ep_vm_maxaddr;		/* top of process address space */
 	u_int	ep_flags;		/* flags; see below. */
 	size_t	ep_fa_len;		/* byte size of ep_fa */
-	struct exec_fakearg {
-		char *fa_arg;
-		size_t fa_len;
-	} *ep_fa;			/* a fake args vector for scripts */
+	struct exec_fakearg *ep_fa;	/* a fake args vector for scripts */
 	int	ep_fd;			/* a file descriptor we're holding */
 	void	*ep_emul_arg;		/* emulation argument */
 	const struct	execsw *ep_esch;/* execsw entry */

Index: src/sys/sys/file.h
diff -u src/sys/sys/file.h:1.75 src/sys/sys/file.h:1.76
--- src/sys/sys/file.h:1.75	Wed Jan  2 19:35:43 2013
+++ src/sys/sys/file.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.75 2013/01/02 19:35:43 dsl Exp $	*/
+/*	$NetBSD: file.h,v 1.76 2014/09/05 05:42:50 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -78,6 +78,22 @@ struct iovec;
 struct stat;
 struct knote;
 
+struct fileops {
+	int	(*fo_read)	(struct file *, off_t *, struct uio *,
+				    kauth_cred_t, int);
+	int	(*fo_write)	(struct file *, off_t *, struct uio *,
+				    kauth_cred_t, int);
+	int	(*fo_ioctl)	(struct file *, u_long, void *);
+	int	(*fo_fcntl)	(struct file *, u_int, void *);
+	int	(*fo_poll)	(struct file *, int);
+	int	(*fo_stat)	(struct file *, struct stat *);
+	int	(*fo_close)	(struct file *);
+	int	(*fo_kqfilter)	(struct file *, struct knote *);
+	void	(*fo_restart)	(struct file *);
+	void	(*fo_spare1)	(void);
+	void	(*fo_spare2)	(void);
+};
+
 /*
  * Kernel file descriptor.  One entry for each open kernel vnode and
  * socket.
@@ -88,21 +104,7 @@ struct knote;
 struct file {
 	off_t		f_offset;	/* first, is 64-bit */
 	kauth_cred_t 	f_cred;		/* creds associated with descriptor */
-	const struct fileops {
-		int	(*fo_read)	(struct file *, off_t *, struct uio *,
-					    kauth_cred_t, int);
-		int	(*fo_write)	(struct file *, off_t *, struct uio *,
-					    kauth_cred_t, int);
-		int	(*fo_ioctl)	(struct file *, u_long, void *);
-		int	(*fo_fcntl)	(struct file *, u_int, void *);
-		int	(*fo_poll)	(struct file *, int);
-		int	(*fo_stat)	(struct file *, struct stat *);
-		int	(*fo_close)	(struct file *);
-		int	(*fo_kqfilter)	(struct file *, struct knote *);
-		void	(*fo_restart)	(struct file *);
-		void	(*fo_spare1)	(void);
-		void	(*fo_spare2)	(void);
-	} *f_ops;
+	const struct fileops *f_ops;
 	void		*f_data;	/* descriptor data, e.g. vnode/socket */
 	LIST_ENTRY(file) f_list;	/* list of active files */
 	kmutex_t	f_lock;		/* lock on structure */

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.89 src/sys/sys/namei.h:1.90
--- src/sys/sys/namei.h:1.89	Tue Jun  3 21:16:37 2014
+++ src/sys/sys/namei.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.h,v 1.89 2014/06/03 21:16:37 joerg Exp $	*/
+/*	$NetBSD: namei.h,v 1.90 2014/09/05 05:42:50 matt Exp $	*/
 
 
 /*
@@ -85,6 +85,26 @@ void pathbuf_stringcopy_put(struct pathb
 int pathbuf_maybe_copyin(const char *userpath, enum uio_seg seg, struct pathbuf **ret);
 
 /*
+ * Lookup parameters: this structure describes the subset of
+ * information from the nameidata structure that is passed
+ * through the VOP interface.
+ */
+struct componentname {
+	/*
+	 * Arguments to lookup.
+	 */
+	uint32_t	cn_nameiop;	/* namei operation */
+	uint32_t	cn_flags;	/* flags to namei */
+	kauth_cred_t 	cn_cred;	/* credentials */
+	/*
+	 * Shared between lookup and commit routines.
+	 */
+	const char 	*cn_nameptr;	/* pointer to looked up name */
+	size_t		cn_namelen;	/* length of looked up comp */
+	size_t		cn_consume;	/* chars to consume in lookup */
+};
+
+/*
  * Encapsulation of namei parameters.
  */
 struct nameidata {
@@ -115,20 +135,7 @@ struct nameidata {
 	 * information from the nameidata structure that is passed
 	 * through the VOP interface.
 	 */
-	struct componentname {
-		/*
-		 * Arguments to lookup.
-		 */
-		uint32_t	cn_nameiop;	/* namei operation */
-		uint32_t	cn_flags;	/* flags to namei */
-		kauth_cred_t 	cn_cred;	/* credentials */
-		/*
-		 * Shared between lookup and commit routines.
-		 */
-		const char 	*cn_nameptr;	/* pointer to looked up name */
-		size_t		cn_namelen;	/* length of looked up comp */
-		size_t		cn_consume;	/* chars to consume in lookup */
-	} ni_cnd;
+	struct componentname ni_cnd;
 };
 
 /*
@@ -229,8 +236,8 @@ struct cpu_info;
 
 extern pool_cache_t pnbuf_cache;	/* pathname buffer cache */
 
-#define	PNBUF_GET()	pool_cache_get(pnbuf_cache, PR_WAITOK)
-#define	PNBUF_PUT(pnb)	pool_cache_put(pnbuf_cache, (pnb))
+#define	PNBUF_GET()	((char *)pool_cache_get(pnbuf_cache, PR_WAITOK))
+#define	PNBUF_PUT(pnb)	pool_cache_put(pnbuf_cache, (void *)(pnb))
 
 /*
  * Typesafe flags for namei_simple/nameiat_simple.

Index: src/sys/sys/pool.h
diff -u src/sys/sys/pool.h:1.76 src/sys/sys/pool.h:1.77
--- src/sys/sys/pool.h:1.76	Fri Jun 13 19:09:07 2014
+++ src/sys/sys/pool.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pool.h,v 1.76 2014/06/13 19:09:07 joerg Exp $	*/
+/*	$NetBSD: pool.h,v 1.77 2014/09/05 05:42:50 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2007 The NetBSD Foundation, Inc.
@@ -97,6 +97,7 @@ struct pool_allocator {
 };
 
 LIST_HEAD(pool_pagelist,pool_item_header);
+SPLAY_HEAD(phtree, pool_item_header);
 
 struct pool {
 	TAILQ_ENTRY(pool)
@@ -158,7 +159,7 @@ struct pool {
 	kcondvar_t	pr_cv;
 	int		pr_ipl;
 
-	SPLAY_HEAD(phtree, pool_item_header) pr_phtree;
+	struct phtree	pr_phtree;
 
 	int		pr_maxcolor;	/* Cache colouring */
 	int		pr_curcolor;

Index: src/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.213 src/sys/sys/sysctl.h:1.214
--- src/sys/sys/sysctl.h:1.213	Sat Jul 12 09:57:25 2014
+++ src/sys/sys/sysctl.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.213 2014/07/12 09:57:25 njoly Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.214 2014/09/05 05:42:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -415,34 +415,36 @@ struct ki_ucred {
 
 #if defined(_KERNEL) || defined(_KMEMUSER)
 
+struct	eproc {
+	struct	proc *e_paddr;		/* address of proc */
+	struct	session *e_sess;	/* session pointer */
+	struct	ki_pcred e_pcred;	/* process credentials */
+	struct	ki_ucred e_ucred;	/* current credentials */
+	struct	vmspace e_vm;		/* address space */
+	pid_t	e_ppid;			/* parent process id */
+	pid_t	e_pgid;			/* process group id */
+	short	e_jobc;			/* job control counter */
+	uint32_t e_tdev;		/* XXX: controlling tty dev */
+	pid_t	e_tpgid;		/* tty process group id */
+	struct	session *e_tsess;	/* tty session pointer */
+#define	WMESGLEN	8
+	char	e_wmesg[WMESGLEN];	/* wchan message */
+	segsz_t e_xsize;		/* text size */
+	short	e_xrssize;		/* text rss */
+	short	e_xccount;		/* text references */
+	short	e_xswrss;
+	long	e_flag;			/* see p_eflag  below */
+	char	e_login[MAXLOGNAME];	/* setlogin() name */
+	pid_t	e_sid;			/* session id */
+	long	e_spare[3];
+};
+
 /*
  * KERN_PROC subtype ops return arrays of augmented proc structures:
  */
 struct kinfo_proc {
 	struct	proc kp_proc;			/* proc structure */
-	struct	eproc {
-		struct	proc *e_paddr;		/* address of proc */
-		struct	session *e_sess;	/* session pointer */
-		struct	ki_pcred e_pcred;	/* process credentials */
-		struct	ki_ucred e_ucred;	/* current credentials */
-		struct	vmspace e_vm;		/* address space */
-		pid_t	e_ppid;			/* parent process id */
-		pid_t	e_pgid;			/* process group id */
-		short	e_jobc;			/* job control counter */
-		uint32_t e_tdev;		/* XXX: controlling tty dev */
-		pid_t	e_tpgid;		/* tty process group id */
-		struct	session *e_tsess;	/* tty session pointer */
-#define	WMESGLEN	8
-		char	e_wmesg[WMESGLEN];	/* wchan message */
-		segsz_t e_xsize;		/* text size */
-		short	e_xrssize;		/* text rss */
-		short	e_xccount;		/* text references */
-		short	e_xswrss;
-		long	e_flag;			/* see p_eflag  below */
-		char	e_login[MAXLOGNAME];	/* setlogin() name */
-		pid_t	e_sid;			/* session id */
-		long	e_spare[3];
-	} kp_eproc;
+	struct	eproc kp_eproc;			/* eproc structure */
 };
 #endif /* defined(_KERNEL) || defined(_KMEMUSER) */
 

Index: src/sys/sys/wapbl.h
diff -u src/sys/sys/wapbl.h:1.15 src/sys/sys/wapbl.h:1.16
--- src/sys/sys/wapbl.h:1.15	Mon Sep 30 18:58:00 2013
+++ src/sys/sys/wapbl.h	Fri Sep  5 05:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: wapbl.h,v 1.15 2013/09/30 18:58:00 hannken Exp $	*/
+/*	$NetBSD: wapbl.h,v 1.16 2014/09/05 05:42:50 matt Exp $	*/
 
 /*-
  * Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
@@ -215,6 +215,7 @@ wapbl_vphaswapbl(struct vnode *vp)
 /* Replay support */
 
 #ifdef WAPBL_INTERNAL
+LIST_HEAD(wapbl_blk_head, wapbl_blk);
 struct wapbl_replay {
 	struct vnode *wr_logvp;
 	struct vnode *wr_devvp;
@@ -228,7 +229,7 @@ struct wapbl_replay {
 
 	void *wr_scratch;
 
-	LIST_HEAD(wapbl_blk_head, wapbl_blk) *wr_blkhash;
+	struct wapbl_blk_head *wr_blkhash;
 	u_long wr_blkhashmask;
 	int wr_blkhashcnt;
 

Reply via email to