0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LINUX_NTFS_MFT_H
0010 #define _LINUX_NTFS_MFT_H
0011
0012 #include <linux/fs.h>
0013 #include <linux/highmem.h>
0014 #include <linux/pagemap.h>
0015
0016 #include "inode.h"
0017
0018 extern MFT_RECORD *map_mft_record(ntfs_inode *ni);
0019 extern void unmap_mft_record(ntfs_inode *ni);
0020
0021 extern MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
0022 ntfs_inode **ntfs_ino);
0023
0024 static inline void unmap_extent_mft_record(ntfs_inode *ni)
0025 {
0026 unmap_mft_record(ni);
0027 return;
0028 }
0029
0030 #ifdef NTFS_RW
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 static inline void flush_dcache_mft_record_page(ntfs_inode *ni)
0042 {
0043 flush_dcache_page(ni->page);
0044 }
0045
0046 extern void __mark_mft_record_dirty(ntfs_inode *ni);
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 static inline void mark_mft_record_dirty(ntfs_inode *ni)
0060 {
0061 if (!NInoTestSetDirty(ni))
0062 __mark_mft_record_dirty(ni);
0063 }
0064
0065 extern int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no,
0066 MFT_RECORD *m, int sync);
0067
0068 extern int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync);
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 static inline int write_mft_record(ntfs_inode *ni, MFT_RECORD *m, int sync)
0089 {
0090 struct page *page = ni->page;
0091 int err;
0092
0093 BUG_ON(!page);
0094 lock_page(page);
0095 err = write_mft_record_nolock(ni, m, sync);
0096 unlock_page(page);
0097 return err;
0098 }
0099
0100 extern bool ntfs_may_write_mft_record(ntfs_volume *vol,
0101 const unsigned long mft_no, const MFT_RECORD *m,
0102 ntfs_inode **locked_ni);
0103
0104 extern ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode,
0105 ntfs_inode *base_ni, MFT_RECORD **mrec);
0106 extern int ntfs_extent_mft_record_free(ntfs_inode *ni, MFT_RECORD *m);
0107
0108 #endif
0109
0110 #endif