fs/xfs/xfs_pwork.h
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_pwork.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_pwork.h- Extension
.h- Size
- 1407 bytes
- Lines
- 60
- 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_pworkstruct xfs_mountstruct xfs_pwork_ctlstruct xfs_pworkfunction xfs_pwork_ctl_want_abortfunction xfs_pwork_want_abort
Annotated Snippet
struct xfs_pwork_ctl {
struct workqueue_struct *wq;
struct xfs_mount *mp;
xfs_pwork_work_fn work_fn;
struct wait_queue_head poll_wait;
atomic_t nr_work;
int error;
};
/*
* Embed this parallel work control item inside your own work structure,
* then queue work with it.
*/
struct xfs_pwork {
struct work_struct work;
struct xfs_pwork_ctl *pctl;
};
#define XFS_PWORK_SINGLE_THREADED { .pctl = NULL }
/* Have we been told to abort? */
static inline bool
xfs_pwork_ctl_want_abort(
struct xfs_pwork_ctl *pctl)
{
return pctl && pctl->error;
}
/* Have we been told to abort? */
static inline bool
xfs_pwork_want_abort(
struct xfs_pwork *pwork)
{
return xfs_pwork_ctl_want_abort(pwork->pctl);
}
int xfs_pwork_init(struct xfs_mount *mp, struct xfs_pwork_ctl *pctl,
xfs_pwork_work_fn work_fn, const char *tag);
void xfs_pwork_queue(struct xfs_pwork_ctl *pctl, struct xfs_pwork *pwork);
int xfs_pwork_destroy(struct xfs_pwork_ctl *pctl);
void xfs_pwork_poll(struct xfs_pwork_ctl *pctl);
#endif /* __XFS_PWORK_H__ */
Annotation
- Detected declarations: `struct xfs_pwork`, `struct xfs_mount`, `struct xfs_pwork_ctl`, `struct xfs_pwork`, `function xfs_pwork_ctl_want_abort`, `function xfs_pwork_want_abort`.
- 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.