1
2
3
4
5
6
7
8
9#ifndef _LINUX_NTFS_MFT_H
10#define _LINUX_NTFS_MFT_H
11
12#include <linux/fs.h>
13#include <linux/highmem.h>
14#include <linux/pagemap.h>
15
16#include "inode.h"
17
18extern MFT_RECORD *map_mft_record(ntfs_inode *ni);
19extern void unmap_mft_record(ntfs_inode *ni);
20
21extern MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
22 ntfs_inode **ntfs_ino);
23
24static inline void unmap_extent_mft_record(ntfs_inode *ni)
25{
26 unmap_mft_record(ni);
27 return;
28}
29
30#ifdef NTFS_RW
31
32
33
34
35
36
37
38
39
40
41static inline void flush_dcache_mft_record_page(ntfs_inode *ni)
42{
43 flush_dcache_page(ni->page);
44}
45
46extern void __mark_mft_record_dirty(ntfs_inode *ni);
47
48
49
50
51
52
53
54
55
56
57
58
59static inline void mark_mft_record_dirty(ntfs_inode *ni)
60{
61 if (!NInoTestSetDirty(ni))
62 __mark_mft_record_dirty(ni);
63}
64
65extern int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no,
66 MFT_RECORD *m, int sync);
67
68extern int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync);
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88static inline int write_mft_record(ntfs_inode *ni, MFT_RECORD *m, int sync)
89{
90 struct page *page = ni->page;
91 int err;
92
93 BUG_ON(!page);
94 lock_page(page);
95 err = write_mft_record_nolock(ni, m, sync);
96 unlock_page(page);
97 return err;
98}
99
100extern bool ntfs_may_write_mft_record(ntfs_volume *vol,
101 const unsigned long mft_no, const MFT_RECORD *m,
102 ntfs_inode **locked_ni);
103
104extern ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
105 ntfs_inode *base_ni, MFT_RECORD **mrec);
106extern int ntfs_extent_mft_record_free(ntfs_inode *ni, MFT_RECORD *m);
107
108#endif
109
110#endif
111