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.

Dependency Surface

Detected Declarations

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

Implementation Notes