xref: /haiku/src/add-ons/kernel/file_systems/ntfs/ntfs.h (revision a1163de83ea633463a79de234b8742ee106531b2)
1 /*
2  * Copyright (c) 2006-2007 Troeglazov Gerasim (3dEyes**)
3  *
4  * This program/include file is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program/include file is distributed in the hope that it will be
10  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program (in the main directory of the Linux-NTFS
16  * distribution in the file COPYING); if not, write to the Free Software
17  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 
20 #ifndef _NTFS_H
21 #define _NTFS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <fs_interface.h>
28 #include <kernel/lock.h>
29 #include <fs_info.h>
30 #include <fs_cache.h>
31 #include <fs_attr.h>
32 #include <fs_info.h>
33 #include <fs_index.h>
34 #include <fs_query.h>
35 #include <fs_volume.h>
36 #include <NodeMonitor.h>
37 #include <util/kernel_cpp.h>
38 
39 #include "config.h"
40 #include "attrib.h"
41 #include "inode.h"
42 #include "volume.h"
43 #include "dir.h"
44 #include "unistr.h"
45 #include "layout.h"
46 #include "index.h"
47 #include "utils.h"
48 #include "ntfstime.h"
49 #include "misc.h"
50 #include "utils.h"
51 #include "bootsect.h"
52 
53 #include "lock.h"
54 #include "ntfsdir.h"
55 
56 #define  	ERRPRINT(...) ;
57 //#define 	ERRPRINT dprintf
58 
59 #define 	DEV_FD(dev)	(*(int *)dev->d_private)
60 
61 #define 	LOCK_VOL(vol) \
62 { \
63 if (vol == NULL) { \
64 	return EINVAL; \
65 } \
66 \
67 LOCK((vol)->vlock); \
68 }
69 
70 #define 	UNLOCK_VOL(vol) \
71 { \
72 UNLOCK((vol)->vlock); \
73 }
74 
75 typedef enum {
76 	NF_FreeClustersOutdate	= (1 << 0),  		// Information about amount of free clusters is outdated.
77 	NF_FreeMFTOutdate	= (1 << 1),  			//	Information about amount of	free MFT records is outdated.
78 } ntfs_state_bits;
79 
80 
81 typedef struct vnode
82 {
83 	u64			vnid;
84 	u64			parent_vnid;
85 	char 		*mime;
86 } vnode;
87 
88 typedef struct filecookie
89 {
90 	int	omode;
91 	off_t	last_size;
92 } filecookie;
93 
94 #define ntfs_mark_free_space_outdated(ns) (ns->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate));
95 
96 
97 
98 typedef struct nspace
99 {
100 	ntfs_volume	*ntvol;
101 	char		devicePath[MAX_PATH];
102 	dev_t		id;
103 	int			free_cluster_count;
104 	char		volumeLabel[MAX_PATH];
105 	ulong 		flags;
106 	int 		state;
107 	s64 		free_clusters;
108 	long 		free_mft;
109 	BOOL 		ro;
110 	BOOL 		show_sys_files;
111 	BOOL 		silent;
112 	BOOL 		force;
113 	BOOL 		debug;
114 	BOOL 		noatime;
115 	BOOL 		no_detach;
116 	lock		vlock;
117 } nspace;
118 
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 
125 #endif
126