hsfs_rrip.h revision 9694f18abe33defb33e388545da0a2b3f4555ace
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ISO 9660 RRIP extension filesystem specifications
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_HSFS_RRIP_H
#define _SYS_FS_HSFS_RRIP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Mount options specific to HSFS.
* This is not a good place for them; we should probably have a file
* named hsfs_mount.h for such stuff.
*/
/* FS is from a recent mkisofs */
/*
* XXX: The following flag was used in the past to instruct the kernel to
* ignore Rock Ridge extensions on a CD. Unfortunately, this was
* implemented as part of the generic mount flags, a bad idea.
* This flag should not be used anymore. The HSFSMNT_NORRIP
* flag should be used in its place. The hsfs_mount code currently
* understands this flag, but this functionality should go
* away in the future.
*/
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/*
* Make sure we have this first
*/
#define RRIP_VERSION 1
#define RRIP_SUF_VERSION 1
#define RRIP_EXT_VERSION 1
/*
* RRIP signature macros
*/
#define RRIP_CL "CL"
#define RRIP_NM "NM"
#define RRIP_PL "PL"
#define RRIP_PN "PN"
#define RRIP_PX "PX"
#define RRIP_RE "RE"
#define RRIP_RR "RR"
#define RRIP_SL "SL"
#define RRIP_TF "TF"
/*
* RRIP ER extension fields
*/
#define RRIP_ER_EXT_ID "RRIP_1991A"
#define RRIP_ER_EXT_DES "THE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES \
SUPPORT FOR POSIX FILE SYSTEM SEMANTICS."
#define RRIP_ER_EXT_SRC "PLEASE CONTACT DISC PUBLISHER FOR \
SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR \
FOR CONTACT INFORMATION."
/*
* "TF" time macros
*/
#define RRIP_TF_FLAGS(x) *(RRIP_tf_flags(x))
#define RRIP_TIME_START_BP 5
RRIP_TF_LONG_BIT) ? \
/*
* Time location bits
*/
#define RRIP_TF_CREATION_BIT 0x01
#define RRIP_TF_MODIFY_BIT 0x02
#define RRIP_TF_ACCESS_BIT 0x04
#define RRIP_TF_ATTRIBUTES_BIT 0x08
#define RRIP_TF_BACKUP_BIT 0x10
#define RRIP_TF_EXPIRATION_BIT 0x20
#define RRIP_TF_EFFECTIVE_BIT 0x40
#define RRIP_TF_LONG_BIT 0x80
(RRIP_TF_TIME_LENGTH(x) * \
(IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_CREATION_BIT)))])
(RRIP_TF_TIME_LENGTH(x) * \
(IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_CREATION_BIT) + \
IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_MODIFY_BIT)))])
(RRIP_TF_TIME_LENGTH(x) * \
(IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_CREATION_BIT) + \
IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_MODIFY_BIT) + \
IS_TIME_BIT_SET(RRIP_TF_FLAGS(x), \
RRIP_TF_ACCESS_BIT)))])
/*
* Check if TF Bits are set.
*
* Note : IS_TIME_BIT_SET(x, y) must be kept returning 1 and 0.
* see RRIP_tf_*(x) Macros
*/
#define IS_TIME_BIT_SET(x, y) (((x) & (y)) ? 1 : 0)
#define SET_TIME_BIT(x, y) ((x) |= (y))
/*
* "PX" Posix attibutes
*/
#define RRIP_PX_OLD_SIZE 36
#define RRIP_PX_SIZE 44
/*
*/
/*
* "NM" alternate name and "SL" symbolic link macros...
*/
#define RRIP_NAME_LEN_BASE 5
/*
* These are for the flag bits in the NM and SL and must remain <= 8 bits
*/
#define RRIP_NAME_CONTINUE 0x01
#define RRIP_NAME_CURRENT 0x02
#define RRIP_NAME_PARENT 0x04
#define RRIP_NAME_ROOT 0x08
#define RRIP_NAME_VOLROOT 0x10
#define RRIP_NAME_HOST 0x20
/*
* These are unique to use in the > 8 bits of sig_args.name_flags
* They are > 8 so that we can share bits from above.
* This can grow to 32 bits.
*/
#define RRIP_NAME_CHANGE 0x40
/* from SUA (no longer than a short) */
/*
* Bit handling....
*/
#define SET_NAME_BIT(x, y) ((x) |= (y))
#define UNSET_NAME_BIT(x, y) ((x) &= ~(y))
#define IS_NAME_BIT_SET(x, y) ((x) & (y))
#define NAME_HAS_CHANGED(flag) \
/*
* This is the maximum filename length that we support
*/
#define RRIP_FILE_NAMELEN 255
/*
* SL Symbolic link macros (in addition to common name flag macos
*/
/* these two macros are from the SL SUF pointer */
#define RRIP_SL_COMP(x) RRIP_sl_comp(x)
/* these macros are from the component pointer within the SL SUF */
#define RRIP_COMP_FLAGS(x) (((uchar_t *)x)[0])
/*
* Directory hierarchy macros
*/
/*
* Macros for checking relocation bits in flags member of dlist
* structure defined in iso_impl.h
*/
#define IS_RELOC_BIT_SET(x, y) (((x) & (y)) ? 1 : 0)
#define SET_RELOC_BIT(x, y) ((x) |= (y))
#define CHILD_LINK 0x01
#define PARENT_LINK 0x02
#define RELOCATED_DIR 0x04
#ifdef _KERNEL
/*
* Forward declarations
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_HSFS_RRIP_H */