fs/adfs/dir_fplus.c
Source file repositories/reference/linux-study-clean/fs/adfs/dir_fplus.c
File Facts
- System
- Linux kernel
- Corpus path
fs/adfs/dir_fplus.c- Extension
.c- Size
- 7249 bytes
- Lines
- 288
- 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
adfs.hdir_fplus.h
Detected Declarations
function Copyrightfunction adfs_fplus_validate_headerfunction adfs_fplus_validate_tailfunction adfs_fplus_checkbytefunction adfs_fplus_readfunction adfs_fplus_setposfunction adfs_fplus_getnextfunction adfs_fplus_iteratefunction adfs_fplus_updatefunction adfs_fplus_commit
Annotated Snippet
if (offset >= end) {
adfs_error(dir->sb, "unable to locate entry to update");
return -ENOENT;
}
ret = adfs_dir_copyfrom(&bde, dir, offset, sizeof(bde));
if (ret) {
adfs_error(dir->sb, "error reading directory entry");
return -ENOENT;
}
} while (le32_to_cpu(bde.bigdirindaddr) != obj->indaddr);
bde.bigdirload = cpu_to_le32(obj->loadaddr);
bde.bigdirexec = cpu_to_le32(obj->execaddr);
bde.bigdirlen = cpu_to_le32(obj->size);
bde.bigdirindaddr = cpu_to_le32(obj->indaddr);
bde.bigdirattr = cpu_to_le32(obj->attr);
return adfs_dir_copyto(dir, offset, &bde, sizeof(bde));
}
static int adfs_fplus_commit(struct adfs_dir *dir)
{
int ret;
/* Increment directory sequence number */
dir->bighead->startmasseq += 1;
dir->bigtail->bigdirendmasseq += 1;
/* Update directory check byte */
dir->bigtail->bigdircheckbyte = adfs_fplus_checkbyte(dir);
/* Make sure the directory still validates correctly */
ret = adfs_fplus_validate_header(dir->bighead);
if (ret == 0)
ret = adfs_fplus_validate_tail(dir->bighead, dir->bigtail);
return ret;
}
const struct adfs_dir_ops adfs_fplus_dir_ops = {
.read = adfs_fplus_read,
.iterate = adfs_fplus_iterate,
.setpos = adfs_fplus_setpos,
.getnext = adfs_fplus_getnext,
.update = adfs_fplus_update,
.commit = adfs_fplus_commit,
};
Annotation
- Immediate include surface: `adfs.h`, `dir_fplus.h`.
- Detected declarations: `function Copyright`, `function adfs_fplus_validate_header`, `function adfs_fplus_validate_tail`, `function adfs_fplus_checkbyte`, `function adfs_fplus_read`, `function adfs_fplus_setpos`, `function adfs_fplus_getnext`, `function adfs_fplus_iterate`, `function adfs_fplus_update`, `function adfs_fplus_commit`.
- 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.