include/linux/dax.h
Source file repositories/reference/linux-study-clean/include/linux/dax.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/dax.h- Extension
.h- Size
- 10269 bytes
- Lines
- 326
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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.
- 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
linux/fs.hlinux/mm.hlinux/radix-tree.h
Detected Declarations
struct dax_devicestruct gendiskstruct iomap_opsstruct iomap_iterstruct iomapstruct dax_operationsstruct dax_holder_operationsstruct writeback_controlenum dax_access_modefunction daxdev_mapping_supportedfunction put_daxfunction dax_synchronousfunction set_dax_nocachefunction dax_recovery_writefunction dax_add_hostfunction dax_remove_hostfunction fs_put_daxfunction dax_writeback_mapping_rangefunction dax_lock_foliofunction dax_unlock_foliofunction dax_unlock_mapping_entryfunction dax_page_is_idlefunction dax_read_lockfunction dax_read_unlockfunction dax_break_layout_finalfunction dax_break_layout_inodefunction dax_mappingfunction dax_mem2blk_errfunction hmem_register_resource
Annotated Snippet
struct dax_operations {
/*
* direct_access: translate a device-relative
* logical-page-offset into an absolute physical pfn. Return the
* number of pages available for DAX at that pfn.
*/
long (*direct_access)(struct dax_device *, pgoff_t, long,
enum dax_access_mode, void **, unsigned long *);
/* zero_page_range: required operation. Zero page range */
int (*zero_page_range)(struct dax_device *, pgoff_t, size_t);
/*
* recovery_write: recover a poisoned range by DAX device driver
* capable of clearing poison.
*/
size_t (*recovery_write)(struct dax_device *dax_dev, pgoff_t pgoff,
void *addr, size_t bytes, struct iov_iter *iter);
};
struct dax_holder_operations {
/*
* notify_failure - notify memory failure into inner holder device
* @dax_dev: the dax device which contains the holder
* @offset: offset on this dax device where memory failure occurs
* @len: length of this memory failure event
* @flags: action flags for memory failure handler
*/
int (*notify_failure)(struct dax_device *dax_dev, u64 offset,
u64 len, int mf_flags);
};
#if IS_ENABLED(CONFIG_DAX)
struct dax_device *alloc_dax(void *private, const struct dax_operations *ops);
void *dax_holder(struct dax_device *dax_dev);
void put_dax(struct dax_device *dax_dev);
void kill_dax(struct dax_device *dax_dev);
struct dax_device *dax_dev_get(dev_t devt);
void dax_write_cache(struct dax_device *dax_dev, bool wc);
bool dax_write_cache_enabled(struct dax_device *dax_dev);
bool dax_synchronous(struct dax_device *dax_dev);
void set_dax_nocache(struct dax_device *dax_dev);
void set_dax_nomc(struct dax_device *dax_dev);
void set_dax_synchronous(struct dax_device *dax_dev);
size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff,
void *addr, size_t bytes, struct iov_iter *i);
/*
* Check if given mapping is supported by the file / underlying device.
*/
static inline bool daxdev_mapping_supported(const struct vm_area_desc *desc,
const struct inode *inode,
struct dax_device *dax_dev)
{
if (!vma_desc_test(desc, VMA_SYNC_BIT))
return true;
if (!IS_DAX(inode))
return false;
return dax_synchronous(dax_dev);
}
#else
static inline void *dax_holder(struct dax_device *dax_dev)
{
return NULL;
}
static inline struct dax_device *alloc_dax(void *private,
const struct dax_operations *ops)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline void put_dax(struct dax_device *dax_dev)
{
}
static inline void kill_dax(struct dax_device *dax_dev)
{
}
static inline void dax_write_cache(struct dax_device *dax_dev, bool wc)
{
}
static inline bool dax_write_cache_enabled(struct dax_device *dax_dev)
{
return false;
}
static inline bool dax_synchronous(struct dax_device *dax_dev)
{
return true;
}
static inline void set_dax_nocache(struct dax_device *dax_dev)
{
}
static inline void set_dax_nomc(struct dax_device *dax_dev)
{
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/mm.h`, `linux/radix-tree.h`.
- Detected declarations: `struct dax_device`, `struct gendisk`, `struct iomap_ops`, `struct iomap_iter`, `struct iomap`, `struct dax_operations`, `struct dax_holder_operations`, `struct writeback_control`, `enum dax_access_mode`, `function daxdev_mapping_supported`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
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.