fs/xfs/xfs_qm_bhv.c
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_qm_bhv.c
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_qm_bhv.c- Extension
.c- Size
- 4819 bytes
- Lines
- 193
- 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
xfs_platform.hxfs_fs.hxfs_shared.hxfs_format.hxfs_log_format.hxfs_trans_resv.hxfs_mount.hxfs_quota.hxfs_inode.hxfs_trans.hxfs_qm.h
Detected Declarations
function Copyrightfunction statvfsfunction xfs_qm_validate_state_changefunction xfs_qm_newmountfunction xfs_qm_resume_quotaon
Annotated Snippet
if (quotaondisk && !XFS_QM_NEED_QUOTACHECK(mp)) {
/*
* If an error occurred, qm_mount_quotas code
* has already disabled quotas. So, just finish
* mounting, and get on with the boring life
* without disk quotas.
*/
xfs_qm_mount_quotas(mp);
} else {
/*
* Clear the quota flags, but remember them. This
* is so that the quota code doesn't get invoked
* before we're ready. This can happen when an
* inode goes inactive and wants to free blocks,
* or via xfs_log_mount_finish.
*/
*needquotamount = true;
*quotaflags = mp->m_qflags;
mp->m_qflags = 0;
}
}
return 0;
}
/*
* If the sysadmin didn't provide any quota mount options, restore the quota
* accounting and enforcement state from the ondisk superblock. Only do this
* for metadir filesystems because this is a behavior change.
*/
void
xfs_qm_resume_quotaon(
struct xfs_mount *mp)
{
if (!xfs_has_metadir(mp))
return;
if (xfs_has_norecovery(mp))
return;
mp->m_qflags = mp->m_sb.sb_qflags & (XFS_ALL_QUOTA_ACCT |
XFS_ALL_QUOTA_ENFD);
}
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_quota.h`.
- Detected declarations: `function Copyright`, `function statvfs`, `function xfs_qm_validate_state_change`, `function xfs_qm_newmount`, `function xfs_qm_resume_quotaon`.
- 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.