fs/qnx4/namei.c
Source file repositories/reference/linux-study-clean/fs/qnx4/namei.c
File Facts
- System
- Linux kernel
- Corpus path
fs/qnx4/namei.c- Extension
.c- Size
- 2884 bytes
- Lines
- 116
- 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
linux/buffer_head.hqnx4.h
Detected Declarations
function qnx4_matchfunction qnx4_lookup
Annotated Snippet
if (!bh) {
block = qnx4_block_map(dir, blkofs);
if (block)
bh = sb_bread(dir->i_sb, block);
if (!bh) {
blkofs++;
continue;
}
}
*res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset);
if (qnx4_match(len, name, bh, &offset)) {
*ino = block * QNX4_INODES_PER_BLOCK +
(offset / QNX4_DIR_ENTRY_SIZE) - 1;
return bh;
}
if (offset < bh->b_size) {
continue;
}
brelse(bh);
bh = NULL;
offset = 0;
blkofs++;
}
brelse(bh);
*res_dir = NULL;
return NULL;
}
struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
int ino;
struct qnx4_inode_entry *de;
struct qnx4_link_info *lnk;
struct buffer_head *bh;
const char *name = dentry->d_name.name;
int len = dentry->d_name.len;
struct inode *foundinode = NULL;
if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino)))
goto out;
/* The entry is linked, let's get the real info */
if ((de->di_status & QNX4_FILE_LINK) == QNX4_FILE_LINK) {
lnk = (struct qnx4_link_info *) de;
ino = (le32_to_cpu(lnk->dl_inode_blk) - 1) *
QNX4_INODES_PER_BLOCK +
lnk->dl_inode_ndx;
}
brelse(bh);
foundinode = qnx4_iget(dir->i_sb, ino);
if (IS_ERR(foundinode))
QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n",
PTR_ERR(foundinode)));
out:
return d_splice_alias(foundinode, dentry);
}
Annotation
- Immediate include surface: `linux/buffer_head.h`, `qnx4.h`.
- Detected declarations: `function qnx4_match`, `function qnx4_lookup`.
- 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.