Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/include/ntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29034/include/ntfs
Modified Files:
dir.h index.h inode.h layout.h ntfstime.h volume.h
Log Message:
Sorry it's very large commit (46K of diffs between my local tree and CVS HEAD
before commit), file and directory creation/deletion recursively requested many
changes. See ChangeLog for description of all changes.
Index: dir.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/dir.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- dir.h 12 Jun 2005 18:12:56 -0000 1.4
+++ dir.h 14 Aug 2005 15:44:47 -0000 1.5
@@ -2,6 +2,7 @@
* dir.h - Exports for directory handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2002 Anton Altaparmakov
+ * Copyright (c) 2005 Yura Pakhuchiy
*
* 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
@@ -39,6 +40,11 @@ extern u64 ntfs_inode_lookup_by_name(ntf
extern ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent,
const char *pathname);
+extern ntfs_inode *ntfs_create(ntfs_inode *dir_ni, ntfschar *name, u8 name_len,
+ const unsigned type);
+extern int ntfs_delete(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name,
+ u8 name_len);
+
/*
* File types (adapted from include <linux/fs.h>)
*/
Index: index.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/index.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- index.h 29 Jul 2005 21:37:09 -0000 1.5
+++ index.h 14 Aug 2005 15:44:47 -0000 1.6
@@ -90,10 +90,15 @@ typedef struct {
extern ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *ni,
ntfschar *name, u32 name_len);
extern void ntfs_index_ctx_put(ntfs_index_context *ictx);
+extern void ntfs_index_ctx_reinit(ntfs_index_context *ictx);
extern int ntfs_index_lookup(const void *key, const int key_len,
ntfs_index_context *ictx);
+extern int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn,
+ MFT_REF mref);
+extern int ntfs_index_rm(ntfs_index_context *ictx);
+
/**
* ntfs_index_entry_mark_dirty - mark an index entry dirty
* @ictx: ntfs index context describing the index entry
Index: inode.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/inode.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- inode.h 20 Jul 2005 19:06:47 -0000 1.14
+++ inode.h 14 Aug 2005 15:44:47 -0000 1.15
@@ -2,7 +2,7 @@
* inode.h - Defines for NTFS inode handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov
- * Copyright (c) 2004 Yura Pakhuchiy
+ * Copyright (c) 2004-2005 Yura Pakhuchiy
*
* 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
@@ -144,9 +144,10 @@ struct _ntfs_inode {
s64 data_size;
s64 allocated_size;
- time_t atime; /* Last access to the data within the file. */
- time_t mtime; /* Last change of the data within the file. */
- time_t ctime; /* Last change of the metadata of the file. */
+ time_t creation_time;
+ time_t last_data_change_time;
+ time_t last_mft_change_time;
+ time_t last_access_time;
};
extern ntfs_inode *ntfs_inode_allocate(ntfs_volume *vol);
Index: layout.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/layout.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- layout.h 14 Aug 2005 06:16:35 -0000 1.26
+++ layout.h 14 Aug 2005 15:44:47 -0000 1.27
@@ -883,8 +883,11 @@ typedef struct {
/* 32*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */
/* 36*/ union {
/* NTFS 1.2 (and previous, presumably) */
-/* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte
- boundary. */
+ struct {
+ /* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte
+ boundary. */
+ /* 48 */ void *v1_end[0]; /* Marker for offsetof(). */
+ } __attribute__ ((__packed__));
/* sizeof() = 48 bytes */
/* NTFS 3.0 */
struct {
@@ -937,6 +940,7 @@ typedef struct {
partition. This, in contrast to disabling the
journal is a very fast process, so the user
won't even notice it. */
+ /* 72*/ void *v3_end[0]; /* Marker for offsetof(). */
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
/* sizeof() = 72 bytes (NTFS 3.0) */
@@ -1989,10 +1993,10 @@ typedef struct {
this must be COLLATION_FILE_NAME. */
u32 index_block_size; /* Size of each index block in bytes (in
the index allocation attribute). */
- u8 clusters_per_index_block; /* Cluster size of each index block (in
+ s8 clusters_per_index_block; /* Cluster size of each index block (in
the index allocation attribute), when
an index block is >= than a cluster,
- otherwise this will be the log of
+ otherwise this will be the -log of
the size (like how the encoding of
the mft record size and the index
record size found in the boot sector
@@ -2168,13 +2172,11 @@ typedef struct {
*/
typedef struct {
/* 0 INDEX_ENTRY_HEADER; -- Unfolded here as gcc dislikes unnamed structs. */
- union {
- struct { /* Only valid when INDEX_ENTRY_END is not set. */
- MFT_REF indexed_file; /* The mft reference of the file
+ union { /* Only valid when INDEX_ENTRY_END is not set. */
+ MFT_REF indexed_file; /* The mft reference of the file
described by this index
entry. Used for directory
indexes. */
- } __attribute__ ((__packed__));
struct { /* Used for views/indexes to find the entry's data. */
u16 data_offset; /* Data byte offset from this
INDEX_ENTRY. Follows the
Index: ntfstime.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/ntfstime.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- ntfstime.h 4 Aug 2005 09:59:43 -0000 1.1
+++ ntfstime.h 14 Aug 2005 15:44:47 -0000 1.2
@@ -40,7 +40,7 @@
*/
static __inline__ time_t ntfs2utc(s64 ntfs_time)
{
- return (ntfs_time - (NTFS_TIME_OFFSET)) / 10000000;
+ return (sle64_to_cpu(ntfs_time) - (NTFS_TIME_OFFSET)) / 10000000;
}
/**
@@ -61,7 +61,7 @@ static __inline__ time_t ntfs2utc(s64 nt
static __inline__ s64 utc2ntfs(time_t utc_time)
{
/* Convert to 100ns intervals and then add the NTFS time offset. */
- return (s64)utc_time * 10000000 + NTFS_TIME_OFFSET;
+ return cpu_to_sle64((s64)utc_time * 10000000 + NTFS_TIME_OFFSET);
}
#endif /* _NTFS_NTFSTIME_H */
Index: volume.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/volume.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- volume.h 10 May 2005 16:44:58 -0000 1.12
+++ volume.h 14 Aug 2005 15:44:47 -0000 1.13
@@ -2,6 +2,7 @@
* volume.h - Exports for NTFS volume handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2000-2004 Anton Altaparmakov
+ * Copyright (c) 2005 Yura Pakhuchiy
*
* 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
@@ -124,8 +125,10 @@ struct _ntfs_volume {
u8 sector_size_bits; /* Log(2) of the byte size of a sector. */
u32 cluster_size; /* Byte size of a cluster. */
u32 mft_record_size; /* Byte size of a mft record. */
+ u32 indx_record_size; /* Byte size of a INDX record. */
u8 cluster_size_bits; /* Log(2) of the byte size of a cluster. */
u8 mft_record_size_bits;/* Log(2) of the byte size of a mft record. */
+ u8 indx_record_size_bits;/* Log(2) of the byte size of a INDX record. */
/* Variables used by the cluster and mft allocators. */
u8 mft_zone_multiplier; /* Initial mft zone multiplier. */
|