* volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
* of the Linux-NTFS project.
*
* Copyright (c) 2001-2006 Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*/
#ifndef _LINUX_NTFS_VOLUME_H
#define _LINUX_NTFS_VOLUME_H
#include <linux/rwsem.h>
#include <linux/uidgid.h>
#include "types.h"
#include "layout.h"
* The NTFS in memory super block structure.
*/
typedef struct {
* FIXME: Reorder to have commonly used together element within the
* same cache line, aiming at a cache line size of 32 bytes. Aim for
* 64 bytes for less commonly used together elements. Put most commonly
* used elements to front of structure. Obviously do this only when the
* structure has stabilized... (AIA)
*/
struct super_block *sb;
LCN nr_blocks;
sized blocks on the device. */
unsigned long flags;
kuid_t uid;
kgid_t gid;
umode_t fmask;
umode_t dmask;
permissions. */
u8 mft_zone_multiplier;
u8 on_errors;
u16 sector_size;
u8 sector_size_bits;
u32 cluster_size;
u32 cluster_size_mask;
u8 cluster_size_bits;
u32 mft_record_size;
u32 mft_record_size_mask;
u8 mft_record_size_bits;
u32 index_record_size;
u32 index_record_size_mask;
u8 index_record_size_bits;
LCN nr_clusters;
bits in lcn bitmap. */
LCN mft_lcn;
LCN mftmirr_lcn;
u64 serial_no;
u32 upcase_len;
ntfschar *upcase;
s32 attrdef_size;
table in bytes. */
ATTR_DEF *attrdef;
Obtained from FILE_AttrDef. */
#ifdef NTFS_RW
s64 mft_data_pos;
allocate the next mft record. */
LCN mft_zone_start;
LCN mft_zone_end;
LCN mft_zone_pos;
LCN data1_zone_pos;
zone. */
LCN data2_zone_pos;
zone. */
#endif
struct inode *mft_ino;
struct inode *mftbmp_ino;
struct rw_semaphore mftbmp_lock;
mft record bitmap ($MFT/$BITMAP). */
#ifdef NTFS_RW
struct inode *mftmirr_ino;
int mftmirr_size;
struct inode *logfile_ino;
#endif
struct inode *lcnbmp_ino;
struct rw_semaphore lcnbmp_lock;
cluster bitmap ($Bitmap/$DATA). */
struct inode *vol_ino;
VOLUME_FLAGS vol_flags;
u8 major_ver;
u8 minor_ver;
struct inode *root_ino;
directory. */
struct inode *secure_ino;
only, otherwise NULL). */
struct inode *extend_ino;
only, otherwise NULL). */
#ifdef NTFS_RW
struct inode *quota_ino;
struct inode *quota_q_ino;
struct inode *usnjrnl_ino;
struct inode *usnjrnl_max_ino;
struct inode *usnjrnl_j_ino;
#endif
struct nls_table *nls_map;
} ntfs_volume;
* Defined bits for the flags field in the ntfs_volume structure.
*/
typedef enum {
NV_Errors,
NV_ShowSystemFiles,
NV_CaseSensitive,
create filenames in the POSIX namespace.
Otherwise be case insensitive but still
create file names in POSIX namespace. */
NV_LogFileEmpty,
NV_QuotaOutOfDate,
NV_UsnJrnlStamped,
NV_SparseEnabled,
} ntfs_volume_flags;
* Macro tricks to expand the NVolFoo(), NVolSetFoo(), and NVolClearFoo()
* functions.
*/
#define DEFINE_NVOL_BIT_OPS(flag) \
static inline int NVol##flag(ntfs_volume *vol) \
{ \
return test_bit(NV_##flag, &(vol)->flags); \
} \
static inline void NVolSet##flag(ntfs_volume *vol) \
{ \
set_bit(NV_##flag, &(vol)->flags); \
} \
static inline void NVolClear##flag(ntfs_volume *vol) \
{ \
clear_bit(NV_##flag, &(vol)->flags); \
}
DEFINE_NVOL_BIT_OPS(Errors)
DEFINE_NVOL_BIT_OPS(ShowSystemFiles)
DEFINE_NVOL_BIT_OPS(CaseSensitive)
DEFINE_NVOL_BIT_OPS(LogFileEmpty)
DEFINE_NVOL_BIT_OPS(QuotaOutOfDate)
DEFINE_NVOL_BIT_OPS(UsnJrnlStamped)
DEFINE_NVOL_BIT_OPS(SparseEnabled)
#endif