Commit f9382b8a authored by Anton Altaparmakov's avatar Anton Altaparmakov

Merge bk://linux.bkbits.net/linux-2.5 into cam.ac.uk:/usr/src/tng

parents ace5d474 93c6cb92
This diff is collapsed.
...@@ -581,33 +581,36 @@ CONFIG_HPFS_FS ...@@ -581,33 +581,36 @@ CONFIG_HPFS_FS
say N. say N.
CONFIG_NTFS_FS CONFIG_NTFS_FS
NTFS is the file system of Microsoft Windows NT. Say Y if you want NTFS is the file system of Microsoft Windows NT/2000/XP. For more
to get read access to files on NTFS partitions of your hard drive. information see <file:Documentation/filesystems/ntfs.txt>. Saying Y
The Linux NTFS driver supports most of the mount options of the VFAT here would allow you to read from NTFS partitions.
driver, see <file:Documentation/filesystems/ntfs.txt>. Saying Y here
will give you read-only access to NTFS partitions.
This code is also available as a module ( = code which can be This file system is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want). inserted in and removed from the running kernel whenever you want).
The module will be called ntfs.o. If you want to compile it as a The module will be called ntfs.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>. module, say M here and read <file:Documentation/modules.txt>.
CONFIG_NTFS_RW If you are not using Windows NT/2000/XP in addition to Linux on your
If you say Y here, you will (maybe) be able to write to NTFS file computer it is safe to say N.
systems as well as read from them. The read-write support in NTFS
is far from being complete and is not well tested. If you say Y CONFIG_NTFS_DEBUG
here, back up your NTFS volume first, since it will probably get If you are experiencing any problems with the NTFS file system, say
damaged. Also, download the Linux-NTFS project distribution from Y here. This will result in additional consistency checks to be
Sourceforge at <http://linux-ntfs.sf.net/> and always run the performed by the driver as well as additional debugging messages to
included ntfsfix utility after writing to an NTFS partition from be written to the system log. Note that debugging messages are
Linux to fix some of the damage done by the driver. You should run disabled by default. To enable them, supply the option debug_msgs=1
ntfsfix _after_ unmounting the partition in Linux but _before_ at the kernel command line when booting the kernel or as an option
rebooting into Windows. When Windows next boots, chkdsk will be to insmod when loading the ntfs module. Once the driver is active,
run automatically to fix the remaining damage. you can enable debugging messages by doing (as root):
Please note that write support is limited to Windows NT4 and echo 1 > /proc/sys/fs/ntfs-debug
earlier versions. Replacing the "1" with "0" would disable debug messages.
If unsure, say N. If you leave debugging messages disabled, this results in little
overhead, but enabling debug messages results in very significant
slowdown of the system.
When reporting bugs, please try to have available a full dump of
debugging messages while the misbehaviour was occurring.
CONFIG_SYSV_FS CONFIG_SYSV_FS
SCO, Xenix and Coherent are commercial Unix systems for Intel SCO, Xenix and Coherent are commercial Unix systems for Intel
......
...@@ -61,8 +61,9 @@ dep_mbool ' JFS statistics' CONFIG_JFS_STATISTICS $CONFIG_JFS_FS ...@@ -61,8 +61,9 @@ dep_mbool ' JFS statistics' CONFIG_JFS_STATISTICS $CONFIG_JFS_FS
tristate 'Minix fs support' CONFIG_MINIX_FS tristate 'Minix fs support' CONFIG_MINIX_FS
tristate 'FreeVxFS file system support (VERITAS VxFS(TM) compatible)' CONFIG_VXFS_FS tristate 'FreeVxFS file system support (VERITAS VxFS(TM) compatible)' CONFIG_VXFS_FS
tristate 'NTFS file system support (read only)' CONFIG_NTFS_FS tristate 'NTFS file system support (read only)' CONFIG_NTFS_FS
dep_mbool ' NTFS write support (DANGEROUS)' CONFIG_NTFS_RW $CONFIG_NTFS_FS $CONFIG_EXPERIMENTAL dep_mbool ' NTFS debugging support' CONFIG_NTFS_DEBUG $CONFIG_NTFS_FS
tristate 'OS/2 HPFS file system support' CONFIG_HPFS_FS tristate 'OS/2 HPFS file system support' CONFIG_HPFS_FS
......
This diff is collapsed.
# Rules for making the NTFS driver # Rules for making the NTFS TNG driver.
O_TARGET := ntfs.o O_TARGET := ntfs.o
obj-y := fs.o sysctl.o support.o util.o inode.o dir.o super.o attr.o unistr.o obj-y := time.o unistr.o inode.o file.o mft.o super.o debug.o aops.o \
attrib.o dir.o namei.o mst.o upcase.o compress.o sysctl.o
obj-m := $(O_TARGET) obj-m := $(O_TARGET)
# New version format started 3 February 2001.
EXTRA_CFLAGS = -DNTFS_VERSION=\"1.1.21\" #-DDEBUG EXTRA_CFLAGS = -DNTFS_VERSION=\"TNG-0.0.8\"
ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
/*
* attr.h - Header file for attr.c
*
* Copyright (C) 1997 Rgis Duchesne
* Copyright (c) 2001 Anton Altaparmakov (AIA)
*/
#include <linux/nls.h>
ntfs_u8* ntfs_find_attr_in_mft_rec(ntfs_volume *vol, ntfs_u8 *m, __u32 type,
wchar_t *name, __u32 name_len, int ic, __u16 instance);
int ntfs_extend_attr(ntfs_inode *ino, ntfs_attribute *attr, const __s64 len);
int ntfs_resize_attr(ntfs_inode *ino, ntfs_attribute *attr, __s64 newsize);
int ntfs_insert_attribute(ntfs_inode *ino, unsigned char* attrdata);
int ntfs_read_compressed(ntfs_inode *ino, ntfs_attribute *attr, __s64 offset,
ntfs_io *dest);
int ntfs_write_compressed(ntfs_inode *ino, ntfs_attribute *attr, __s64 offset,
ntfs_io *dest);
int ntfs_create_attr(ntfs_inode *ino, int anum, char *aname, void *data,
int dsize, ntfs_attribute **rattr);
int ntfs_read_zero(ntfs_io *dest, int size);
int ntfs_make_attr_nonresident(ntfs_inode *ino, ntfs_attribute *attr);
int ntfs_attr_allnonresident(ntfs_inode *ino);
int ntfs_new_attr(ntfs_inode *ino, int type, void *name, int namelen,
void *value, int value_len, int *pos, int *found);
int ntfs_insert_run(ntfs_attribute *attr, int cnum, ntfs_cluster_t cluster,
int len);
#include "ntfs.h"
/*
* We need to define the attribute object structure. FIXME: Move these to
* ntfs.h.
*/
typedef struct {
ntfs_inode *a_ni;
ntfs_volume *a_vol;
atomic_t a_count;
s64 a_size;
struct rw_semaphore a_sem;
struct address_space a_mapping;
unsigned long a_flags;
} attr_obj;
/**
* ntfs_attr_readpage - fill a page @page of an attribute object @aobj with data
* @aobj: attribute object to which the page @page belongs
* @page: page cache page to fill with data
*
*/
//static int ntfs_attr_readpage(attr_obj *aobj, struct page *page)
static int ntfs_attr_readpage(struct file *aobj, struct page *page)
{
return -EOPNOTSUPP;
}
/*
* Address space operations for accessing attributes. Note that these functions
* do not accept an inode as the first parameter but an attribute object. We
* use this to implement a generic interface that is not bound to inodes in
* order to support multiple named streams per file, multiple bitmaps per file
* and directory, etc. Basically, this gives access to any attribute within an
* mft record.
*
* We make use of a slab cache for attribute object allocations.
*/
struct address_space_operations ntfs_attr_aops = {
writepage: NULL, /* Write dirty page to disk. */
readpage: ntfs_attr_readpage, /* Fill page with data. */
sync_page: block_sync_page, /* Currently, just unplugs the
disk request queue. */
prepare_write: NULL, /* . */
commit_write: NULL, /* . */
//truncatepage: NULL, /* . */
};
This diff is collapsed.
/*
* attrib.h - Defines for attribute handling in NTFS Linux kernel driver.
* Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov.
* Copyright (C) 2002 Richard Russon.
*
* 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
*/
#ifndef _LINUX_NTFS_ATTRIB_H
#define _LINUX_NTFS_ATTRIB_H
#include <linux/fs.h>
#include "endian.h"
#include "types.h"
#include "layout.h"
typedef enum {
LCN_HOLE = -1, /* Keep this as highest value or die! */
LCN_RL_NOT_MAPPED = -2,
LCN_ENOENT = -3,
LCN_EINVAL = -4,
} LCN_SPECIAL_VALUES;
/**
* attr_search_context - used in attribute search functions
* @mrec: buffer containing mft record to search
* @attr: attribute record in @mrec where to begin/continue search
* @is_first: if true lookup_attr() begins search with @attr, else after @attr
*
* Structure must be initialized to zero before the first call to one of the
* attribute search functions. Initialize @mrec to point to the mft record to
* search, and @attr to point to the first attribute within @mrec (not necessary
* if calling the _first() functions), and set @is_first to TRUE (not necessary
* if calling the _first() functions).
*
* If @is_first is TRUE, the search begins with @attr. If @is_first is FALSE,
* the search begins after @attr. This is so that, after the first call to one
* of the search attribute functions, we can call the function again, without
* any modification of the search context, to automagically get the next
* matching attribute.
*/
typedef struct {
MFT_RECORD *mrec;
ATTR_RECORD *attr;
BOOL is_first;
ntfs_inode *ntfs_ino;
ATTR_LIST_ENTRY *al_entry;
ntfs_inode *base_ntfs_ino;
MFT_RECORD *base_mrec;
ATTR_RECORD *base_attr;
} attr_search_context;
extern run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
const ATTR_RECORD *attr, run_list_element *old_rl);
extern int map_run_list(ntfs_inode *ni, VCN vcn);
extern LCN vcn_to_lcn(const run_list_element *rl, const VCN vcn);
extern BOOL find_attr(const ATTR_TYPES type, const uchar_t *name,
const u32 name_len, const IGNORE_CASE_BOOL ic, const u8 *val,
const u32 val_len, attr_search_context *ctx);
BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
const u32 val_len, attr_search_context *ctx);
extern int load_attribute_list(ntfs_volume *vol, run_list_element *rl, u8 *al,
const s64 size);
static inline s64 attribute_value_length(const ATTR_RECORD *a)
{
if (!a->non_resident)
return (s64)le32_to_cpu(a->_ARA(value_length));
return sle64_to_cpu(a->_ANR(data_size));
}
extern void reinit_attr_search_ctx(attr_search_context *ctx);
extern int get_attr_search_ctx(attr_search_context **ctx, ntfs_inode *ni,
MFT_RECORD *mrec);
extern void put_attr_search_ctx(attr_search_context *ctx);
#endif /* _LINUX_NTFS_ATTRIB_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* dir.h - Header file for dir.c
*
* Copyright (C) 1997 Rgis Duchesne
*/
#define ITERATE_SPLIT_DONE 1
enum ntfs_iterate_e {
BY_POSITION,
BY_NAME,
DIR_INSERT
};
/* not all fields are used for all operations */
typedef struct ntfs_iterate_s {
enum ntfs_iterate_e type;
ntfs_inode *dir;
union{
ntfs_u64 pos;
int flags;
}u;
char *result; /* pointer to entry if found */
ntfs_u16* name;
int namelen;
int block; /* current index record */
int newblock; /* index record created in a split */
char *new_entry;
int new_entry_size;
/*ntfs_inode* new;*/
} ntfs_iterate_s;
int ntfs_getdir_unsorted(ntfs_inode *ino, ntfs_u32 *p_high, ntfs_u32* p_low,
int (*cb)(ntfs_u8*, void*), void *param);
int ntfs_getdir_byname(ntfs_iterate_s *walk);
int ntfs_dir_add(ntfs_inode *dir, ntfs_inode *new, ntfs_attribute *name);
int ntfs_check_index_record(ntfs_inode *ino, char *record);
int ntfs_getdir_byposition(ntfs_iterate_s *walk);
int ntfs_mkdir(ntfs_inode* dir,const char* name,int namelen, ntfs_inode *ino);
int ntfs_split_indexroot(ntfs_inode *ino);
int ntfs_add_index_root(ntfs_inode *ino, int type);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -165,7 +165,8 @@ EXPORT_SYMBOL(d_alloc); ...@@ -165,7 +165,8 @@ EXPORT_SYMBOL(d_alloc);
EXPORT_SYMBOL(d_lookup); EXPORT_SYMBOL(d_lookup);
EXPORT_SYMBOL(__d_path); EXPORT_SYMBOL(__d_path);
EXPORT_SYMBOL(mark_buffer_dirty); EXPORT_SYMBOL(mark_buffer_dirty);
EXPORT_SYMBOL(set_buffer_async_io); /* for reiserfs_writepage */ EXPORT_SYMBOL(end_buffer_io_sync);
EXPORT_SYMBOL(set_buffer_async_io);
EXPORT_SYMBOL(__mark_buffer_dirty); EXPORT_SYMBOL(__mark_buffer_dirty);
EXPORT_SYMBOL(__mark_inode_dirty); EXPORT_SYMBOL(__mark_inode_dirty);
EXPORT_SYMBOL(get_empty_filp); EXPORT_SYMBOL(get_empty_filp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment