fs/vboxsf/shfl_hostintf.h

Source file repositories/reference/linux-study-clean/fs/vboxsf/shfl_hostintf.h

File Facts

System
Linux kernel
Corpus path
fs/vboxsf/shfl_hostintf.h
Extension
.h
Size
22543 bytes
Lines
902
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct shfl_string {
	/** Allocated size of the string member in bytes. */
	u16 size;

	/** Length of string without trailing nul in bytes. */
	u16 length;

	/** UTF-8 or UTF-16 string. Nul terminated. */
	union {
		u8 legacy_padding[2];
		DECLARE_FLEX_ARRAY(u8, utf8);
		DECLARE_FLEX_ARRAY(u16, utf16);
	} string;
};
VMMDEV_ASSERT_SIZE(shfl_string, 6);

/* The size of shfl_string w/o the string part. */
#define SHFLSTRING_HEADER_SIZE  4

/* Calculate size of the string. */
static inline u32 shfl_string_buf_size(const struct shfl_string *string)
{
	return string ? SHFLSTRING_HEADER_SIZE + string->size : 0;
}

/* Set user id on execution (S_ISUID). */
#define SHFL_UNIX_ISUID             0004000U
/* Set group id on execution (S_ISGID). */
#define SHFL_UNIX_ISGID             0002000U
/* Sticky bit (S_ISVTX / S_ISTXT). */
#define SHFL_UNIX_ISTXT             0001000U

/* Owner readable (S_IRUSR). */
#define SHFL_UNIX_IRUSR             0000400U
/* Owner writable (S_IWUSR). */
#define SHFL_UNIX_IWUSR             0000200U
/* Owner executable (S_IXUSR). */
#define SHFL_UNIX_IXUSR             0000100U

/* Group readable (S_IRGRP). */
#define SHFL_UNIX_IRGRP             0000040U
/* Group writable (S_IWGRP). */
#define SHFL_UNIX_IWGRP             0000020U
/* Group executable (S_IXGRP). */
#define SHFL_UNIX_IXGRP             0000010U

/* Other readable (S_IROTH). */
#define SHFL_UNIX_IROTH             0000004U
/* Other writable (S_IWOTH). */
#define SHFL_UNIX_IWOTH             0000002U
/* Other executable (S_IXOTH). */
#define SHFL_UNIX_IXOTH             0000001U

/* Named pipe (fifo) (S_IFIFO). */
#define SHFL_TYPE_FIFO              0010000U
/* Character device (S_IFCHR). */
#define SHFL_TYPE_DEV_CHAR          0020000U
/* Directory (S_IFDIR). */
#define SHFL_TYPE_DIRECTORY         0040000U
/* Block device (S_IFBLK). */
#define SHFL_TYPE_DEV_BLOCK         0060000U
/* Regular file (S_IFREG). */
#define SHFL_TYPE_FILE              0100000U
/* Symbolic link (S_IFLNK). */
#define SHFL_TYPE_SYMLINK           0120000U
/* Socket (S_IFSOCK). */
#define SHFL_TYPE_SOCKET            0140000U
/* Whiteout (S_IFWHT). */
#define SHFL_TYPE_WHITEOUT          0160000U
/* Type mask (S_IFMT). */
#define SHFL_TYPE_MASK              0170000U

/* Checks the mode flags indicate a directory (S_ISDIR). */
#define SHFL_IS_DIRECTORY(m)   (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY)
/* Checks the mode flags indicate a symbolic link (S_ISLNK). */
#define SHFL_IS_SYMLINK(m)     (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK)

/** The available additional information in a shfl_fsobjattr object. */
enum shfl_fsobjattr_add {
	/** No additional information is available / requested. */
	SHFLFSOBJATTRADD_NOTHING = 1,
	/**
	 * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are
	 *  available / requested.
	 */
	SHFLFSOBJATTRADD_UNIX,
	/**
	 * The additional extended attribute size (shfl_fsobjattr::u::size) is
	 *  available / requested.
	 */

Annotation

Implementation Notes