Linux Kernel
3.7.1
|
#include <linux/atomic.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/seq_file.h>
#include "layout.h"
#include "volume.h"
#include "types.h"
#include "runlist.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | _ntfs_inode |
struct | big_ntfs_inode |
struct | ntfs_attr |
Macros | |
#define | NINO_FNS(flag) |
#define | TAS_NINO_FNS(flag) |
Typedefs | |
typedef struct _ntfs_inode | ntfs_inode |
Enumerations | |
enum | ntfs_inode_state_bits { NI_Dirty, NI_AttrList, NI_AttrListNonResident, NI_Attr, NI_MstProtected, NI_NonResident, NI_IndexAllocPresent = NI_NonResident, NI_Compressed, NI_Encrypted, NI_Sparse, NI_SparseDisabled, NI_TruncateFailed } |
#define NINO_FNS | ( | flag | ) |
#define TAS_NINO_FNS | ( | flag | ) |
typedef struct _ntfs_inode ntfs_inode |
void __ntfs_init_inode | ( | struct super_block * | sb, |
ntfs_inode * | ni | ||
) |
__ntfs_init_inode - initialize ntfs specific part of an inode : super block of mounted volume : freshly allocated ntfs inode which to initialize
Initialize an ntfs inode to defaults.
NOTE: ni->mft_no, ni->state, ni->type, ni->name, and ni->name_len are left untouched. Make sure to initialize them elsewhere.
Return zero on success and -ENOMEM on error.
|
read |
void ntfs_clear_extent_inode | ( | ntfs_inode * | ni | ) |
ntfs_evict_big_inode - clean up the ntfs specific part of an inode : vfs inode pending annihilation
When the VFS is going to remove an inode from memory, ntfs_clear_big_inode() is called, which deallocates all memory belonging to the NTFS specific part of the inode and returns.
If the MFT record is dirty, we commit it before doing anything else.
|
read |
ntfs_iget - obtain a struct inode corresponding to a specific normal inode : super block of mounted volume : mft record number / inode number to obtain
Obtain the struct inode corresponding to a specific normal inode (i.e. a file or directory).
If the inode is in the cache, it is just returned with an increased reference count. Otherwise, a new struct inode is allocated and initialized, and finally ntfs_read_locked_inode() is called to read in the inode and fill in the remainder of the inode structure.
Return the struct inode on success. Check the return value with IS_ERR() and if true, the function failed and the error code is obtained from PTR_ERR().
|
inline |
ntfs_read_inode_mount - special read_inode for mount time use only : inode to read
Read inode FILE_MFT at mount time, only called with super_block lock held from within the read_super() code path.
This function exists because when it is called the page cache for $MFT/$DATA is not initialized and hence we cannot get at the contents of mft records by calling map_mft_record*().
Further it needs to cope with the circular references problem, i.e. cannot load any attributes other than $ATTRIBUTE_LIST until $DATA is loaded, because we do not know where the other extent mft records are yet and again, because we cannot call map_mft_record*() yet. Obviously this applies only when an attribute list is actually present in $MFT inode.
We solve these problems by starting with the $DATA attribute before anything else and iterating using ntfs_attr_lookup($DATA) over all extents. As each extent is found, we ntfs_mapping_pairs_decompress() including the implied ntfs_runlists_merge(). Each step of the iteration necessarily provides sufficient information for the next step to complete.
This should work but there are two possible pit falls (see inline comments below), but only time will tell if they are real pits or just smoke...
ntfs_show_options - show mount options in /proc/mounts : seq_file in which to write our mount options : root of the mounted tree whose mount options to display
Called by the VFS once for each mounted ntfs volume when someone reads /proc/mounts in order to display the NTFS specific mount options of each mount. The mount options of fs specified by are written to the seq file and success is returned.
inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project.
Copyright (c) 2001-2007 Anton Altaparmakov
This program/include file is free software; you can redistribute it and/or 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.
This program/include file is distributed in the hope that it will be 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 ntfs_test_inode - compare two (possibly fake) inodes for equality : vfs inode which to test : ntfs attribute which is being tested with
Compare the ntfs attribute embedded in the ntfs specific part of the vfs inode for equality with the ntfs attribute .
If searching for the normal file/directory inode, set ->type to AT_UNUSED. ->name and ->name_len are then ignored.
Return 1 if the attributes match and 0 if not.
NOTE: This function runs with the inode->i_lock spin lock held so it is not allowed to sleep.