summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/dnlc.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/sys/dnlc.h')
-rw-r--r--usr/src/uts/common/sys/dnlc.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/src/uts/common/sys/dnlc.h b/usr/src/uts/common/sys/dnlc.h
index 4a5c20d6d0..1a6be2bebf 100644
--- a/usr/src/uts/common/sys/dnlc.h
+++ b/usr/src/uts/common/sys/dnlc.h
@@ -82,10 +82,15 @@ typedef struct ncache {
struct vnode *dp; /* vnode of parent of name */
int hash; /* hash signature */
uchar_t namlen; /* length of name */
- char name[1]; /* segment name - null terminated */
+ char name[]; /* segment name */
} ncache_t;
/*
+ * Produce size of struct ncache with space allocated in name string.
+ */
+#define NCACHE_SIZE(namelen) offsetof(ncache_t, name) + (namelen)
+
+/*
* Hash table bucket structure of name cache entries for fast lookup.
*/
typedef struct nc_hash {
@@ -214,9 +219,14 @@ typedef struct dcentry {
struct dcentry *de_next; /* link to next name entry in bucket */
int de_hash; /* hash signature */
uchar_t de_namelen; /* length of name excluding null */
- char de_name[1]; /* null terminated name */
+ char de_name[]; /* name */
} dcentry_t;
+/*
+ * Produce size of struct dcentry with space allocated in name string.
+ */
+#define DCENTTRY_SIZE(namelen) offsetof(dcentry_t, de_name) + (namelen)
+
typedef struct dircache {
struct dircache *dc_next; /* chain - for purge purposes */
struct dircache *dc_prev; /* chain - for purge purposes */