fs/orangefs/protocol.h
Source file repositories/reference/linux-study-clean/fs/orangefs/protocol.h
File Facts
- System
- Linux kernel
- Corpus path
fs/orangefs/protocol.h- Extension
.h- Size
- 11505 bytes
- Lines
- 363
- 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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/spinlock_types.hlinux/slab.hlinux/ioctl.horangefs-debug.h
Detected Declarations
struct orangefs_khandlestruct orangefs_object_krefstruct ORANGEFS_keyval_pairstruct ORANGEFS_sys_attr_sstruct dev_mask_info_sstruct dev_mask2_info_sstruct ORANGEFS_dev_map_descenum ORANGEFS_io_typeenum orangefs_ds_typefunction ORANGEFS_khandle_cmpfunction ORANGEFS_khandle_tofunction ORANGEFS_khandle_from
Annotated Snippet
struct orangefs_khandle {
unsigned char u[16];
} __aligned(8);
/*
* kernel version of an object ref.
*/
struct orangefs_object_kref {
struct orangefs_khandle khandle;
__s32 fs_id;
__s32 __pad1;
};
/*
* compare 2 khandles assumes little endian thus from large address to
* small address
*/
static inline int ORANGEFS_khandle_cmp(const struct orangefs_khandle *kh1,
const struct orangefs_khandle *kh2)
{
int i;
for (i = 15; i >= 0; i--) {
if (kh1->u[i] > kh2->u[i])
return 1;
if (kh1->u[i] < kh2->u[i])
return -1;
}
return 0;
}
static inline void ORANGEFS_khandle_to(const struct orangefs_khandle *kh,
void *p, int size)
{
memcpy(p, kh->u, 16);
memset(p + 16, 0, size - 16);
}
static inline void ORANGEFS_khandle_from(struct orangefs_khandle *kh,
void *p, int size)
{
memset(kh, 0, 16);
memcpy(kh->u, p, 16);
}
/* pvfs2-types.h ************************************************************/
#define ORANGEFS_SUPER_MAGIC 0x20030528
/*
* ORANGEFS error codes are a signed 32-bit integer. Error codes are negative, but
* the sign is stripped before decoding.
*/
/* Bit 31 is not used since it is the sign. */
/*
* Bit 30 specifies that this is a ORANGEFS error. A ORANGEFS error is either an
* encoded errno value or a ORANGEFS protocol error.
*/
#define ORANGEFS_ERROR_BIT (1 << 30)
/*
* Bit 29 specifies that this is a ORANGEFS protocol error and not an encoded
* errno value.
*/
#define ORANGEFS_NON_ERRNO_ERROR_BIT (1 << 29)
/*
* Bits 9, 8, and 7 specify the error class, which encodes the section of
* server code the error originated in for logging purposes. It is not used
* in the kernel except to be masked out.
*/
#define ORANGEFS_ERROR_CLASS_BITS 0x380
/* Bits 6 - 0 are reserved for the actual error code. */
#define ORANGEFS_ERROR_NUMBER_BITS 0x7f
/* Encoded errno values decoded by PINT_errno_mapping in orangefs-utils.c. */
/* Our own ORANGEFS protocol error codes. */
#define ORANGEFS_ECANCEL (1|ORANGEFS_NON_ERRNO_ERROR_BIT|ORANGEFS_ERROR_BIT)
#define ORANGEFS_EDEVINIT (2|ORANGEFS_NON_ERRNO_ERROR_BIT|ORANGEFS_ERROR_BIT)
#define ORANGEFS_EDETAIL (3|ORANGEFS_NON_ERRNO_ERROR_BIT|ORANGEFS_ERROR_BIT)
#define ORANGEFS_EHOSTNTFD (4|ORANGEFS_NON_ERRNO_ERROR_BIT|ORANGEFS_ERROR_BIT)
#define ORANGEFS_EADDRNTFD (5|ORANGEFS_NON_ERRNO_ERROR_BIT|ORANGEFS_ERROR_BIT)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/spinlock_types.h`, `linux/slab.h`, `linux/ioctl.h`, `orangefs-debug.h`.
- Detected declarations: `struct orangefs_khandle`, `struct orangefs_object_kref`, `struct ORANGEFS_keyval_pair`, `struct ORANGEFS_sys_attr_s`, `struct dev_mask_info_s`, `struct dev_mask2_info_s`, `struct ORANGEFS_dev_map_desc`, `enum ORANGEFS_io_type`, `enum orangefs_ds_type`, `function ORANGEFS_khandle_cmp`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.