fs/xfs/xfs_dquot.h
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_dquot.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_dquot.h- Extension
.h- Size
- 6312 bytes
- Lines
- 244
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct xfs_mountstruct xfs_transstruct xfs_dquot_resstruct xfs_dquot_prestruct xfs_dquotfunction xfs_dquot_res_over_limitsfunction xfs_dqflockfunction xfs_dqflock_nowaitfunction xfs_dqfunlockfunction xfs_dquot_typefunction xfs_this_quota_onfunction xfs_dquot_is_enforcedfunction xfs_dquot_lowsp
Annotated Snippet
struct xfs_dquot_res {
/* Total resources allocated and reserved. */
xfs_qcnt_t reserved;
/* Total resources allocated. */
xfs_qcnt_t count;
/* Absolute and preferred limits. */
xfs_qcnt_t hardlimit;
xfs_qcnt_t softlimit;
/*
* For root dquots, this is the default grace period, in seconds.
* Otherwise, this is when the quota grace period expires,
* in seconds since the Unix epoch.
*/
time64_t timer;
};
static inline bool
xfs_dquot_res_over_limits(
const struct xfs_dquot_res *qres)
{
if ((qres->softlimit && qres->softlimit < qres->reserved) ||
(qres->hardlimit && qres->hardlimit < qres->reserved))
return true;
return false;
}
struct xfs_dquot_pre {
xfs_qcnt_t q_prealloc_lo_wmark;
xfs_qcnt_t q_prealloc_hi_wmark;
int64_t q_low_space[XFS_QLOWSP_MAX];
};
/*
* The incore dquot structure
*/
struct xfs_dquot {
struct list_head q_lru;
struct xfs_mount *q_mount;
xfs_dqtype_t q_type;
uint16_t q_flags;
xfs_dqid_t q_id;
struct lockref q_lockref;
int q_bufoffset;
xfs_daddr_t q_blkno;
xfs_fileoff_t q_fileoffset;
struct xfs_dquot_res q_blk; /* regular blocks */
struct xfs_dquot_res q_ino; /* inodes */
struct xfs_dquot_res q_rtb; /* realtime blocks */
struct xfs_dq_logitem q_logitem;
struct xfs_dquot_pre q_blk_prealloc;
struct xfs_dquot_pre q_rtb_prealloc;
struct mutex q_qlock;
struct completion q_flush;
atomic_t q_pincount;
struct wait_queue_head q_pinwait;
};
/*
* Lock hierarchy for q_qlock:
* XFS_QLOCK_NORMAL is the implicit default,
* XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
*/
enum {
XFS_QLOCK_NORMAL = 0,
XFS_QLOCK_NESTED,
};
/*
* Manage the q_flush completion queue embedded in the dquot. This completion
* queue synchronizes processes attempting to flush the in-core dquot back to
* disk.
*/
static inline void xfs_dqflock(struct xfs_dquot *dqp)
{
wait_for_completion(&dqp->q_flush);
}
static inline bool xfs_dqflock_nowait(struct xfs_dquot *dqp)
{
return try_wait_for_completion(&dqp->q_flush);
}
static inline void xfs_dqfunlock(struct xfs_dquot *dqp)
Annotation
- Detected declarations: `struct xfs_mount`, `struct xfs_trans`, `struct xfs_dquot_res`, `struct xfs_dquot_pre`, `struct xfs_dquot`, `function xfs_dquot_res_over_limits`, `function xfs_dqflock`, `function xfs_dqflock_nowait`, `function xfs_dqfunlock`, `function xfs_dquot_type`.
- 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.