Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
aea571fc
Commit
aea571fc
authored
Apr 27, 2004
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Plain Diff
Merge cantab.net:/home/src/bklinux-2.6
into cantab.net:/home/src/ntfs-2.6
parents
9fa12b00
93b62d3a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
478 additions
and
159 deletions
+478
-159
Documentation/filesystems/ntfs.txt
Documentation/filesystems/ntfs.txt
+1
-0
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+21
-0
fs/ntfs/Makefile
fs/ntfs/Makefile
+2
-2
fs/ntfs/compress.c
fs/ntfs/compress.c
+6
-7
fs/ntfs/inode.c
fs/ntfs/inode.c
+9
-66
fs/ntfs/inode.h
fs/ntfs/inode.h
+44
-9
fs/ntfs/mft.h
fs/ntfs/mft.h
+9
-6
fs/ntfs/ntfs.h
fs/ntfs/ntfs.h
+1
-6
fs/ntfs/super.c
fs/ntfs/super.c
+272
-56
fs/ntfs/time.h
fs/ntfs/time.h
+100
-0
fs/ntfs/volume.h
fs/ntfs/volume.h
+13
-7
No files found.
Documentation/filesystems/ntfs.txt
View file @
aea571fc
...
...
@@ -71,6 +71,7 @@ Features
compatibility, we implement access to files using their short file names if
they exist. The driver will not create short file names however, and a rename
will discard any existing short file name.
- The new driver supports exporting of mounted NTFS volumes via NFS.
Supported mount options
...
...
fs/ntfs/ChangeLog
View file @
aea571fc
...
...
@@ -19,6 +19,27 @@ ToDo:
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.
2.1.8-WIP
- Use get_bh() instead of manual atomic_inc() in fs/ntfs/compress.c.
- Modify fs/ntfs/time.c::ntfs2utc(), get_current_ntfs_time(), and
utc2ntfs() to work with struct timespec instead of time_t on the
Linux UTC time side thus preserving the full precision of the NTFS
time and only loosing up to 99 nano-seconds in the Linux UTC time.
- Move fs/ntfs/time.c to fs/ntfs/time.h and make the time functions
static inline.
- Remove unused ntfs_dirty_inode().
- Cleanup super operations declaration in fs/ntfs/super.c.
- Wrap flush_dcache_mft_record_page() in #ifdef NTFS_RW.
- Add NInoTestSetFoo() and NInoTestClearFoo() macro magic to
fs/ntfs/inode.h and use it to declare NInoTest{Set,Clear}Dirty.
- Move typedefs for ntfs_attr and test_t from fs/ntfs/inode.c to
fs/ntfs/inode.h so they can be used elsewhere.
- Determine the mft mirror size as the number of mirrored mft records
and store it in ntfs_volume->mftmirr_size (fs/ntfs/super.c).
- Load the mft mirror at mount time and compare the mft records stored
in it to the ones in the mft (fs/ntfs/super.c).
2.1.7 - Enable NFS exporting of mounted NTFS volumes.
- Set i_generation in the VFS inode from the seq_no of the NTFS inode.
...
...
fs/ntfs/Makefile
View file @
aea571fc
...
...
@@ -3,9 +3,9 @@
obj-$(CONFIG_NTFS_FS)
+=
ntfs.o
ntfs-objs
:=
aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o
\
mst.o namei.o super.o sysctl.o
time.o
unistr.o upcase.o
mst.o namei.o super.o sysctl.o unistr.o upcase.o
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.
7
\"
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.
8-WIP
\"
ifeq
($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS
+=
-DDEBUG
...
...
fs/ntfs/compress.c
View file @
aea571fc
...
...
@@ -2,7 +2,7 @@
* compress.c - NTFS kernel compressed attributes handling.
* Part of the Linux-NTFS project.
*
* Copyright (c) 2001-200
3
Anton Altaparmakov
* Copyright (c) 2001-200
4
Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -10,13 +10,13 @@
* 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
* 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
* 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
*/
...
...
@@ -357,7 +357,7 @@ static int ntfs_decompress(struct page *dest_pages[], int *dest_index,
continue
;
}
/*
/*
* We have a phrase token. Make sure it is not the first tag in
* the sb as this is illegal and would confuse the code below.
*/
...
...
@@ -643,7 +643,7 @@ int ntfs_read_compressed_block(struct page *page)
unlock_buffer
(
tbh
);
continue
;
}
atomic_inc
(
&
tbh
->
b_count
);
get_bh
(
tbh
);
tbh
->
b_end_io
=
end_buffer_read_sync
;
submit_bh
(
READ
,
tbh
);
}
...
...
@@ -943,4 +943,3 @@ int ntfs_read_compressed_block(struct page *page)
kfree
(
pages
);
return
-
EIO
;
}
fs/ntfs/inode.c
View file @
aea571fc
...
...
@@ -8,13 +8,13 @@
* 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
* 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
* 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
*/
...
...
@@ -29,26 +29,7 @@
#include "dir.h"
#include "inode.h"
#include "attrib.h"
/**
* ntfs_attr - ntfs in memory attribute structure
* @mft_no: mft record number of the base mft record of this attribute
* @name: Unicode name of the attribute (NULL if unnamed)
* @name_len: length of @name in Unicode characters (0 if unnamed)
* @type: attribute type (see layout.h)
*
* This structure exists only to provide a small structure for the
* ntfs_{attr_}iget()/ntfs_test_inode()/ntfs_init_locked_inode() mechanism.
*
* NOTE: Elements are ordered by size to make the structure as compact as
* possible on all architectures.
*/
typedef
struct
{
unsigned
long
mft_no
;
uchar_t
*
name
;
u32
name_len
;
ATTR_TYPES
type
;
}
ntfs_attr
;
#include "time.h"
/**
* ntfs_test_inode - compare two (possibly fake) inodes for equality
...
...
@@ -66,7 +47,7 @@ typedef struct {
* NOTE: This function runs with the inode_lock spin lock held so it is not
* allowed to sleep.
*/
static
int
ntfs_test_inode
(
struct
inode
*
vi
,
ntfs_attr
*
na
)
int
ntfs_test_inode
(
struct
inode
*
vi
,
ntfs_attr
*
na
)
{
ntfs_inode
*
ni
;
...
...
@@ -150,7 +131,6 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
return
0
;
}
typedef
int
(
*
test_t
)(
struct
inode
*
,
void
*
);
typedef
int
(
*
set_t
)(
struct
inode
*
,
void
*
);
static
int
ntfs_read_locked_inode
(
struct
inode
*
vi
);
static
int
ntfs_read_locked_attr_inode
(
struct
inode
*
base_vi
,
struct
inode
*
vi
);
...
...
@@ -380,7 +360,7 @@ inline ntfs_inode *ntfs_new_extent_inode(struct super_block *sb,
* Search all file name attributes in the inode described by the attribute
* search context @ctx and check if any of the names are in the $Extend system
* directory.
*
*
* Return values:
* 1: file is in $Extend directory
* 0: file is not in $Extend directory
...
...
@@ -590,21 +570,18 @@ static int ntfs_read_locked_inode(struct inode *vi)
* mtime is the last change of the data within the file. Not changed
* when only metadata is changed, e.g. a rename doesn't affect mtime.
*/
vi
->
i_mtime
.
tv_sec
=
ntfs2utc
(
si
->
last_data_change_time
);
vi
->
i_mtime
.
tv_nsec
=
0
;
vi
->
i_mtime
=
ntfs2utc
(
si
->
last_data_change_time
);
/*
* ctime is the last change of the metadata of the file. This obviously
* always changes, when mtime is changed. ctime can be changed on its
* own, mtime is then not changed, e.g. when a file is renamed.
*/
vi
->
i_ctime
.
tv_sec
=
ntfs2utc
(
si
->
last_mft_change_time
);
vi
->
i_ctime
.
tv_nsec
=
0
;
vi
->
i_ctime
=
ntfs2utc
(
si
->
last_mft_change_time
);
/*
* Last access to the data within the file. Not changed during a rename
* for example but changed whenever the file is written to.
*/
vi
->
i_atime
.
tv_sec
=
ntfs2utc
(
si
->
last_access_time
);
vi
->
i_atime
.
tv_nsec
=
0
;
vi
->
i_atime
=
ntfs2utc
(
si
->
last_access_time
);
/* Find the attribute list attribute if present. */
reinit_attr_search_ctx
(
ctx
);
...
...
@@ -1738,39 +1715,6 @@ void ntfs_read_inode_mount(struct inode *vi)
goto
out_now
;
}
/**
* ntfs_dirty_inode - mark the inode's metadata dirty
* @vi: inode to mark dirty
*
* This is called from fs/inode.c::__mark_inode_dirty(), when the inode itself
* is being marked dirty. An example is when update_atime() is invoked.
*
* We mark the inode dirty by setting both the page in which the mft record
* resides and the buffer heads in that page which correspond to the mft record
* dirty. This ensures that the changes will eventually be propagated to disk
* when the inode is set dirty.
*
* FIXME: Can we do that with the buffer heads? I am not too sure. Because if we
* do that we need to make sure that the kernel will not write out those buffer
* heads or we are screwed as it will write corrupt data to disk. The only way
* a mft record can be written correctly is by mst protecting it, writting it
* synchronously and fast mst deprotecting it. During this period, obviously,
* the mft record must be marked as not uptodate, be locked for writing or
* whatever, so that nobody attempts anything stupid.
*
* FIXME: Do we need to check that the fs is not mounted read only? And what
* about the inode? Anything else?
*
* FIXME: As we are only a read only driver it is safe to just return here for
* the moment.
*/
void
ntfs_dirty_inode
(
struct
inode
*
vi
)
{
ntfs_debug
(
"Entering for inode 0x%lx."
,
vi
->
i_ino
);
NInoSetDirty
(
NTFS_I
(
vi
));
return
;
}
/**
* ntfs_commit_inode - write out a dirty inode
* @ni: inode to write out
...
...
@@ -2029,4 +1973,3 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr)
}
#endif
fs/ntfs/inode.h
View file @
aea571fc
...
...
@@ -2,7 +2,7 @@
* inode.h - Defines for inode structures NTFS Linux kernel driver. Part of
* the Linux-NTFS project.
*
* Copyright (c) 2001-200
3
Anton Altaparmakov
* Copyright (c) 2001-200
4
Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -10,13 +10,13 @@
* 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
* 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
* 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
*/
...
...
@@ -181,8 +181,22 @@ static inline void NInoClear##flag(ntfs_inode *ni) \
clear_bit(NI_##flag, &(ni)->state); \
}
/*
* As above for NInoTestSetFoo() and NInoTestClearFoo().
*/
#define TAS_NINO_FNS(flag) \
static inline int NInoTestSet##flag(ntfs_inode *ni) \
{ \
return test_and_set_bit(NI_##flag, &(ni)->state); \
} \
static inline int NInoTestClear##flag(ntfs_inode *ni) \
{ \
return test_and_clear_bit(NI_##flag, &(ni)->state); \
}
/* Emit the ntfs inode bitops functions. */
NINO_FNS
(
Dirty
)
TAS_NINO_FNS
(
Dirty
)
NINO_FNS
(
AttrList
)
NINO_FNS
(
AttrListNonResident
)
NINO_FNS
(
Attr
)
...
...
@@ -219,6 +233,30 @@ static inline struct inode *VFS_I(ntfs_inode *ni)
return
&
((
big_ntfs_inode
*
)
ni
)
->
vfs_inode
;
}
/**
* ntfs_attr - ntfs in memory attribute structure
* @mft_no: mft record number of the base mft record of this attribute
* @name: Unicode name of the attribute (NULL if unnamed)
* @name_len: length of @name in Unicode characters (0 if unnamed)
* @type: attribute type (see layout.h)
*
* This structure exists only to provide a small structure for the
* ntfs_{attr_}iget()/ntfs_test_inode()/ntfs_init_locked_inode() mechanism.
*
* NOTE: Elements are ordered by size to make the structure as compact as
* possible on all architectures.
*/
typedef
struct
{
unsigned
long
mft_no
;
uchar_t
*
name
;
u32
name_len
;
ATTR_TYPES
type
;
}
ntfs_attr
;
typedef
int
(
*
test_t
)(
struct
inode
*
,
void
*
);
extern
int
ntfs_test_inode
(
struct
inode
*
vi
,
ntfs_attr
*
na
);
extern
struct
inode
*
ntfs_iget
(
struct
super_block
*
sb
,
unsigned
long
mft_no
);
extern
struct
inode
*
ntfs_attr_iget
(
struct
inode
*
base_vi
,
ATTR_TYPES
type
,
uchar_t
*
name
,
u32
name_len
);
...
...
@@ -233,8 +271,6 @@ extern void ntfs_clear_extent_inode(ntfs_inode *ni);
extern
void
ntfs_read_inode_mount
(
struct
inode
*
vi
);
extern
void
ntfs_dirty_inode
(
struct
inode
*
vi
);
extern
void
ntfs_put_inode
(
struct
inode
*
vi
);
extern
int
ntfs_show_options
(
struct
seq_file
*
sf
,
struct
vfsmount
*
mnt
);
...
...
@@ -245,7 +281,6 @@ extern void ntfs_truncate(struct inode *vi);
extern
int
ntfs_setattr
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
);
#endif
#endif
/* _LINUX_NTFS_FS_INODE_H */
#endif
/* NTFS_RW */
#endif
/* _LINUX_NTFS_INODE_H */
fs/ntfs/mft.h
View file @
aea571fc
...
...
@@ -2,20 +2,20 @@
* mft.h - Defines for mft record handling in NTFS Linux kernel driver.
* Part of the Linux-NTFS project.
*
* Copyright (c) 2001
,2002
Anton Altaparmakov.
* Copyright (c) 2001
-2004
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
* 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
* 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
*/
...
...
@@ -43,7 +43,9 @@ static inline void unmap_extent_mft_record(ntfs_inode *ni)
return
;
}
/*
#ifdef NTFS_RW
/**
* flush_dcache_mft_record_page - flush_dcache_page() for mft records
* @ni: ntfs inode structure of mft record
*
...
...
@@ -57,5 +59,6 @@ static inline void flush_dcache_mft_record_page(ntfs_inode *ni)
flush_dcache_page
(
ni
->
page
);
}
#endif
/*
_LINUX_NTFS_MFT_H
*/
#endif
/*
NTFS_RW
*/
#endif
/* _LINUX_NTFS_MFT_H */
fs/ntfs/ntfs.h
View file @
aea571fc
...
...
@@ -2,7 +2,7 @@
* ntfs.h - Defines for NTFS Linux kernel driver. Part of the Linux-NTFS
* project.
*
* Copyright (c) 2001
,2002
Anton Altaparmakov.
* Copyright (c) 2001
-2004
Anton Altaparmakov.
* Copyright (C) 2002 Richard Russon.
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -180,11 +180,6 @@ extern int post_read_mst_fixup(NTFS_RECORD *b, const u32 size);
extern
int
pre_write_mst_fixup
(
NTFS_RECORD
*
b
,
const
u32
size
);
extern
void
post_write_mst_fixup
(
NTFS_RECORD
*
b
);
/* From fs/ntfs/time.c */
extern
inline
s64
utc2ntfs
(
const
time_t
time
);
extern
inline
s64
get_current_ntfs_time
(
void
);
extern
time_t
ntfs2utc
(
const
s64
time
);
/* From fs/ntfs/unistr.c */
extern
BOOL
ntfs_are_names_equal
(
const
uchar_t
*
s1
,
size_t
s1_len
,
const
uchar_t
*
s2
,
size_t
s2_len
,
...
...
fs/ntfs/super.c
View file @
aea571fc
This diff is collapsed.
Click to expand it.
fs/ntfs/time.
c
→
fs/ntfs/time.
h
View file @
aea571fc
/*
* time.
c - NTFS time conversion functions.
Part of the Linux-NTFS project.
* time.
h - NTFS time conversion functions.
Part of the Linux-NTFS project.
*
* Copyright (c) 2001 Anton Altaparmakov.
* Copyright (c) 2001
-2004
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
* 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
* 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
*/
#include <linux/sched.h>
/* For CURRENT_TIME. */
#ifndef _LINUX_NTFS_TIME_H
#define _LINUX_NTFS_TIME_H
#include <linux/time.h>
/* For current_kernel_time(). */
#include <asm/div64.h>
/* For do_div(). */
#include "
ntfs
.h"
#include "
endian
.h"
#define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000)
/**
* utc2ntfs - convert Linux time to NTFS time
* @t
ime: Linux time to convert to NTFS
* utc2ntfs - convert Linux
UTC
time to NTFS time
* @t
s: Linux UTC time to convert to NTFS time
*
* Convert the Linux
time @time to its corresponding NTFS time and return that
* in little endian format.
* Convert the Linux
UTC time @ts to its corresponding NTFS time and return
*
that
in little endian format.
*
* Linux stores time in a long at present and measures it as the number of
* 1-second intervals since 1st January 1970, 00:00:00 UTC.
* Linux stores time in a struct timespec consisting of a time_t (long at
* present) tv_sec and a long tv_nsec where tv_sec is the number of 1-second
* intervals since 1st January 1970, 00:00:00 UTC and tv_nsec is the number of
* 1-nano-second intervals since the value of tv_sec.
*
* NTFS uses Microsoft's standard time format which is stored in a s64 and is
* measured as the number of 100
nano-second intervals since 1st January 1601,
* measured as the number of 100
-
nano-second intervals since 1st January 1601,
* 00:00:00 UTC.
*/
inline
s64
utc2ntfs
(
const
time_t
time
)
static
inline
s64
utc2ntfs
(
const
struct
timespec
ts
)
{
/* Convert to 100ns intervals and then add the NTFS time offset. */
return
cpu_to_sle64
((
s64
)
time
*
10000000
+
NTFS_TIME_OFFSET
);
/*
* Convert the seconds to 100ns intervals, add the nano-seconds
* converted to 100ns intervals, and then add the NTFS time offset.
*/
return
cpu_to_sle64
((
s64
)
ts
.
tv_sec
*
10000000
+
ts
.
tv_nsec
/
100
+
NTFS_TIME_OFFSET
);
}
/**
...
...
@@ -52,31 +61,40 @@ inline s64 utc2ntfs(const time_t time)
* Get the current time from the Linux kernel, convert it to its corresponding
* NTFS time and return that in little endian format.
*/
inline
s64
get_current_ntfs_time
(
void
)
static
inline
s64
get_current_ntfs_time
(
void
)
{
/* ignores leap second */
return
utc2ntfs
(
get_seconds
())
+
xtime
.
tv_nsec
/
1000
;
return
utc2ntfs
(
current_kernel_time
());
}
/**
* ntfs2utc - convert NTFS time to Linux time
* @time:
NTFS time (little endian) to convert to Linux
* @time:
NTFS time (little endian) to convert to Linux UTC
*
* Convert the little endian NTFS time @time to its corresponding Linux
time
* and return that in cpu format.
* Convert the little endian NTFS time @time to its corresponding Linux
UTC
*
time
and return that in cpu format.
*
* Linux stores time in a long at present and measures it as the number of
* 1-second intervals since 1st January 1970, 00:00:00 UTC.
* Linux stores time in a struct timespec consisting of a time_t (long at
* present) tv_sec and a long tv_nsec where tv_sec is the number of 1-second
* intervals since 1st January 1970, 00:00:00 UTC and tv_nsec is the number of
* 1-nano-second intervals since the value of tv_sec.
*
* NTFS uses Microsoft's standard time format which is stored in a s64 and is
* measured as the number of 100 nano-second intervals since 1st January 1601,
* 00:00:00 UTC.
*/
inline
time_t
ntfs2utc
(
const
s64
time
)
static
inline
struct
timespec
ntfs2utc
(
const
s64
time
)
{
/* Subtract the NTFS time offset, then convert to 1s intervals. */
struct
timespec
ts
;
/* Subtract the NTFS time offset. */
s64
t
=
sle64_to_cpu
(
time
)
-
NTFS_TIME_OFFSET
;
do_div
(
t
,
10000000
);
return
(
time_t
)
t
;
/*
* Convert the time to 1-second intervals and the remainder to
* 1-nano-second intervals.
*/
ts
.
tv_nsec
=
do_div
(
t
,
10000000
)
*
100
;
ts
.
tv_sec
=
t
;
return
ts
;
}
#endif
/* _LINUX_NTFS_TIME_H */
fs/ntfs/volume.h
View file @
aea571fc
...
...
@@ -2,7 +2,7 @@
* volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
* of the Linux-NTFS project.
*
* Copyright (c) 2001
,2002
Anton Altaparmakov.
* Copyright (c) 2001
-2004
Anton Altaparmakov.
* Copyright (c) 2002 Richard Russon.
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -10,13 +10,13 @@
* 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
* 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
* 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
*/
...
...
@@ -25,6 +25,7 @@
#define _LINUX_NTFS_VOLUME_H
#include "types.h"
#include "layout.h"
/*
* The NTFS in memory super block structure.
...
...
@@ -44,7 +45,7 @@ typedef struct {
LCN
nr_blocks
;
/* Number of NTFS_BLOCK_SIZE bytes
sized blocks on the device. */
/* Configuration provided by user at mount time. */
unsigned
long
flags
;
/* Miscellaneous flags, see
above
. */
unsigned
long
flags
;
/* Miscellaneous flags, see
below
. */
uid_t
uid
;
/* uid that files will be mounted as. */
gid_t
gid
;
/* gid that files will be mounted as. */
mode_t
fmask
;
/* The mask for file permissions. */
...
...
@@ -82,14 +83,20 @@ typedef struct {
unsigned
long
nr_mft_records
;
/* Number of mft records == number of
bits in mft bitmap. */
#ifdef NTFS_RW
struct
inode
*
mftmirr_ino
;
/* The VFS inode of $MFTMirr. */
int
mftmirr_size
;
/* Size of mft mirror in mft records. */
#endif
/* NTFS_RW */
struct
inode
*
lcnbmp_ino
;
/* The VFS inode of $Bitmap. */
struct
rw_semaphore
lcnbmp_lock
;
/* Lock for serializing accesses to the
cluster bitmap ($Bitmap/$DATA). */
struct
inode
*
vol_ino
;
/* The VFS inode of $Volume. */
unsigned
long
vol_flags
;
/* Volume flags (VOLUME_*)
. */
VOLUME_FLAGS
vol_flags
;
/* Volume flags
. */
u8
major_ver
;
/* Ntfs major version of volume. */
u8
minor_ver
;
/* Ntfs minor version of volume. */
struct
inode
*
root_ino
;
/* The VFS inode of the root
directory. */
struct
inode
*
secure_ino
;
/* The VFS inode of $Secure (NTFS3.0+
...
...
@@ -133,4 +140,3 @@ NVOL_FNS(ShowSystemFiles)
NVOL_FNS
(
CaseSensitive
)
#endif
/* _LINUX_NTFS_VOLUME_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment