fs/ceph/mds_client.c
Source file repositories/reference/linux-study-clean/fs/ceph/mds_client.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ceph/mds_client.c- Extension
.c- Size
- 177955 bytes
- Lines
- 6599
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ceph/ceph_debug.hlinux/fs.hlinux/wait.hlinux/slab.hlinux/gfp.hlinux/sched.hlinux/debugfs.hlinux/seq_file.hlinux/ratelimit.hlinux/bits.hlinux/ktime.hlinux/bitmap.hlinux/mnt_idmapping.hsuper.hmds_client.hcrypto.hlinux/ceph/ceph_features.hlinux/ceph/messenger.hlinux/ceph/decode.hlinux/ceph/pagelist.hlinux/ceph/auth.hlinux/ceph/debugfs.htrace/events/ceph.h
Detected Declarations
struct ceph_reconnect_statefunction ceph_metric_bind_sessionfunction parse_reply_info_quotafunction parse_reply_info_infunction parse_reply_info_dirfunction parse_reply_info_leasefunction parse_reply_info_tracefunction parse_reply_info_readdirfunction parse_reply_info_filelockfunction ceph_parse_deleg_inosfunction ceph_get_deleg_inofunction xa_for_eachfunction ceph_restore_deleg_inofunction ceph_parse_deleg_inosfunction ceph_get_deleg_inofunction ceph_restore_deleg_inofunction parse_reply_info_createfunction parse_reply_info_getvxattrfunction parse_reply_info_extrafunction parse_reply_infofunction destroy_reply_infofunction ceph_wait_on_conflict_unlinkfunction ceph_put_mds_sessionfunction __have_sessionfunction __verify_registered_sessionfunction __unregister_sessionfunction put_request_sessionfunction ceph_mdsc_iterate_sessionsfunction ceph_mdsc_release_requestfunction lookup_get_requestfunction modifyingfunction __unregister_requestfunction test_bitfunction requestfunction upfunction encode_supported_featuresfunction encode_metric_specfunction create_session_full_msgfunction __open_sessionfunction __open_export_target_sessionfunction ceph_mdsc_open_export_target_sessionfunction __open_export_target_sessionsfunction detach_cap_releasesfunction dispose_cap_releasesfunction cleanup_session_requestsfunction __ceph_remove_capfunction remove_session_caps_cbfunction remove_session_caps
Annotated Snippet
struct ceph_reconnect_state {
struct ceph_mds_session *session;
int nr_caps, nr_realms;
struct ceph_pagelist *pagelist;
unsigned msg_version;
bool allow_multi;
};
static void __wake_requests(struct ceph_mds_client *mdsc,
struct list_head *head);
static void ceph_cap_release_work(struct work_struct *work);
static void ceph_cap_reclaim_work(struct work_struct *work);
static const struct ceph_connection_operations mds_con_ops;
static void ceph_metric_bind_session(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session)
{
struct ceph_mds_session *old;
if (!mdsc || !session || disable_send_metrics)
return;
old = mdsc->metric.session;
mdsc->metric.session = ceph_get_mds_session(session);
if (old)
ceph_put_mds_session(old);
metric_schedule_delayed(&mdsc->metric);
}
/*
* mds reply parsing
*/
static int parse_reply_info_quota(void **p, void *end,
struct ceph_mds_reply_info_in *info)
{
u8 struct_v, struct_compat;
u32 struct_len;
ceph_decode_8_safe(p, end, struct_v, bad);
ceph_decode_8_safe(p, end, struct_compat, bad);
/* struct_v is expected to be >= 1. we only
* understand encoding with struct_compat == 1. */
if (!struct_v || struct_compat != 1)
goto bad;
ceph_decode_32_safe(p, end, struct_len, bad);
ceph_decode_need(p, end, struct_len, bad);
end = *p + struct_len;
ceph_decode_64_safe(p, end, info->max_bytes, bad);
ceph_decode_64_safe(p, end, info->max_files, bad);
*p = end;
return 0;
bad:
return -EIO;
}
static int parse_reply_info_in(void **p, void *end,
struct ceph_mds_reply_info_in *info,
u64 features,
struct ceph_mds_client *mdsc)
{
int err = 0;
u8 struct_v = 0;
u8 struct_compat = 0;
u32 struct_len = 0;
info->subvolume_id = CEPH_SUBVOLUME_ID_NONE;
if (features == (u64)-1) {
ceph_decode_8_safe(p, end, struct_v, bad);
ceph_decode_8_safe(p, end, struct_compat, bad);
/* struct_v is expected to be >= 1. we only understand
* encoding with struct_compat == 1. */
if (!struct_v || struct_compat != 1)
goto bad;
ceph_decode_32_safe(p, end, struct_len, bad);
ceph_decode_need(p, end, struct_len, bad);
end = *p + struct_len;
}
ceph_decode_need(p, end, sizeof(struct ceph_mds_reply_inode), bad);
info->in = *p;
*p += sizeof(struct ceph_mds_reply_inode) +
sizeof(*info->in->fragtree.splits) *
le32_to_cpu(info->in->fragtree.nsplits);
ceph_decode_32_safe(p, end, info->symlink_len, bad);
ceph_decode_need(p, end, info->symlink_len, bad);
Annotation
- Immediate include surface: `linux/ceph/ceph_debug.h`, `linux/fs.h`, `linux/wait.h`, `linux/slab.h`, `linux/gfp.h`, `linux/sched.h`, `linux/debugfs.h`, `linux/seq_file.h`.
- Detected declarations: `struct ceph_reconnect_state`, `function ceph_metric_bind_session`, `function parse_reply_info_quota`, `function parse_reply_info_in`, `function parse_reply_info_dir`, `function parse_reply_info_lease`, `function parse_reply_info_trace`, `function parse_reply_info_readdir`, `function parse_reply_info_filelock`, `function ceph_parse_deleg_inos`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.