inode.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
* inode.h - Defines for NTFS inode handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov
* Copyright (c) 2004-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_INODE_H
#define _NTFS_INODE_H
/* Forward declaration */
typedef struct _ntfs_inode ntfs_inode;
#include "list.h"
#include "types.h"
#include "layout.h"
#include "support.h"
#include "volume.h"
/**
* enum ntfs_inode_state_bits -
*
* Defined bits for the state field in the ntfs_inode structure.
* (f) = files only, (d) = directories only
*/
typedef enum {
NI_Dirty, /* 1: Mft record needs to be written to disk. */
/* Below fields only make sense for base inodes. */
NI_AttrList, /* 1: Mft record contains an attribute list. */
NI_AttrListDirty, /* 1: Attribute list needs to be written to the
mft record and then to disk. */
NI_FileNameDirty, /* 1: FILE_NAME attributes need to be updated
in the index. */
#define NInoFileNameDirty(ni) \
#define NInoFileNameSetDirty(ni) \
#define NInoFileNameClearDirty(ni) \
#define NInoFileNameTestAndSetDirty(ni) \
#define NInoFileNameTestAndClearDirty(ni) \
/**
* struct _ntfs_inode - The NTFS in-memory inode structure.
*
* It is just used as an extension to the fields already provided in the VFS
* inode.
*/
struct _ntfs_inode {
unsigned long state; /* NTFS specific flags describing this inode.
See ntfs_inode_state_bits above. */
(Copy from STANDARD_INFORMATION) */
/*
* Attribute list support (for use by the attribute lookup functions).
* Setup during ntfs_open_inode() for all inodes with attribute lists.
* Only valid if NI_AttrList is set in state.
*/
/* Below fields are always valid. */
attached extent inodes (0 if none), for
extent records this is -1. */
union { /* This union is only used if nr_extents != 0. */
ntfs inodes of the extent mft
records belonging to this base
inode which have been loaded. */
inode of the base mft record. */
} u;
/* Below fields are valid only for base inode. */
/*
* These two fields are used to sync filename index and guaranteed to be
* correct, however value in index itself maybe wrong (windows itself
* do not update them properly).
*/
index. (NOTE: Equal to allocated size of
the unnamed data attribute for normal or
encrypted files and to compressed size
of the unnamed data attribute for sparse or
compressed files.) */
/*
* These four fields are copy of relevant fields from
* STANDARD_INFORMATION attribute and used to sync it and FILE_NAME
* attribute in the index.
*/
/* These 2 fields are used to keep track of opened inodes. */
entry. */
int nr_references; /* How many times this inode was
opened. We really close inode only
when this reaches zero. */
};
/**
* ntfs_inode_mark_dirty - set the inode (and its base inode if it exists) dirty
* @ni: ntfs inode to set dirty
*
* Set the inode @ni dirty so it is written out later (at the latest at
* ntfs_inode_close() time). If @ni is an extent inode, set the base inode
* dirty, too.
*
* This function cannot fail.
*/
{
}
typedef enum {
NTFS_UPDATE_ATIME = 1 << 0,
#endif /* defined _NTFS_INODE_H */