/*
* stat.h - SAM-FS file information definitions.
*
* Defines the SAM-FS file information structure and functions.
* The POSIX stat structure and associated macros are used to allow
* the sam_stat structure to be used on various client machine
* architectures.
*
*/
/*
* SAM-QFS_notice_begin
*
* 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 pkg/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 pkg/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
*/
/*
*
* SAM-QFS_notice_end
*/
#ifndef SAM_STAT_H
#define SAM_STAT_H
#ifdef linux
#endif /* linux */
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following is provided to avoid compilation errors:
*/
#ifdef linux
#endif /* linux */
#endif /* defined(_SYS_STAT_H) */
/*
* NOTE that in order to pass the following structures from a 64-bit
* kernel to a 32-bit application, we need to conditionally define the
* positions of the 32-bit time and the pad differently for SPARC and X86.
*/
/*
* Begin: 32-bit align copyin() structs for amd64 only due to 32-bit x86 ABI
*/
#pragma pack(4)
#endif
/*
* For each archive copy
*/
struct sam_copy_s {
/* Location of archive file */
/* Time archive copy created */
/* Location of copy in archive file - in units of 512 bytes */
/* Number of VSNs the archive used */
short n_vsns;
/* Media type */
/* VSN */
};
/*
* POSIX stat structure.
*/
struct sam_stat {
#ifdef sun
/* ID of the device containing the file */
#endif /* sun */
#ifdef linux
/* ID of the device containing the file */
#endif /* linux */
/* SAM-FS information. */
#ifdef sun
/* ID of device if S_IFBLK or S_IFCHR */
#endif /* sun */
#ifdef linux
/* ID of device if S_IFBLK or S_IFCHR */
#endif /* linux */
/* Block count in units of 512 byte blocks */
/* Segment size in megabytes (SS_SEGMENT_A) */
/* Number of this segment */
/* 0 - SS_SEGMENT_F, 1 .. n - SS_SEGMENT_S */
/* Number of segments to stage ahead */
/* admin ID; inherited from dir */
/* Allocate ahead size set by setfa -A */
/*
* Object stripe depth in kilobytes.
* If this field is used only for OSD support then it should be removed
* once it is determined that removing it is safe. Update the man page
* for sam_stat(3) when this is done.
*/
/* 128 bit checksum */
/* WORM retention period start and duration. */
};
#else /* __sparcv9 || __amd64 || linux */
/*
* For each archive copy.
*/
struct sam_copy_s {
/* Location of archive file */
#if defined(__i386)
/* Time archive copy created */
#else
/* Time archive copy created */
#endif /* __i386 */
/* Location of copy in archive file - in units of 512 bytes */
};
/*
* POSIX stat structure.
*/
struct sam_stat {
/* File mode */
/* File serial number */
/* ID of the device containing the file */
long pad1;
#if defined(__i386)
/* SAM-FS information. */
#else /* __i386 */
/* SAM-FS information. */
#endif /* __i386 */
/* Block count in units of 512 byte blocks */
/* Segment size in megabytes (SS_SEGMENT_A) */
/* Number of this segment */
/* 0 - SS_SEGMENT_F, 1 .. n - SS_SEGMENT_S */
/* Number of segments to stage ahead */
/* admin ID; inherited from dir */
/* Allocate ahead size set by setfa -A */
/* 128 bit checksum */
/* WORM retention period start and duration. */
#if defined(__i386)
#else /* __i386 */
#endif /* __i386 */
};
#endif /* __sparcv9 || __amd64 || linux */
/* VSN */
/* Section length of file on this volume */
/* Position of archive file for this section */
/* Location of copy section in archive file */
};
/*
* End: 32-bit align copyin() structs for amd64 only due to 32-bit x86 ABI
*/
#pragma pack()
#endif
/*
* POSIX symbols.
*/
/*
* SAMFS attributes mapped into sam_stat but not in inode (ino_status_t).
*/
/*
* SAMFS attributes from the inode.
*/
/* not online and no copy */
/* archive */
/* SS_SAMFS 0x00000800 used by sam_stat() - see above */
/* archiving done */
/* SS_ARCHIVE_R 0x00002000 used by sam_stat() - see above */
/* SS_ARCHIVED 0x00010000 used by sam_stat() - see above */
/* SS_DATA_V 0x00040000 used by sam_stat() - see above */
/* SS_AIO 0x00080000 used by sam_stat() - see above */
/* segmented file */
/* SS_ARCHIVE_A 0x08000000 used by sam_stat() - see above */
/* present */
/*
* SAMFS flags.
*/
/* last stage attempt */
/*
* Copy flag masks.
*/
/* the AR_FLAGS in the inode */
/*
* macro NUM_SEGS, takes in, fsbuff, a ptr to a sam_stat struct, returns the
* number of segments of the file associated with fsbuff.
*/
(fsbuff)->segment_size <= 0 || \
(SAM_MIN_SEGMENT_SIZE) - 1LL) / \
#ifdef __cplusplus
}
#endif
#endif /* SAM_STAT_H */