fs/adfs/dir_f.c
Source file repositories/reference/linux-study-clean/fs/adfs/dir_f.c
File Facts
- System
- Linux kernel
- Corpus path
fs/adfs/dir_f.c- Extension
.c- Size
- 7330 bytes
- Lines
- 325
- 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_f.h
Detected Declarations
function Copyrightfunction adfs_writevalfunction adfs_dir_checkbytefunction adfs_f_validatefunction adfs_f_readfunction adfs_dir2objfunction adfs_obj2dirfunction __adfs_dir_getfunction adfs_f_setposfunction adfs_f_getnextfunction adfs_f_iteratefunction adfs_f_updatefunction adfs_f_commit
Annotated Snippet
if (ret) {
adfs_error(dir->sb, "error reading directory entry");
return -ENOENT;
}
if (!de.dirobname[0]) {
adfs_error(dir->sb, "unable to locate entry to update");
return -ENOENT;
}
} while (adfs_readval(de.dirinddiscadd, 3) != obj->indaddr);
/* Update the directory entry with the new object state */
adfs_obj2dir(&de, obj);
/* Write the directory entry back to the directory */
return adfs_dir_copyto(dir, offset, &de, 26);
}
static int adfs_f_commit(struct adfs_dir *dir)
{
int ret;
/* Increment directory sequence number */
dir->dirhead->startmasseq += 1;
dir->newtail->endmasseq += 1;
/* Update directory check byte */
dir->newtail->dircheckbyte = adfs_dir_checkbyte(dir);
/* Make sure the directory still validates correctly */
ret = adfs_f_validate(dir);
if (ret)
adfs_msg(dir->sb, KERN_ERR, "error: update broke directory");
return ret;
}
const struct adfs_dir_ops adfs_f_dir_ops = {
.read = adfs_f_read,
.iterate = adfs_f_iterate,
.setpos = adfs_f_setpos,
.getnext = adfs_f_getnext,
.update = adfs_f_update,
.commit = adfs_f_commit,
};
Annotation
- Immediate include surface: `adfs.h`, `dir_f.h`.
- Detected declarations: `function Copyright`, `function adfs_writeval`, `function adfs_dir_checkbyte`, `function adfs_f_validate`, `function adfs_f_read`, `function adfs_dir2obj`, `function adfs_obj2dir`, `function __adfs_dir_get`, `function adfs_f_setpos`, `function adfs_f_getnext`.
- 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.