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
949fc8d1
Commit
949fc8d1
authored
Sep 13, 2004
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Plain Diff
Merge
ssh://linux-ntfs@bkbits.net/ntfs-2.6-devel
into cantab.net:/home/src/ntfs-2.6-devel
parents
582f31c5
8b9a15be
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
19 deletions
+20
-19
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+5
-0
fs/ntfs/Makefile
fs/ntfs/Makefile
+1
-1
fs/ntfs/inode.c
fs/ntfs/inode.c
+2
-6
fs/ntfs/super.c
fs/ntfs/super.c
+12
-9
fs/ntfs/volume.h
fs/ntfs/volume.h
+0
-3
No files found.
fs/ntfs/ChangeLog
View file @
949fc8d1
...
...
@@ -21,6 +21,11 @@ ToDo/Notes:
- Enable the code for setting the NT4 compatibility flag when we start
making NTFS 1.2 specific modifications.
2.1.18-WIP
- Remove vol->nr_mft_records as it was pretty meaningless and optimize
the calculation of total/free inodes as used by statfs().
2.1.17 - Fix bugs in mount time error code paths and other updates.
- Implement bitmap modification code (fs/ntfs/bitmap.[hc]). This
...
...
fs/ntfs/Makefile
View file @
949fc8d1
...
...
@@ -6,7 +6,7 @@ ntfs-objs := aops.o attrib.o collate.o compress.o debug.o dir.o file.o \
index.o inode.o mft.o mst.o namei.o super.o sysctl.o unistr.o
\
upcase.o
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.1
7
\"
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.1
8-WIP
\"
ifeq
($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS
+=
-DDEBUG
...
...
fs/ntfs/inode.c
View file @
949fc8d1
...
...
@@ -1900,8 +1900,6 @@ int ntfs_read_inode_mount(struct inode *vi)
/* Are we in the first extent? */
if
(
!
next_vcn
)
{
u64
ll
;
if
(
attr
->
data
.
non_resident
.
lowest_vcn
)
{
ntfs_error
(
sb
,
"First extent of $DATA "
"attribute has non zero "
...
...
@@ -1920,17 +1918,15 @@ int ntfs_read_inode_mount(struct inode *vi)
non_resident
.
initialized_size
);
ni
->
allocated_size
=
sle64_to_cpu
(
attr
->
data
.
non_resident
.
allocated_size
);
/* Set the number of mft records. */
ll
=
vi
->
i_size
>>
vol
->
mft_record_size_bits
;
/*
* Verify the number of mft records does not exceed
* 2^32 - 1.
*/
if
(
ll
>=
(
1ULL
<<
32
))
{
if
((
vi
->
i_size
>>
vol
->
mft_record_size_bits
)
>=
(
1ULL
<<
32
))
{
ntfs_error
(
sb
,
"$MFT is too big! Aborting."
);
goto
put_err_out
;
}
vol
->
nr_mft_records
=
ll
;
/*
* We have got the first extent of the runlist for
* $MFT which means it is now relatively safe to call
...
...
fs/ntfs/super.c
View file @
949fc8d1
...
...
@@ -2013,7 +2013,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
*/
static
unsigned
long
__get_nr_free_mft_records
(
ntfs_volume
*
vol
)
{
s64
nr_free
=
vol
->
nr_mft_records
;
s64
nr_free
;
u32
*
kaddr
;
struct
address_space
*
mapping
=
vol
->
mftbmp_ino
->
i_mapping
;
filler_t
*
readpage
=
(
filler_t
*
)
mapping
->
a_ops
->
readpage
;
...
...
@@ -2022,13 +2022,16 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol)
unsigned
int
max_size
;
ntfs_debug
(
"Entering."
);
/* Number of mft records in file system (at this point in time). */
nr_free
=
vol
->
mft_ino
->
i_size
>>
vol
->
mft_record_size_bits
;
/*
* Convert the
number of bits into bytes rounded up, then convert into
*
multiples of PAGE_CACHE_SIZE, rounding up so that if we have on
e
* full and one partial page max_index = 2.
* Convert the
maximum number of set bits into bytes rounded up, then
*
convert into multiples of PAGE_CACHE_SIZE, rounding up so that if w
e
*
have one
full and one partial page max_index = 2.
*/
max_index
=
(((
vol
->
nr_mft_records
+
7
)
>>
3
)
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
max_index
=
((((
NTFS_I
(
vol
->
mft_ino
)
->
initialized_size
>>
vol
->
mft_record_size_bits
)
+
7
)
>>
3
)
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
/* Use multiples of 4 bytes. */
max_size
=
PAGE_CACHE_SIZE
>>
2
;
ntfs_debug
(
"Reading $MFT/$BITMAP, max_index = 0x%lx, max_size = "
...
...
@@ -2123,9 +2126,9 @@ static int ntfs_statfs(struct super_block *sb, struct kstatfs *sfs)
sfs
->
f_bavail
=
sfs
->
f_bfree
=
size
;
/* Serialize accesses to the inode bitmap. */
down_read
(
&
vol
->
mftbmp_lock
);
/*
Total file nodes in file system (at this mome
nt in time). */
sfs
->
f_files
=
vol
->
mft_ino
->
i_size
>>
vol
->
mft_record_size_bits
;
/* Free
file
nodes in fs (based on current total count). */
/*
Number of inodes in file system (at this poi
nt in time). */
sfs
->
f_files
=
vol
->
mft_ino
->
i_size
>>
vol
->
mft_record_size_bits
;
/* Free
i
nodes in fs (based on current total count). */
sfs
->
f_ffree
=
__get_nr_free_mft_records
(
vol
);
up_read
(
&
vol
->
mftbmp_lock
);
/*
...
...
fs/ntfs/volume.h
View file @
949fc8d1
...
...
@@ -95,9 +95,6 @@ typedef struct {
struct
inode
*
mftbmp_ino
;
/* Attribute inode for $MFT/$BITMAP. */
struct
rw_semaphore
mftbmp_lock
;
/* Lock for serializing accesses to the
mft record bitmap ($MFT/$BITMAP). */
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. */
...
...
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