ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / fs / ntfs / mft.h
1 /*
2  * mft.h - Defines for mft record handling in NTFS Linux kernel driver.
3  *         Part of the Linux-NTFS project.
4  *
5  * Copyright (c) 2001-2004 Anton Altaparmakov.
6  *
7  * This program/include file is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as published
9  * by the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program/include file is distributed in the hope that it will be
13  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program (in the main directory of the Linux-NTFS
19  * distribution in the file COPYING); if not, write to the Free Software
20  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef _LINUX_NTFS_MFT_H
24 #define _LINUX_NTFS_MFT_H
25
26 #include <linux/fs.h>
27
28 #include "inode.h"
29
30 extern int format_mft_record(ntfs_inode *ni, MFT_RECORD *m);
31 //extern int format_mft_record2(struct super_block *vfs_sb,
32 //              const unsigned long inum, MFT_RECORD *m);
33
34 extern MFT_RECORD *map_mft_record(ntfs_inode *ni);
35 extern void unmap_mft_record(ntfs_inode *ni);
36
37 extern MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
38                 ntfs_inode **ntfs_ino);
39
40 static inline void unmap_extent_mft_record(ntfs_inode *ni)
41 {
42         unmap_mft_record(ni);
43         return;
44 }
45
46 #ifdef NTFS_RW
47
48 /**
49  * flush_dcache_mft_record_page - flush_dcache_page() for mft records
50  * @ni:         ntfs inode structure of mft record
51  *
52  * Call flush_dcache_page() for the page in which an mft record resides.
53  *
54  * This must be called every time an mft record is modified, just after the
55  * modification.
56  */
57 static inline void flush_dcache_mft_record_page(ntfs_inode *ni)
58 {
59         flush_dcache_page(ni->page);
60 }
61
62 #endif /* NTFS_RW */
63
64 #endif /* _LINUX_NTFS_MFT_H */