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
Kirill Smelkov
linux
Commits
016b9c5f
Commit
016b9c5f
authored
Jun 30, 2002
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Plain Diff
Merge cantab.net:/usr/src/tng-2.0.11 into cantab.net:/usr/src/tng-2.0.13
parents
59b1ec78
8d9eae15
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
459 additions
and
416 deletions
+459
-416
Documentation/filesystems/ntfs.txt
Documentation/filesystems/ntfs.txt
+6
-0
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+35
-6
fs/ntfs/Makefile
fs/ntfs/Makefile
+1
-1
fs/ntfs/aops.c
fs/ntfs/aops.c
+115
-297
fs/ntfs/inode.c
fs/ntfs/inode.c
+227
-27
fs/ntfs/inode.h
fs/ntfs/inode.h
+4
-2
fs/ntfs/mft.c
fs/ntfs/mft.c
+2
-3
fs/ntfs/namei.c
fs/ntfs/namei.c
+14
-10
fs/ntfs/super.c
fs/ntfs/super.c
+50
-58
fs/ntfs/volume.h
fs/ntfs/volume.h
+5
-12
No files found.
Documentation/filesystems/ntfs.txt
View file @
016b9c5f
...
...
@@ -247,6 +247,12 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
2.0.13:
- Internal changes towards using iget5_locked() in preparation for
fake inodes and small cleanups to ntfs_volume structure.
2.0.12:
- Internal cleanups in address space operations made possible by the
changes introduced in the previous release.
2.0.11:
- Internal updates and cleanups introducing the first step towards
fake inode based attribute i/o.
...
...
fs/ntfs/ChangeLog
View file @
016b9c5f
...
...
@@ -6,7 +6,7 @@ ToDo:
user open()s a file with i_size > s_maxbytes? Should read_inode()
truncate the visible i_size? Will the user just get -E2BIG (or
whatever) on open()? Or will (s)he be able to open() but lseek() and
read() will fail when s_maxbytes is reached? -> Investigate this
!
read() will fail when s_maxbytes is reached? -> Investigate this
.
- Implement/allow non-resident index bitmaps in dir.c::ntfs_readdir()
and then also consider initialized_size w.r.t. the bitmaps, etc.
- vcn_to_lcn() should somehow return the correct pointer within the
...
...
@@ -17,14 +17,43 @@ ToDo:
- Consider if ntfs_file_read_compressed_block() shouldn't be coping
with initialized_size < data_size. I don't think it can happen but
it requires more careful consideration.
- CLEANUP: Modularise and reuse code in aops.c. At the moment we have
several copies of almost identicall functions and the functions are
quite big. Modularising them a bit, e.g. a-la get_block(), will make
them cleaner and make code reuse easier.
- CLEANUP: At the moment we have two copies of almost identical
functions in aops.c, can merge them once fake inode address space
based attribute i/o is further developed.
- CLEANUP: Modularising code in aops.c a bit, e.g. a-la get_block(),
will be cleaner and make code reuse easier.
- Modify ntfs_read_locked_inode() to return an error code and update
callers, i.e. ntfs_iget(), to pass that error code up instead of just
using -EIO.
- Enable NFS exporting of NTFS.
- Use iget5_locked() and friends instead of conventional iget().
- Use fake inodes for address space i/o.
2.0.13 - Use iget5_locked() in preparation for fake inodes and small cleanups.
- Remove nr_mft_bits and the now superfluous union with nr_mft_records
from ntfs_volume structure.
- Remove nr_lcn_bits and the now superfluous union with nr_clusters
from ntfs_volume structure.
- Use iget5_locked() and friends instead of conventional iget(). Wrap
the call in fs/ntfs/inode.c::ntfs_iget() and update callers of iget()
to use ntfs_iget(). Leave only one iget() call at mount time so we
don't need an ntfs_iget_mount().
- Change fs/ntfs/inode.c::ntfs_new_extent_inode() to take mft_no as an
additional argument.
2.0.12 - Initial cleanup of address space operations following 2.0.11 changes.
- Merge fs/ntfs/aops.c::end_buffer_read_mst_async() and
fs/ntfs/aops.c::end_buffer_read_file_async() into one function
fs/ntfs/aops.c::end_buffer_read_attr_async() using NInoMstProtected()
to determine whether to apply mst fixups or not.
- Above change allows merging fs/ntfs/aops.c::ntfs_file_read_block()
and fs/ntfs/aops.c::ntfs_mst_readpage() into one function
fs/ntfs/aops.c::ntfs_attr_read_block(). Also, create a tiny wrapper
fs/ntfs/aops.c::ntfs_mst_readpage() to transform the parameters from
the VFS readpage function prototype to the ntfs_attr_read_block()
function prototype.
2.0.11 - Initial preparations for fake inode based attribute i/o.
- Move definition of ntfs_inode_state_bits to fs/ntfs/inode.h and
...
...
fs/ntfs/Makefile
View file @
016b9c5f
...
...
@@ -5,7 +5,7 @@ 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
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.0.1
1
\"
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.0.1
3
\"
ifeq
($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS
+=
-DDEBUG
...
...
fs/ntfs/aops.c
View file @
016b9c5f
This diff is collapsed.
Click to expand it.
fs/ntfs/inode.c
View file @
016b9c5f
This diff is collapsed.
Click to expand it.
fs/ntfs/inode.h
View file @
016b9c5f
...
...
@@ -231,14 +231,16 @@ static inline struct inode *VFS_I(ntfs_inode *ni)
return
&
((
big_ntfs_inode
*
)
ni
)
->
vfs_inode
;
}
extern
struct
inode
*
ntfs_iget
(
struct
super_block
*
sb
,
unsigned
long
mft_no
);
extern
struct
inode
*
ntfs_alloc_big_inode
(
struct
super_block
*
sb
);
extern
void
ntfs_destroy_big_inode
(
struct
inode
*
inode
);
extern
void
ntfs_clear_big_inode
(
struct
inode
*
vi
);
extern
ntfs_inode
*
ntfs_new_extent_inode
(
struct
super_block
*
sb
);
extern
ntfs_inode
*
ntfs_new_extent_inode
(
struct
super_block
*
sb
,
unsigned
long
mft_no
);
extern
void
ntfs_clear_extent_inode
(
ntfs_inode
*
ni
);
extern
void
ntfs_read_inode
(
struct
inode
*
vi
);
extern
void
ntfs_read_inode_mount
(
struct
inode
*
vi
);
extern
void
ntfs_dirty_inode
(
struct
inode
*
vi
);
...
...
fs/ntfs/mft.c
View file @
016b9c5f
...
...
@@ -102,7 +102,7 @@ extern int ntfs_mst_readpage(struct file *, struct page *);
* ntfs_mft_aops - address space operations for access to $MFT
*
* Address space operations for access to $MFT. This allows us to simply use
*
read_cache_page() in map_mft_record
().
*
ntfs_map_page() in map_mft_record_page
().
*/
struct
address_space_operations
ntfs_mft_aops
=
{
writepage:
NULL
,
/* Write dirty page to disk. */
...
...
@@ -417,14 +417,13 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
return
m
;
}
/* Record wasn't there. Get a new ntfs inode and initialize it. */
ni
=
ntfs_new_extent_inode
(
base_ni
->
vol
->
sb
);
ni
=
ntfs_new_extent_inode
(
base_ni
->
vol
->
sb
,
mft_no
);
if
(
!
ni
)
{
up
(
&
base_ni
->
extent_lock
);
atomic_dec
(
&
base_ni
->
count
);
return
ERR_PTR
(
-
ENOMEM
);
}
ni
->
vol
=
base_ni
->
vol
;
ni
->
mft_no
=
mft_no
;
ni
->
seq_no
=
seq_no
;
ni
->
nr_extents
=
-
1
;
ni
->
_INE
(
base_ntfs_ino
)
=
base_ni
;
...
...
fs/ntfs/namei.c
View file @
016b9c5f
...
...
@@ -38,8 +38,8 @@
* supplying the name of the inode in @dent->d_name.name. ntfs_lookup()
* converts the name to Unicode and walks the contents of the directory inode
* @dir_ino looking for the converted Unicode name. If the name is found in the
* directory, the corresponding inode is loaded by calling
iget() on its inode
* number and the inode is associated with the dentry @dent via a call to
* directory, the corresponding inode is loaded by calling
ntfs_iget() on its
*
inode
number and the inode is associated with the dentry @dent via a call to
* d_add().
*
* If the name is not found in the directory, a NULL inode is inserted into the
...
...
@@ -111,9 +111,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent)
kmem_cache_free
(
ntfs_name_cache
,
uname
);
if
(
!
IS_ERR_MREF
(
mref
))
{
dent_ino
=
MREF
(
mref
);
ntfs_debug
(
"Found inode 0x%lx. Calling iget."
,
dent_ino
);
dent_inode
=
iget
(
vol
->
sb
,
dent_ino
);
if
(
dent_inode
)
{
ntfs_debug
(
"Found inode 0x%lx. Calling
ntfs_
iget."
,
dent_ino
);
dent_inode
=
ntfs_
iget
(
vol
->
sb
,
dent_ino
);
if
(
likely
(
!
IS_ERR
(
dent_inode
))
)
{
/* Consistency check. */
if
(
MSEQNO
(
mref
)
==
NTFS_I
(
dent_inode
)
->
seq_no
||
dent_ino
==
FILE_MFT
)
{
...
...
@@ -132,16 +132,19 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent)
ntfs_error
(
vol
->
sb
,
"Found stale reference to inode "
"0x%lx (reference sequence number = "
"0x%x, inode sequence number = 0x%x, "
"returning -E
ACCES
. Run chkdsk."
,
"returning -E
IO
. Run chkdsk."
,
dent_ino
,
MSEQNO
(
mref
),
NTFS_I
(
dent_inode
)
->
seq_no
);
iput
(
dent_inode
);
dent_inode
=
ERR_PTR
(
-
EIO
);
}
else
ntfs_error
(
vol
->
sb
,
"iget(0x%lx) failed, returning "
"-EACCES."
,
dent_ino
);
ntfs_error
(
vol
->
sb
,
"ntfs_iget(0x%lx) failed with "
"error code %li."
,
dent_ino
,
PTR_ERR
(
dent_inode
));
if
(
name
)
kfree
(
name
);
return
ERR_PTR
(
-
EACCES
);
/* Return the error code. */
return
(
struct
dentry
*
)
dent_inode
;
}
/* It is guaranteed that name is no longer allocated at this point. */
if
(
MREF_ERR
(
mref
)
==
-
ENOENT
)
{
...
...
@@ -256,7 +259,8 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent)
BUG_ON
(
real_dent
->
d_inode
!=
dent_inode
);
/*
* Already have the inode and the dentry attached, decrement
* the reference count to balance the iget() we did earlier on.
* the reference count to balance the ntfs_iget() we did
* earlier on.
*/
iput
(
dent_inode
);
return
real_dent
;
...
...
fs/ntfs/super.c
View file @
016b9c5f
This diff is collapsed.
Click to expand it.
fs/ntfs/volume.h
View file @
016b9c5f
...
...
@@ -3,7 +3,7 @@
* of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov.
* Copyright (
C
) 2002 Richard Russon.
* 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
...
...
@@ -89,10 +89,8 @@ typedef struct {
u32
index_record_size
;
/* in bytes */
u32
index_record_size_mask
;
/* index_record_size - 1 */
u8
index_record_size_bits
;
/* log2(index_record_size) */
union
{
LCN
nr_clusters
;
/* Volume size in clusters. */
LCN
nr_lcn_bits
;
/* Number of bits in lcn bitmap. */
}
SN
(
vcl
);
LCN
nr_clusters
;
/* Volume size in clusters == number of
bits in lcn bitmap. */
LCN
mft_lcn
;
/* Cluster location of mft data. */
LCN
mftmirr_lcn
;
/* Cluster location of copy of mft. */
u64
serial_no
;
/* The volume serial number. */
...
...
@@ -104,10 +102,8 @@ typedef struct {
struct
inode
*
mft_ino
;
/* The VFS inode of $MFT. */
struct
rw_semaphore
mftbmp_lock
;
/* Lock for serializing accesses to the
mft record bitmap ($MFT/$BITMAP). */
union
{
unsigned
long
nr_mft_records
;
/* Number of mft records. */
unsigned
long
nr_mft_bits
;
/* Number of bits in mft bitmap. */
}
SN
(
vmm
);
unsigned
long
nr_mft_records
;
/* Number of mft records == number of
bits in mft bitmap. */
struct
address_space
mftbmp_mapping
;
/* Page cache for $MFT/$BITMAP. */
run_list
mftbmp_rl
;
/* Run list for $MFT/$BITMAP. */
s64
mftbmp_size
;
/* Data size of $MFT/$BITMAP. */
...
...
@@ -128,8 +124,5 @@ typedef struct {
struct
nls_table
*
nls_map
;
}
ntfs_volume
;
#define _VCL(X) SC(vcl,X)
#define _VMM(X) SC(vmm,X)
#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