fs/orangefs/orangefs-utils.c
Source file repositories/reference/linux-study-clean/fs/orangefs/orangefs-utils.c
File Facts
- System
- Linux kernel
- Corpus path
fs/orangefs/orangefs-utils.c- Extension
.c- Size
- 15713 bytes
- Lines
- 561
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hprotocol.horangefs-kernel.horangefs-dev-proto.horangefs-bufmap.h
Detected Declarations
function fsid_of_opfunction orangefs_inode_flagsfunction orangefs_inode_permsfunction copy_attributes_from_inodefunction orangefs_inode_typefunction orangefs_make_bad_inodefunction orangefs_inode_is_stalefunction orangefs_inode_getattrfunction orangefs_inode_check_changedfunction orangefs_inode_setattrfunction orangefs_normalize_to_errnofunction ORANGEFS_util_translate_mode
Annotated Snippet
switch (op->upcall.type) {
case ORANGEFS_VFS_OP_FILE_IO:
fsid = op->upcall.req.io.refn.fs_id;
break;
case ORANGEFS_VFS_OP_LOOKUP:
fsid = op->upcall.req.lookup.parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_CREATE:
fsid = op->upcall.req.create.parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_GETATTR:
fsid = op->upcall.req.getattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_REMOVE:
fsid = op->upcall.req.remove.parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_MKDIR:
fsid = op->upcall.req.mkdir.parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_READDIR:
fsid = op->upcall.req.readdir.refn.fs_id;
break;
case ORANGEFS_VFS_OP_SETATTR:
fsid = op->upcall.req.setattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_SYMLINK:
fsid = op->upcall.req.sym.parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_RENAME:
fsid = op->upcall.req.rename.old_parent_refn.fs_id;
break;
case ORANGEFS_VFS_OP_STATFS:
fsid = op->upcall.req.statfs.fs_id;
break;
case ORANGEFS_VFS_OP_TRUNCATE:
fsid = op->upcall.req.truncate.refn.fs_id;
break;
case ORANGEFS_VFS_OP_RA_FLUSH:
fsid = op->upcall.req.ra_cache_flush.refn.fs_id;
break;
case ORANGEFS_VFS_OP_FS_UMOUNT:
fsid = op->upcall.req.fs_umount.fs_id;
break;
case ORANGEFS_VFS_OP_GETXATTR:
fsid = op->upcall.req.getxattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_SETXATTR:
fsid = op->upcall.req.setxattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_LISTXATTR:
fsid = op->upcall.req.listxattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_REMOVEXATTR:
fsid = op->upcall.req.removexattr.refn.fs_id;
break;
case ORANGEFS_VFS_OP_FSYNC:
fsid = op->upcall.req.fsync.refn.fs_id;
break;
default:
break;
}
}
return fsid;
}
static int orangefs_inode_flags(struct ORANGEFS_sys_attr_s *attrs)
{
int flags = 0;
if (attrs->flags & ORANGEFS_IMMUTABLE_FL)
flags |= S_IMMUTABLE;
else
flags &= ~S_IMMUTABLE;
if (attrs->flags & ORANGEFS_APPEND_FL)
flags |= S_APPEND;
else
flags &= ~S_APPEND;
if (attrs->flags & ORANGEFS_NOATIME_FL)
flags |= S_NOATIME;
else
flags &= ~S_NOATIME;
return flags;
}
static int orangefs_inode_perms(struct ORANGEFS_sys_attr_s *attrs)
{
int perm_mode = 0;
if (attrs->perms & ORANGEFS_O_EXECUTE)
perm_mode |= S_IXOTH;
if (attrs->perms & ORANGEFS_O_WRITE)
Annotation
- Immediate include surface: `linux/kernel.h`, `protocol.h`, `orangefs-kernel.h`, `orangefs-dev-proto.h`, `orangefs-bufmap.h`.
- Detected declarations: `function fsid_of_op`, `function orangefs_inode_flags`, `function orangefs_inode_perms`, `function copy_attributes_from_inode`, `function orangefs_inode_type`, `function orangefs_make_bad_inode`, `function orangefs_inode_is_stale`, `function orangefs_inode_getattr`, `function orangefs_inode_check_changed`, `function orangefs_inode_setattr`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.