fs/xfs/xfs_iops.c
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_iops.c
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_iops.c- Extension
.c- Size
- 40064 bytes
- Lines
- 1515
- 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.
- 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
xfs_platform.hxfs_fs.hxfs_shared.hxfs_format.hxfs_log_format.hxfs_trans_resv.hxfs_mount.hxfs_inode.hxfs_acl.hxfs_quota.hxfs_da_format.hxfs_da_btree.hxfs_attr.hxfs_trans.hxfs_trans_space.hxfs_bmap_btree.hxfs_trace.hxfs_icache.hxfs_symlink.hxfs_dir2.hxfs_iomap.hxfs_error.hxfs_ioctl.hxfs_xattr.hxfs_file.hxfs_bmap.hxfs_zone_alloc.hlinux/posix_acl.hlinux/security.hlinux/iversion.hlinux/fiemap.h
Detected Declarations
function xfs_initxattrsfunction herefunction xfs_dentry_to_namefunction xfs_dentry_mode_to_namefunction xfs_cleanup_inodefunction herefunction offunction xfs_vn_mknodfunction xfs_vn_createfunction xfs_vn_mkdirfunction xfs_vn_lookupfunction xfs_vn_ci_lookupfunction xfs_vn_linkfunction xfs_vn_unlinkfunction xfs_vn_symlinkfunction xfs_vn_renamefunction xfs_vn_get_linkfunction xfs_stat_blksizefunction xfs_report_dioalignfunction xfs_get_atomic_write_minfunction xfs_get_atomic_write_maxfunction xfs_get_atomic_write_max_optfunction xfs_report_atomic_writefunction xfs_vn_getattrfunction xfs_vn_change_okfunction setattr_preparefunction i_uid_needs_updatefunction i_gid_needs_updatefunction XXXfunction xfs_vn_setattr_sizefunction truncatefunction xfs_vn_setattrfunction xfs_vn_update_timefunction xfs_vn_sync_lazytimefunction xfs_vn_fiemapfunction xfs_vn_tmpfilefunction xfs_inode_supports_daxfunction xfs_inode_should_enable_daxfunction xfs_diflags_to_iflagsfunction xfs_setup_inodefunction xfs_setup_iops
Annotated Snippet
if (request_mask & STATX_BTIME) {
stat->result_mask |= STATX_BTIME;
stat->btime = ip->i_crtime;
}
}
/*
* Note: If you add another clause to set an attribute flag, please
* update attributes_mask below.
*/
if (ip->i_diflags & XFS_DIFLAG_IMMUTABLE)
stat->attributes |= STATX_ATTR_IMMUTABLE;
if (ip->i_diflags & XFS_DIFLAG_APPEND)
stat->attributes |= STATX_ATTR_APPEND;
if (ip->i_diflags & XFS_DIFLAG_NODUMP)
stat->attributes |= STATX_ATTR_NODUMP;
stat->attributes_mask |= (STATX_ATTR_IMMUTABLE |
STATX_ATTR_APPEND |
STATX_ATTR_NODUMP);
switch (inode->i_mode & S_IFMT) {
case S_IFBLK:
case S_IFCHR:
stat->blksize = BLKDEV_IOSIZE;
stat->rdev = inode->i_rdev;
break;
case S_IFREG:
if (request_mask & (STATX_DIOALIGN | STATX_DIO_READ_ALIGN))
xfs_report_dioalign(ip, stat);
if (request_mask & STATX_WRITE_ATOMIC)
xfs_report_atomic_write(ip, stat);
fallthrough;
default:
stat->blksize = xfs_stat_blksize(ip);
stat->rdev = 0;
break;
}
return 0;
}
static int
xfs_vn_change_ok(
struct mnt_idmap *idmap,
struct dentry *dentry,
struct iattr *iattr)
{
struct xfs_mount *mp = XFS_I(d_inode(dentry))->i_mount;
if (xfs_is_readonly(mp))
return -EROFS;
if (xfs_is_shutdown(mp))
return -EIO;
return setattr_prepare(idmap, dentry, iattr);
}
/*
* Set non-size attributes of an inode.
*
* Caution: The caller of this function is responsible for calling
* setattr_prepare() or otherwise verifying the change is fine.
*/
static int
xfs_setattr_nonsize(
struct mnt_idmap *idmap,
struct dentry *dentry,
struct xfs_inode *ip,
struct iattr *iattr)
{
xfs_mount_t *mp = ip->i_mount;
struct inode *inode = VFS_I(ip);
int mask = iattr->ia_valid;
xfs_trans_t *tp;
int error;
kuid_t uid = GLOBAL_ROOT_UID;
kgid_t gid = GLOBAL_ROOT_GID;
struct xfs_dquot *udqp = NULL, *gdqp = NULL;
struct xfs_dquot *old_udqp = NULL, *old_gdqp = NULL;
ASSERT((mask & ATTR_SIZE) == 0);
/*
* If disk quotas is on, we make sure that the dquots do exist on disk,
* before we start any other transactions. Trying to do this later
* is messy. We don't care to take a readlock to look at the ids
* in inode here, because we can't hold it across the trans_reserve.
* If the IDs do change before we take the ilock, we're covered
Annotation
- Immediate include surface: `xfs_platform.h`, `xfs_fs.h`, `xfs_shared.h`, `xfs_format.h`, `xfs_log_format.h`, `xfs_trans_resv.h`, `xfs_mount.h`, `xfs_inode.h`.
- Detected declarations: `function xfs_initxattrs`, `function here`, `function xfs_dentry_to_name`, `function xfs_dentry_mode_to_name`, `function xfs_cleanup_inode`, `function here`, `function of`, `function xfs_vn_mknod`, `function xfs_vn_create`, `function xfs_vn_mkdir`.
- 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.