Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Don't nest structure definitions.



details:   https://anonhg.NetBSD.org/src/rev/e1fc04f02689
branches:  trunk
changeset: 805747:e1fc04f02689
user:      dennis <dennis%NetBSD.org@localhost>
date:      Fri Jan 16 21:38:26 2015 +0000

description:
Don't nest structure definitions.

This modification was made directly to sys/sys/namei.h (1.90) but
was inadvertently lost as a result of the previous revision here.
Restore the lost change here instead.

diffstat:

 sys/sys/namei.src |  41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diffs (69 lines):

diff -r 65814128ffd6 -r e1fc04f02689 sys/sys/namei.src
--- a/sys/sys/namei.src Fri Jan 16 21:35:34 2015 +0000
+++ b/sys/sys/namei.src Fri Jan 16 21:38:26 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: namei.src,v 1.34 2014/12/24 19:50:04 dennis Exp $      */
+/*     $NetBSD: namei.src,v 1.35 2015/01/16 21:38:26 dennis Exp $      */
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -77,6 +77,26 @@
 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 {
@@ -107,20 +127,7 @@
         * 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;
 };
 
 /*
@@ -221,8 +228,8 @@
 
 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.



Home | Main Index | Thread Index | Old Index