volume.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
* volume.h - Exports for NTFS volume handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2000-2004 Anton Altaparmakov
* Copyright (c) 2005-2007 Yura Pakhuchiy
* Copyright (c) 2004-2005 Richard Russon
*
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the main directory of the Linux-NTFS
* distribution in the file COPYING); if not, write to the Free Software
* Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _NTFS_VOLUME_H
#define _NTFS_VOLUME_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#endif
#ifdef HAVE_SYS_MOUNT_H
#endif
#ifdef HAVE_MNTENT_H
#include <mntent.h>
#endif
/* Forward declaration */
typedef struct _ntfs_volume ntfs_volume;
#include "list.h"
#include "types.h"
#include "support.h"
#include "device.h"
#include "inode.h"
#include "attrib.h"
/**
* enum ntfs_mount_flags -
*
* Flags for the ntfs_mount() function.
*/
typedef enum {
NTFS_MNT_RDONLY = 1,
NTFS_MNT_FORENSIC = 2,
NTFS_MNT_FORCE = 16,
NTFS_MNT_INTERIX = 32,
/**
* enum ntfs_mounted_flags -
*
* Flags returned by the ntfs_check_if_mounted() function.
*/
typedef enum {
/**
* enum ntfs_volume_state_bits -
*
* Defined bits for the state field in the ntfs_volume structure.
*/
typedef enum {
NV_ReadOnly, /* 1: Volume is read-only. */
NV_CaseSensitive, /* 1: Volume is mounted case-sensitive. */
NV_LogFileEmpty, /* 1: $logFile journal is empty. */
NV_NoATime, /* 1: Do not update access time. */
NV_WasDirty, /* 1: Volume was marked dirty before we mounted
it. */
NV_ForensicMount, /* 1: Mount is forensic, i.e. no modifications
NV_Interix, /* 1: Make libntfs recognize Interix special
files. */
/*
* NTFS version 1.1 and 1.2 are used by Windows NT4.
* NTFS version 2.x is used by Windows 2000 Beta
* NTFS version 3.0 is used by Windows 2000.
* NTFS version 3.1 is used by Windows XP, 2003 and Vista.
*/
#define NTFS_BUF_SIZE 8192
/**
* struct _ntfs_volume - structure describing an open volume in memory.
*/
struct _ntfs_volume {
union {
the volume. */
void *sb; /* For kernel porting compatibility. */
} u;
char *vol_name; /* Name of the volume. */
unsigned long state; /* NTFS specific flags describing this volume.
See ntfs_volume_state_bits above. */
a NULL guid). */
/* Variables used by the cluster and mft allocators. */
next mft record. */
number of bits in lcn_bitmap. */
of FILE_Bitmap. Each bit represents a
cluster on the volume, bit 0 representing
lcn 0 and so on. A set bit means that the
cluster and vice versa. */
for FILE_MFT. */
of FILE_MFT. */
of FILE_MFT. Each bit represents an mft
record in the $DATA attribute, bit 0
representing mft record 0 and so on. A set
bit means that the mft record is in use and
vice versa. */
int mftmirr_size; /* Size of the FILE_MFTMirr in mft records. */
for FILE_MFTMirr. */
of FILE_MFTMirr. */
Unicode characters. Obtained from
FILE_UpCase. */
table. */
FILE_AttrDef. */
bytes. */
long nr_free_clusters; /* This two are self explaining. */
long nr_free_mft_records;
inodes. */
};
extern ntfs_volume *ntfs_volume_alloc(void);
#endif /* defined _NTFS_VOLUME_H */