net/ceph/pagevec.c
Source file repositories/reference/linux-study-clean/net/ceph/pagevec.c
File Facts
- System
- Linux kernel
- Corpus path
net/ceph/pagevec.c- Extension
.c- Size
- 2435 bytes
- Lines
- 115
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/sched.hlinux/slab.hlinux/file.hlinux/namei.hlinux/writeback.hlinux/ceph/libceph.h
Detected Declarations
function ceph_put_page_vectorfunction ceph_release_page_vectorfunction ceph_copy_from_page_vectorfunction ceph_zero_page_vector_rangeexport ceph_put_page_vectorexport ceph_release_page_vectorexport ceph_alloc_page_vectorexport ceph_copy_from_page_vectorexport ceph_zero_page_vector_range
Annotated Snippet
if (pages[i] == NULL) {
ceph_release_page_vector(pages, i);
return ERR_PTR(-ENOMEM);
}
}
return pages;
}
EXPORT_SYMBOL(ceph_alloc_page_vector);
void ceph_copy_from_page_vector(struct page **pages,
void *data,
loff_t off, size_t len)
{
int i = 0;
size_t po = off & ~PAGE_MASK;
size_t left = len;
while (left > 0) {
size_t l = min_t(size_t, PAGE_SIZE-po, left);
memcpy(data, page_address(pages[i]) + po, l);
data += l;
left -= l;
po += l;
if (po == PAGE_SIZE) {
po = 0;
i++;
}
}
}
EXPORT_SYMBOL(ceph_copy_from_page_vector);
/*
* Zero an extent within a page vector. Offset is relative to the
* start of the first page.
*/
void ceph_zero_page_vector_range(int off, int len, struct page **pages)
{
int i = off >> PAGE_SHIFT;
off &= ~PAGE_MASK;
dout("zero_page_vector_page %u~%u\n", off, len);
/* leading partial page? */
if (off) {
int end = min((int)PAGE_SIZE, off + len);
dout("zeroing %d %p head from %d\n", i, pages[i],
(int)off);
zero_user_segment(pages[i], off, end);
len -= (end - off);
i++;
}
while (len >= PAGE_SIZE) {
dout("zeroing %d %p len=%d\n", i, pages[i], len);
zero_user_segment(pages[i], 0, PAGE_SIZE);
len -= PAGE_SIZE;
i++;
}
/* trailing partial page? */
if (len) {
dout("zeroing %d %p tail to %d\n", i, pages[i], (int)len);
zero_user_segment(pages[i], 0, len);
}
}
EXPORT_SYMBOL(ceph_zero_page_vector_range);
Annotation
- Immediate include surface: `linux/ceph/ceph_debug.h`, `linux/module.h`, `linux/sched.h`, `linux/slab.h`, `linux/file.h`, `linux/namei.h`, `linux/writeback.h`, `linux/ceph/libceph.h`.
- Detected declarations: `function ceph_put_page_vector`, `function ceph_release_page_vector`, `function ceph_copy_from_page_vector`, `function ceph_zero_page_vector_range`, `export ceph_put_page_vector`, `export ceph_release_page_vector`, `export ceph_alloc_page_vector`, `export ceph_copy_from_page_vector`, `export ceph_zero_page_vector_range`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration 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.