fs/ocfs2/symlink.c
Source file repositories/reference/linux-study-clean/fs/ocfs2/symlink.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/symlink.c- Extension
.c- Size
- 2434 bytes
- Lines
- 91
- 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.
- 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/fs.hlinux/types.hlinux/slab.hlinux/pagemap.hlinux/namei.hcluster/masklog.hocfs2.halloc.hfile.hinode.hjournal.hsymlink.hxattr.hbuffer_head_io.h
Detected Declarations
function Copyright
Annotated Snippet
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/namei.h>
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "alloc.h"
#include "file.h"
#include "inode.h"
#include "journal.h"
#include "symlink.h"
#include "xattr.h"
#include "buffer_head_io.h"
static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
{
struct inode *inode = folio->mapping->host;
struct buffer_head *bh = NULL;
int status = ocfs2_read_inode_block(inode, &bh);
struct ocfs2_dinode *fe;
const char *link;
size_t len;
if (status < 0) {
mlog_errno(status);
goto out;
}
fe = (struct ocfs2_dinode *) bh->b_data;
link = (char *) fe->id2.i_symlink;
/* will be less than a page size */
len = strnlen(link, ocfs2_fast_symlink_chars(inode->i_sb));
memcpy_to_folio(folio, 0, link, len + 1);
out:
folio_end_read(folio, status == 0);
brelse(bh);
return status;
}
const struct address_space_operations ocfs2_fast_symlink_aops = {
.read_folio = ocfs2_fast_symlink_read_folio,
};
const struct inode_operations ocfs2_symlink_inode_operations = {
.get_link = page_get_link,
.getattr = ocfs2_getattr,
.setattr = ocfs2_setattr,
.listxattr = ocfs2_listxattr,
.fiemap = ocfs2_fiemap,
};
Annotation
- Immediate include surface: `linux/fs.h`, `linux/types.h`, `linux/slab.h`, `linux/pagemap.h`, `linux/namei.h`, `cluster/masklog.h`, `ocfs2.h`, `alloc.h`.
- Detected declarations: `function Copyright`.
- 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.