1185029Spjd/*
2185029Spjd * CDDL HEADER START
3185029Spjd *
4185029Spjd * The contents of this file are subject to the terms of the
5185029Spjd * Common Development and Distribution License (the "License").
6185029Spjd * You may not use this file except in compliance with the License.
7185029Spjd *
8185029Spjd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9185029Spjd * or http://www.opensolaris.org/os/licensing.
10185029Spjd * See the License for the specific language governing permissions
11185029Spjd * and limitations under the License.
12185029Spjd *
13185029Spjd * When distributing Covered Code, include this CDDL HEADER in each
14185029Spjd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15185029Spjd * If applicable, add the following below this CDDL HEADER, with the
16185029Spjd * fields enclosed by brackets "[]" replaced with your own identifying
17185029Spjd * information: Portions Copyright [yyyy] [name of copyright owner]
18185029Spjd *
19185029Spjd * CDDL HEADER END
20185029Spjd */
21185029Spjd/*
22185029Spjd * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23185029Spjd * Use is subject to license terms.
24185029Spjd */
25185029Spjd
26185029Spjd#ifndef _SYS_EXTDIRENT_H
27185029Spjd#define	_SYS_EXTDIRENT_H
28185029Spjd
29185029Spjd#pragma ident	"%Z%%M%	%I%	%E% SMI"
30185029Spjd
31185029Spjd#ifdef	__cplusplus
32185029Spjdextern "C" {
33185029Spjd#endif
34185029Spjd
35185029Spjd#include <sys/types.h>
36185029Spjd
37185029Spjd#if defined(_KERNEL)
38185029Spjd
39185029Spjd/*
40185029Spjd * Extended file-system independent directory entry.  This style of
41185029Spjd * dirent provides additional informational flag bits for each
42185029Spjd * directory entry.  This dirent will be returned instead of the
43185029Spjd * standard dirent if a VOP_READDIR() requests dirent flags via
44185029Spjd * V_RDDIR_ENTFLAGS, and if the file system supports the flags.
45185029Spjd */
46185029Spjdtypedef struct edirent {
47185029Spjd	ino64_t		ed_ino;		/* "inode number" of entry */
48185029Spjd	off64_t		ed_off;		/* offset of disk directory entry */
49185029Spjd	uint32_t	ed_eflags;	/* per-entry flags */
50185029Spjd	unsigned short	ed_reclen;	/* length of this record */
51185029Spjd	char		ed_name[1];	/* name of file */
52185029Spjd} edirent_t;
53185029Spjd
54185029Spjd#define	EDIRENT_RECLEN(namelen)	\
55185029Spjd	((offsetof(edirent_t, ed_name[0]) + 1 + (namelen) + 7) & ~ 7)
56185029Spjd#define	EDIRENT_NAMELEN(reclen)	\
57185029Spjd	((reclen) - (offsetof(edirent_t, ed_name[0])))
58185029Spjd
59185029Spjd/*
60185029Spjd * Extended entry flags
61185029Spjd *	Extended entries include a bitfield of extra information
62185029Spjd *	regarding that entry.
63185029Spjd */
64185029Spjd#define	ED_CASE_CONFLICT  0x10  /* Disconsidering case, entry is not unique */
65185029Spjd
66185029Spjd/*
67185029Spjd * Extended flags accessor function
68185029Spjd */
69185029Spjd#define	ED_CASE_CONFLICTS(x)	((x)->ed_eflags & ED_CASE_CONFLICT)
70185029Spjd
71185029Spjd#endif /* defined(_KERNEL) */
72185029Spjd
73185029Spjd#ifdef	__cplusplus
74185029Spjd}
75185029Spjd#endif
76185029Spjd
77185029Spjd#endif	/* _SYS_EXTDIRENT_H */
78