volume.h (c1b054d03f5b31c33eaa0b267c629b118eaf3790) volume.h (1cf3109ffb26a6ea572fd02436bd10458b4b2187)
1/*
2 * volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
3 * of the Linux-NTFS project.
4 *
1/*
2 * volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
3 * of the Linux-NTFS project.
4 *
5 * Copyright (c) 2001-2005 Anton Altaparmakov
5 * Copyright (c) 2001-2006 Anton Altaparmakov
6 * Copyright (c) 2002 Richard Russon
7 *
8 * This program/include file is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as published
10 * by the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program/include file is distributed in the hope that it will be

--- 22 unchanged lines hidden (view full) ---

36 /*
37 * FIXME: Reorder to have commonly used together element within the
38 * same cache line, aiming at a cache line size of 32 bytes. Aim for
39 * 64 bytes for less commonly used together elements. Put most commonly
40 * used elements to front of structure. Obviously do this only when the
41 * structure has stabilized... (AIA)
42 */
43 /* Device specifics. */
6 * Copyright (c) 2002 Richard Russon
7 *
8 * This program/include file is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as published
10 * by the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program/include file is distributed in the hope that it will be

--- 22 unchanged lines hidden (view full) ---

36 /*
37 * FIXME: Reorder to have commonly used together element within the
38 * same cache line, aiming at a cache line size of 32 bytes. Aim for
39 * 64 bytes for less commonly used together elements. Put most commonly
40 * used elements to front of structure. Obviously do this only when the
41 * structure has stabilized... (AIA)
42 */
43 /* Device specifics. */
44 struct super_block *sb; /* Pointer back to the super_block,
45 so we don't have to get the offset
46 every time. */
47 LCN nr_blocks; /* Number of NTFS_BLOCK_SIZE bytes
44 struct super_block *sb; /* Pointer back to the super_block. */
45 LCN nr_blocks; /* Number of sb->s_blocksize bytes
48 sized blocks on the device. */
49 /* Configuration provided by user at mount time. */
50 unsigned long flags; /* Miscellaneous flags, see below. */
51 uid_t uid; /* uid that files will be mounted as. */
52 gid_t gid; /* gid that files will be mounted as. */
53 mode_t fmask; /* The mask for file permissions. */
54 mode_t dmask; /* The mask for directory
55 permissions. */

--- 80 unchanged lines hidden (view full) ---

136/*
137 * Defined bits for the flags field in the ntfs_volume structure.
138 */
139typedef enum {
140 NV_Errors, /* 1: Volume has errors, prevent remount rw. */
141 NV_ShowSystemFiles, /* 1: Return system files in ntfs_readdir(). */
142 NV_CaseSensitive, /* 1: Treat file names as case sensitive and
143 create filenames in the POSIX namespace.
46 sized blocks on the device. */
47 /* Configuration provided by user at mount time. */
48 unsigned long flags; /* Miscellaneous flags, see below. */
49 uid_t uid; /* uid that files will be mounted as. */
50 gid_t gid; /* gid that files will be mounted as. */
51 mode_t fmask; /* The mask for file permissions. */
52 mode_t dmask; /* The mask for directory
53 permissions. */

--- 80 unchanged lines hidden (view full) ---

134/*
135 * Defined bits for the flags field in the ntfs_volume structure.
136 */
137typedef enum {
138 NV_Errors, /* 1: Volume has errors, prevent remount rw. */
139 NV_ShowSystemFiles, /* 1: Return system files in ntfs_readdir(). */
140 NV_CaseSensitive, /* 1: Treat file names as case sensitive and
141 create filenames in the POSIX namespace.
144 Otherwise be case insensitive and create
145 file names in WIN32 namespace. */
142 Otherwise be case insensitive but still
143 create file names in POSIX namespace. */
146 NV_LogFileEmpty, /* 1: $LogFile journal is empty. */
147 NV_QuotaOutOfDate, /* 1: $Quota is out of date. */
148 NV_UsnJrnlStamped, /* 1: $UsnJrnl has been stamped. */
149 NV_SparseEnabled, /* 1: May create sparse files. */
150} ntfs_volume_flags;
151
152/*
153 * Macro tricks to expand the NVolFoo(), NVolSetFoo(), and NVolClearFoo()
154 * functions.
155 */
144 NV_LogFileEmpty, /* 1: $LogFile journal is empty. */
145 NV_QuotaOutOfDate, /* 1: $Quota is out of date. */
146 NV_UsnJrnlStamped, /* 1: $UsnJrnl has been stamped. */
147 NV_SparseEnabled, /* 1: May create sparse files. */
148} ntfs_volume_flags;
149
150/*
151 * Macro tricks to expand the NVolFoo(), NVolSetFoo(), and NVolClearFoo()
152 * functions.
153 */
156#define NVOL_FNS(flag) \
154#define DEFINE_NVOL_BIT_OPS(flag) \
157static inline int NVol##flag(ntfs_volume *vol) \
158{ \
159 return test_bit(NV_##flag, &(vol)->flags); \
160} \
161static inline void NVolSet##flag(ntfs_volume *vol) \
162{ \
163 set_bit(NV_##flag, &(vol)->flags); \
164} \
165static inline void NVolClear##flag(ntfs_volume *vol) \
166{ \
167 clear_bit(NV_##flag, &(vol)->flags); \
168}
169
170/* Emit the ntfs volume bitops functions. */
155static inline int NVol##flag(ntfs_volume *vol) \
156{ \
157 return test_bit(NV_##flag, &(vol)->flags); \
158} \
159static inline void NVolSet##flag(ntfs_volume *vol) \
160{ \
161 set_bit(NV_##flag, &(vol)->flags); \
162} \
163static inline void NVolClear##flag(ntfs_volume *vol) \
164{ \
165 clear_bit(NV_##flag, &(vol)->flags); \
166}
167
168/* Emit the ntfs volume bitops functions. */
171NVOL_FNS(Errors)
172NVOL_FNS(ShowSystemFiles)
173NVOL_FNS(CaseSensitive)
174NVOL_FNS(LogFileEmpty)
175NVOL_FNS(QuotaOutOfDate)
176NVOL_FNS(UsnJrnlStamped)
177NVOL_FNS(SparseEnabled)
169DEFINE_NVOL_BIT_OPS(Errors)
170DEFINE_NVOL_BIT_OPS(ShowSystemFiles)
171DEFINE_NVOL_BIT_OPS(CaseSensitive)
172DEFINE_NVOL_BIT_OPS(LogFileEmpty)
173DEFINE_NVOL_BIT_OPS(QuotaOutOfDate)
174DEFINE_NVOL_BIT_OPS(UsnJrnlStamped)
175DEFINE_NVOL_BIT_OPS(SparseEnabled)
178
179#endif /* _LINUX_NTFS_VOLUME_H */
176
177#endif /* _LINUX_NTFS_VOLUME_H */