include/linux/ceph/osdmap.h
Source file repositories/reference/linux-study-clean/include/linux/ceph/osdmap.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ceph/osdmap.h- Extension
.h- Size
- 9274 bytes
- Lines
- 340
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/rbtree.hlinux/ceph/types.hlinux/ceph/decode.hlinux/crush/crush.h
Detected Declarations
struct ceph_pgstruct ceph_spgstruct ceph_pg_pool_infostruct ceph_object_locatorstruct ceph_object_idstruct workspace_managerstruct ceph_pg_mappingstruct ceph_osdmapstruct ceph_osdsstruct crush_locstruct crush_loc_nodefunction ceph_can_shift_osdsfunction ceph_oloc_initfunction ceph_oloc_emptyfunction ceph_oid_initfunction ceph_oid_emptyfunction ceph_osd_existsfunction ceph_osd_is_upfunction ceph_osd_is_downfunction ceph_decode_pgidfunction ceph_osds_init
Annotated Snippet
struct ceph_pg {
uint64_t pool;
uint32_t seed;
};
#define CEPH_SPG_NOSHARD -1
struct ceph_spg {
struct ceph_pg pgid;
s8 shard;
};
int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs);
int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs);
#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
together */
#define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */
#define CEPH_POOL_FLAG_FULL_QUOTA (1ULL << 10) /* pool ran out of quota,
will set FULL too */
#define CEPH_POOL_FLAG_NEARFULL (1ULL << 11) /* pool is nearfull */
struct ceph_pg_pool_info {
struct rb_node node;
s64 id;
u8 type; /* CEPH_POOL_TYPE_* */
u8 size;
u8 min_size;
u8 crush_ruleset;
u8 object_hash;
u32 last_force_request_resend;
u32 pg_num, pgp_num;
int pg_num_mask, pgp_num_mask;
s64 read_tier;
s64 write_tier; /* wins for read+write ops */
u64 flags; /* CEPH_POOL_FLAG_* */
char *name;
bool was_full; /* for handle_one_map() */
};
static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool)
{
switch (pool->type) {
case CEPH_POOL_TYPE_REP:
return true;
case CEPH_POOL_TYPE_EC:
return false;
default:
BUG();
}
}
struct ceph_object_locator {
s64 pool;
struct ceph_string *pool_ns;
};
static inline void ceph_oloc_init(struct ceph_object_locator *oloc)
{
oloc->pool = -1;
oloc->pool_ns = NULL;
}
static inline bool ceph_oloc_empty(const struct ceph_object_locator *oloc)
{
return oloc->pool == -1;
}
void ceph_oloc_copy(struct ceph_object_locator *dest,
const struct ceph_object_locator *src);
void ceph_oloc_destroy(struct ceph_object_locator *oloc);
/*
* 51-char inline_name is long enough for all cephfs and all but one
* rbd requests: <imgname> in "<imgname>.rbd"/"rbd_id.<imgname>" can be
* arbitrarily long (~PAGE_SIZE). It's done once during rbd map; all
* other rbd requests fit into inline_name.
*
* Makes ceph_object_id 64 bytes on 64-bit.
*/
#define CEPH_OID_INLINE_LEN 52
/*
* Both inline and external buffers have space for a NUL-terminator,
* which is carried around. It's not required though - RADOS object
* names don't have to be NUL-terminated and may contain NULs.
*/
struct ceph_object_id {
char *name;
Annotation
- Immediate include surface: `linux/rbtree.h`, `linux/ceph/types.h`, `linux/ceph/decode.h`, `linux/crush/crush.h`.
- Detected declarations: `struct ceph_pg`, `struct ceph_spg`, `struct ceph_pg_pool_info`, `struct ceph_object_locator`, `struct ceph_object_id`, `struct workspace_manager`, `struct ceph_pg_mapping`, `struct ceph_osdmap`, `struct ceph_osds`, `struct crush_loc`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.