fs/ntfs/mft.h
Source file repositories/reference/linux-study-clean/fs/ntfs/mft.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs/mft.h- Extension
.h- Size
- 3076 bytes
- Lines
- 92
- 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.
- 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/highmem.hlinux/pagemap.hinode.h
Detected Declarations
function unmap_extent_mft_recordfunction mappedfunction write_mft_record_nolock
Annotated Snippet
#ifndef _LINUX_NTFS_MFT_H
#define _LINUX_NTFS_MFT_H
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include "inode.h"
struct mft_record *map_mft_record(struct ntfs_inode *ni);
void unmap_mft_record(struct ntfs_inode *ni);
struct mft_record *map_extent_mft_record(struct ntfs_inode *base_ni, u64 mref,
struct ntfs_inode **ntfs_ino);
static inline void unmap_extent_mft_record(struct ntfs_inode *ni)
{
unmap_mft_record(ni);
}
void __mark_mft_record_dirty(struct ntfs_inode *ni);
/*
* mark_mft_record_dirty - set the mft record and the page containing it dirty
* @ni: ntfs inode describing the mapped mft record
*
* Set the mapped (extent) mft record of the (base or extent) ntfs inode @ni,
* as well as the page containing the mft record, dirty. Also, mark the base
* vfs inode dirty. This ensures that any changes to the mft record are
* written out to disk.
*
* NOTE: Do not do anything if the mft record is already marked dirty.
*/
static inline void mark_mft_record_dirty(struct ntfs_inode *ni)
{
if (!NInoTestSetDirty(ni))
__mark_mft_record_dirty(ni);
}
int ntfs_sync_mft_mirror(struct ntfs_volume *vol, const u64 mft_no,
struct mft_record *m);
int write_mft_record_nolock(struct ntfs_inode *ni, struct mft_record *m, int sync);
/*
* write_mft_record - write out a mapped (extent) mft record
* @ni: ntfs inode describing the mapped (extent) mft record
* @m: mapped (extent) mft record to write
* @sync: if true, wait for i/o completion
*
* This is just a wrapper for write_mft_record_nolock() (see mft.c), which
* locks the page for the duration of the write. This ensures that there are
* no race conditions between writing the mft record via the dirty inode code
* paths and via the page cache write back code paths or between writing
* neighbouring mft records residing in the same page.
*
* Locking the page also serializes us against ->read_folio() if the page is not
* uptodate.
*
* On success, clean the mft record and return 0. On error, leave the mft
* record dirty and return -errno.
*/
static inline int write_mft_record(struct ntfs_inode *ni, struct mft_record *m, int sync)
{
struct folio *folio = ni->folio;
int err;
folio_lock(folio);
err = write_mft_record_nolock(ni, m, sync);
folio_unlock(folio);
return err;
}
int ntfs_mft_record_alloc(struct ntfs_volume *vol, const int mode,
struct ntfs_inode **ni, struct ntfs_inode *base_ni,
struct mft_record **ni_mrec);
int ntfs_mft_record_free(struct ntfs_volume *vol, struct ntfs_inode *ni);
int ntfs_mft_records_write(const struct ntfs_volume *vol, const u64 mref,
const s64 count, struct mft_record *b);
int ntfs_mft_record_check(const struct ntfs_volume *vol, struct mft_record *m,
u64 mft_no);
int ntfs_mft_writepages(struct address_space *mapping,
struct writeback_control *wbc);
void ntfs_mft_mark_dirty(struct folio *folio);
#endif /* _LINUX_NTFS_MFT_H */
Annotation
- Immediate include surface: `linux/highmem.h`, `linux/pagemap.h`, `inode.h`.
- Detected declarations: `function unmap_extent_mft_record`, `function mapped`, `function write_mft_record_nolock`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.