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
2cb5b6be
Commit
2cb5b6be
authored
Feb 24, 2006
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6
parents
329dda08
1cf3109f
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
262 additions
and
137 deletions
+262
-137
Documentation/filesystems/ntfs.txt
Documentation/filesystems/ntfs.txt
+6
-0
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+27
-9
fs/ntfs/Makefile
fs/ntfs/Makefile
+1
-1
fs/ntfs/aops.c
fs/ntfs/aops.c
+8
-10
fs/ntfs/file.c
fs/ntfs/file.c
+5
-5
fs/ntfs/inode.c
fs/ntfs/inode.c
+39
-10
fs/ntfs/layout.h
fs/ntfs/layout.h
+18
-7
fs/ntfs/mft.c
fs/ntfs/mft.c
+4
-4
fs/ntfs/ntfs.h
fs/ntfs/ntfs.h
+5
-5
fs/ntfs/super.c
fs/ntfs/super.c
+132
-65
fs/ntfs/upcase.c
fs/ntfs/upcase.c
+4
-6
fs/ntfs/volume.h
fs/ntfs/volume.h
+13
-15
No files found.
Documentation/filesystems/ntfs.txt
View file @
2cb5b6be
...
...
@@ -457,6 +457,12 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
2.1.26:
- Implement support for sector sizes above 512 bytes (up to the maximum
supported by NTFS which is 4096 bytes).
- Enhance support for NTFS volumes which were supported by Windows but
not by Linux due to invalid attribute list attribute flags.
- A few minor updates and bug fixes.
2.1.25:
- Write support is now extended with write(2) being able to both
overwrite existing file data and to extend files. Also, if a write
...
...
fs/ntfs/ChangeLog
View file @
2cb5b6be
ToDo/Notes:
- Find and fix bugs.
- The only places in the kernel where a file is resized are
ntfs_file_write*() and ntfs_truncate() for both of which i_
sem
is
ntfs_file_write*() and ntfs_truncate() for both of which i_
mutex
is
held. Just have to be careful in read-/writepage and other helpers
not running under i_
sem that we play nice..
. Also need to be careful
not running under i_
mutex that we play nice
. Also need to be careful
with initialized_size extension in ntfs_file_write*() and writepage.
UPDATE: The only things that need to be checked are the compressed
write and the other attribute resize/write cases like index
...
...
@@ -19,6 +19,24 @@ ToDo/Notes:
- Enable the code for setting the NT4 compatibility flag when we start
making NTFS 1.2 specific modifications.
2.1.26 - Minor bug fixes and updates.
- Fix a potential overflow in file.c where a cast to s64 was missing in
a left shift of a page index.
- The struct inode has had its i_sem semaphore changed to a mutex named
i_mutex.
- We have struct kmem_cache now so use it instead of the typedef
kmem_cache_t. (Pekka Enberg)
- Implement support for sector sizes above 512 bytes (up to the maximum
supported by NTFS which is 4096 bytes).
- Do more detailed reporting of why we cannot mount read-write by
special casing the VOLUME_MODIFIED_BY_CHKDSK flag.
- Miscellaneous updates to layout.h.
- Cope with attribute list attribute having invalid flags. Windows
copes with this and even chkdsk does not detect or fix this so we
have to cope with it, too. Thanks to Pawel Kot for reporting the
problem.
2.1.25 - (Almost) fully implement write(2) and truncate(2).
- Change ntfs_map_runlist_nolock(), ntfs_attr_find_vcn_nolock() and
...
...
@@ -373,7 +391,7 @@ ToDo/Notes:
single one of them had an mst error. (Thanks to Ken MacFerrin for
the bug report.)
- Fix error handling in fs/ntfs/quota.c::ntfs_mark_quotas_out_of_date()
where we failed to release i_
sem
on the $Quota/$Q attribute inode.
where we failed to release i_
mutex
on the $Quota/$Q attribute inode.
- Fix bug in handling of bad inodes in fs/ntfs/namei.c::ntfs_lookup().
- Add mapping of unmapped buffers to all remaining code paths, i.e.
fs/ntfs/aops.c::ntfs_write_mst_block(), mft.c::ntfs_sync_mft_mirror(),
...
...
@@ -874,7 +892,7 @@ ToDo/Notes:
clusters. (Philipp Thomas)
- attrib.c::load_attribute_list(): Fix bug when initialized_size is a
multiple of the block_size but not the cluster size. (Szabolcs
Szakacsits
<szaka@sienet.hu>
)
Szakacsits)
2.1.2 - Important bug fixes aleviating the hangs in statfs.
...
...
@@ -884,7 +902,7 @@ ToDo/Notes:
- Add handling for initialized_size != data_size in compressed files.
- Reduce function local stack usage from 0x3d4 bytes to just noise in
fs/ntfs/upcase.c. (Randy Dunlap
<rdunlap@xenotime.net>
)
fs/ntfs/upcase.c. (Randy Dunlap)
- Remove compiler warnings for newer gcc.
- Pages are no longer kmapped by mm/filemap.c::generic_file_write()
around calls to ->{prepare,commit}_write. Adapt NTFS appropriately
...
...
@@ -1201,11 +1219,11 @@ ToDo/Notes:
the kernel. We probably want a kernel generic init_address_space()
function...
- Drop BKL from ntfs_readdir() after consultation with Al Viro. The
only caller of ->readdir() is vfs_readdir() which holds i_
sem during
the call, and i_sem is sufficient protection against changes in the
directory inode (including ->i_size).
only caller of ->readdir() is vfs_readdir() which holds i_
mutex
during the call, and i_mutex is sufficient protection against changes
in the
directory inode (including ->i_size).
- Use generic_file_llseek() for directories (as opposed to
default_llseek()) as this downs i_
sem
instead of the BKL which is
default_llseek()) as this downs i_
mutex
instead of the BKL which is
what we now need for exclusion against ->f_pos changes considering we
no longer take the BKL in ntfs_readdir().
...
...
fs/ntfs/Makefile
View file @
2cb5b6be
...
...
@@ -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 runlist.o super.o sysctl.o
\
unistr.o upcase.o
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.2
5
\"
EXTRA_CFLAGS
=
-DNTFS_VERSION
=
\"
2.1.2
6
\"
ifeq
($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS
+=
-DDEBUG
...
...
fs/ntfs/aops.c
View file @
2cb5b6be
...
...
@@ -2,7 +2,7 @@
* aops.c - NTFS kernel address space operations and page cache handling.
* Part of the Linux-NTFS project.
*
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (c) 2001-200
6
Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -200,8 +200,8 @@ static int ntfs_read_block(struct page *page)
/* $MFT/$DATA must have its complete runlist in memory at all times. */
BUG_ON
(
!
ni
->
runlist
.
rl
&&
!
ni
->
mft_no
&&
!
NInoAttr
(
ni
));
blocksize
_bits
=
VFS_I
(
ni
)
->
i_blkbits
;
blocksize
=
1
<<
blocksize_bits
;
blocksize
=
vol
->
sb
->
s_blocksize
;
blocksize
_bits
=
vol
->
sb
->
s_
blocksize_bits
;
if
(
!
page_has_buffers
(
page
))
{
create_empty_buffers
(
page
,
blocksize
,
0
);
...
...
@@ -569,10 +569,8 @@ static int ntfs_write_block(struct page *page, struct writeback_control *wbc)
BUG_ON
(
!
NInoNonResident
(
ni
));
BUG_ON
(
NInoMstProtected
(
ni
));
blocksize_bits
=
vi
->
i_blkbits
;
blocksize
=
1
<<
blocksize_bits
;
blocksize
=
vol
->
sb
->
s_blocksize
;
blocksize_bits
=
vol
->
sb
->
s_blocksize_bits
;
if
(
!
page_has_buffers
(
page
))
{
BUG_ON
(
!
PageUptodate
(
page
));
create_empty_buffers
(
page
,
blocksize
,
...
...
@@ -949,8 +947,8 @@ static int ntfs_write_mst_block(struct page *page,
*/
BUG_ON
(
!
(
is_mft
||
S_ISDIR
(
vi
->
i_mode
)
||
(
NInoAttr
(
ni
)
&&
ni
->
type
==
AT_INDEX_ALLOCATION
)));
bh_size
_bits
=
vi
->
i_blkbits
;
bh_size
=
1
<<
bh_
size_bits
;
bh_size
=
vol
->
sb
->
s_blocksize
;
bh_size
_bits
=
vol
->
sb
->
s_block
size_bits
;
max_bhs
=
PAGE_CACHE_SIZE
/
bh_size
;
BUG_ON
(
!
max_bhs
);
BUG_ON
(
max_bhs
>
MAX_BUF_PER_PAGE
);
...
...
@@ -1596,7 +1594,7 @@ void mark_ntfs_record_dirty(struct page *page, const unsigned int ofs) {
BUG_ON
(
!
PageUptodate
(
page
));
end
=
ofs
+
ni
->
itype
.
index
.
block_size
;
bh_size
=
1
<<
VFS_I
(
ni
)
->
i_blkbits
;
bh_size
=
VFS_I
(
ni
)
->
i_sb
->
s_blocksize
;
spin_lock
(
&
mapping
->
private_lock
);
if
(
unlikely
(
!
page_has_buffers
(
page
)))
{
spin_unlock
(
&
mapping
->
private_lock
);
...
...
fs/ntfs/file.c
View file @
2cb5b6be
/*
* file.c - NTFS kernel file operations. Part of the Linux-NTFS project.
*
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (c) 2001-200
6
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
...
...
@@ -248,7 +248,7 @@ static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size,
* enough to make ntfs_writepage() work.
*/
write_lock_irqsave
(
&
ni
->
size_lock
,
flags
);
ni
->
initialized_size
=
(
index
+
1
)
<<
PAGE_CACHE_SHIFT
;
ni
->
initialized_size
=
(
s64
)(
index
+
1
)
<<
PAGE_CACHE_SHIFT
;
if
(
ni
->
initialized_size
>
new_init_size
)
ni
->
initialized_size
=
new_init_size
;
write_unlock_irqrestore
(
&
ni
->
size_lock
,
flags
);
...
...
@@ -529,8 +529,8 @@ static int ntfs_prepare_pages_for_non_resident_write(struct page **pages,
"index 0x%lx, nr_pages 0x%x, pos 0x%llx, bytes 0x%zx."
,
vi
->
i_ino
,
ni
->
type
,
pages
[
0
]
->
index
,
nr_pages
,
(
long
long
)
pos
,
bytes
);
blocksize
_bits
=
vi
->
i_blkbits
;
blocksize
=
1
<<
blocksize_bits
;
blocksize
=
vol
->
sb
->
s_blocksize
;
blocksize
_bits
=
vol
->
sb
->
s_
blocksize_bits
;
u
=
0
;
do
{
struct
page
*
page
=
pages
[
u
];
...
...
@@ -1525,7 +1525,7 @@ static inline int ntfs_commit_pages_after_non_resident_write(
vi
=
pages
[
0
]
->
mapping
->
host
;
ni
=
NTFS_I
(
vi
);
blocksize
=
1
<<
vi
->
i_blkbits
;
blocksize
=
vi
->
i_sb
->
s_blocksize
;
end
=
pos
+
bytes
;
u
=
0
;
do
{
...
...
fs/ntfs/inode.c
View file @
2cb5b6be
...
...
@@ -677,13 +677,28 @@ static int ntfs_read_locked_inode(struct inode *vi)
ntfs_debug
(
"Attribute list found in inode 0x%lx."
,
vi
->
i_ino
);
NInoSetAttrList
(
ni
);
a
=
ctx
->
attr
;
if
(
a
->
flags
&
ATTR_IS_ENCRYPTED
||
a
->
flags
&
ATTR_COMPRESSION_MASK
||
a
->
flags
&
ATTR_IS_SPARSE
)
{
if
(
a
->
flags
&
ATTR_COMPRESSION_MASK
)
{
ntfs_error
(
vi
->
i_sb
,
"Attribute list attribute is "
"compressed
/encrypted/sparse
."
);
"compressed."
);
goto
unm_err_out
;
}
if
(
a
->
flags
&
ATTR_IS_ENCRYPTED
||
a
->
flags
&
ATTR_IS_SPARSE
)
{
if
(
a
->
non_resident
)
{
ntfs_error
(
vi
->
i_sb
,
"Non-resident attribute "
"list attribute is encrypted/"
"sparse."
);
goto
unm_err_out
;
}
ntfs_warning
(
vi
->
i_sb
,
"Resident attribute list "
"attribute in inode 0x%lx is marked "
"encrypted/sparse which is not true. "
"However, Windows allows this and "
"chkdsk does not detect or correct it "
"so we will just ignore the invalid "
"flags and pretend they are not set."
,
vi
->
i_ino
);
}
/* Now allocate memory for the attribute list. */
ni
->
attr_list_size
=
(
u32
)
ntfs_attr_size
(
a
);
ni
->
attr_list
=
ntfs_malloc_nofs
(
ni
->
attr_list_size
);
...
...
@@ -1809,19 +1824,33 @@ int ntfs_read_inode_mount(struct inode *vi)
}
else
/* if (!err) */
{
ATTR_LIST_ENTRY
*
al_entry
,
*
next_al_entry
;
u8
*
al_end
;
static
const
char
*
es
=
" Not allowed. $MFT is corrupt. "
"You should run chkdsk."
;
ntfs_debug
(
"Attribute list attribute found in $MFT."
);
NInoSetAttrList
(
ni
);
a
=
ctx
->
attr
;
if
(
a
->
flags
&
ATTR_IS_ENCRYPTED
||
a
->
flags
&
ATTR_COMPRESSION_MASK
||
a
->
flags
&
ATTR_IS_SPARSE
)
{
if
(
a
->
flags
&
ATTR_COMPRESSION_MASK
)
{
ntfs_error
(
sb
,
"Attribute list attribute is "
"compressed/encrypted/sparse. Not "
"allowed. $MFT is corrupt. You should "
"run chkdsk."
);
"compressed.%s"
,
es
);
goto
put_err_out
;
}
if
(
a
->
flags
&
ATTR_IS_ENCRYPTED
||
a
->
flags
&
ATTR_IS_SPARSE
)
{
if
(
a
->
non_resident
)
{
ntfs_error
(
sb
,
"Non-resident attribute list "
"attribute is encrypted/"
"sparse.%s"
,
es
);
goto
put_err_out
;
}
ntfs_warning
(
sb
,
"Resident attribute list attribute "
"in $MFT system file is marked "
"encrypted/sparse which is not true. "
"However, Windows allows this and "
"chkdsk does not detect or correct it "
"so we will just ignore the invalid "
"flags and pretend they are not set."
);
}
/* Now allocate memory for the attribute list. */
ni
->
attr_list_size
=
(
u32
)
ntfs_attr_size
(
a
);
ni
->
attr_list
=
ntfs_malloc_nofs
(
ni
->
attr_list_size
);
...
...
fs/ntfs/layout.h
View file @
2cb5b6be
...
...
@@ -838,15 +838,19 @@ enum {
F_A_DEVICE, F_A_DIRECTORY, F_A_SPARSE_FILE, F_A_REPARSE_POINT,
F_A_COMPRESSED, and F_A_ENCRYPTED and preserves the rest. This mask
is used to to obtain all flags that are valid for setting. */
/*
* The following flag
s are
only present in the FILE_NAME attribute (in
* The following flag
is
only present in the FILE_NAME attribute (in
* the field file_attributes).
*/
FILE_ATTR_DUP_FILE_NAME_INDEX_PRESENT
=
const_cpu_to_le32
(
0x10000000
),
/* Note, this is a copy of the corresponding bit from the mft record,
telling us whether this is a directory or not, i.e. whether it has
an index root attribute or not. */
/*
* The following flag is present both in the STANDARD_INFORMATION
* attribute and in the FILE_NAME attribute (in the field
* file_attributes).
*/
FILE_ATTR_DUP_VIEW_INDEX_PRESENT
=
const_cpu_to_le32
(
0x20000000
),
/* Note, this is a copy of the corresponding bit from the mft record,
telling us whether this file has a view index present (eg. object id
...
...
@@ -1071,9 +1075,15 @@ typedef struct {
modified. */
/* 20*/
sle64
last_access_time
;
/* Time this mft record was last
accessed. */
/* 28*/
sle64
allocated_size
;
/* Byte size of allocated space for the
data attribute. NOTE: Is a multiple
of the cluster size. */
/* 28*/
sle64
allocated_size
;
/* Byte size of on-disk allocated space
for the data attribute. So for
normal $DATA, this is the
allocated_size from the unnamed
$DATA attribute and for compressed
and/or sparse $DATA, this is the
compressed_size from the unnamed
$DATA attribute. NOTE: This is a
multiple of the cluster size. */
/* 30*/
sle64
data_size
;
/* Byte size of actual data in data
attribute. */
/* 38*/
FILE_ATTR_FLAGS
file_attributes
;
/* Flags describing the file. */
...
...
@@ -1904,12 +1914,13 @@ enum {
VOLUME_DELETE_USN_UNDERWAY
=
const_cpu_to_le16
(
0x0010
),
VOLUME_REPAIR_OBJECT_ID
=
const_cpu_to_le16
(
0x0020
),
VOLUME_CHKDSK_UNDERWAY
=
const_cpu_to_le16
(
0x4000
),
VOLUME_MODIFIED_BY_CHKDSK
=
const_cpu_to_le16
(
0x8000
),
VOLUME_FLAGS_MASK
=
const_cpu_to_le16
(
0x
8
03f
),
VOLUME_FLAGS_MASK
=
const_cpu_to_le16
(
0x
c
03f
),
/* To make our life easier when checking if we must mount read-only. */
VOLUME_MUST_MOUNT_RO_MASK
=
const_cpu_to_le16
(
0x
8
027
),
VOLUME_MUST_MOUNT_RO_MASK
=
const_cpu_to_le16
(
0x
c
027
),
}
__attribute__
((
__packed__
));
typedef
le16
VOLUME_FLAGS
;
...
...
fs/ntfs/mft.c
View file @
2cb5b6be
/**
* mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
*
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (c) 2001-200
6
Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -473,7 +473,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no,
runlist_element
*
rl
;
unsigned
int
block_start
,
block_end
,
m_start
,
m_end
,
page_ofs
;
int
i_bhs
,
nr_bhs
,
err
=
0
;
unsigned
char
blocksize_bits
=
vol
->
mftmirr_ino
->
i_blk
bits
;
unsigned
char
blocksize_bits
=
vol
->
sb
->
s_blocksize_
bits
;
ntfs_debug
(
"Entering for inode 0x%lx."
,
mft_no
);
BUG_ON
(
!
max_bhs
);
...
...
@@ -672,8 +672,8 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync)
{
ntfs_volume
*
vol
=
ni
->
vol
;
struct
page
*
page
=
ni
->
page
;
unsigned
char
blocksize_bits
=
vol
->
mft_ino
->
i_blkbits
;
unsigned
int
blocksize
=
1
<<
blocksize_bits
;
unsigned
int
blocksize
=
vol
->
sb
->
s_blocksize
;
unsigned
char
blocksize_bits
=
vol
->
sb
->
s_
blocksize_bits
;
int
max_bhs
=
vol
->
mft_record_size
/
blocksize
;
struct
buffer_head
*
bhs
[
max_bhs
];
struct
buffer_head
*
bh
,
*
head
;
...
...
fs/ntfs/ntfs.h
View file @
2cb5b6be
...
...
@@ -50,11 +50,11 @@ typedef enum {
/* Global variables. */
/* Slab caches (from super.c). */
extern
kmem_cache_t
*
ntfs_name_cache
;
extern
kmem_cache_t
*
ntfs_inode_cache
;
extern
kmem_cache_t
*
ntfs_big_inode_cache
;
extern
kmem_cache_t
*
ntfs_attr_ctx_cache
;
extern
kmem_cache_t
*
ntfs_index_ctx_cache
;
extern
struct
kmem_cache
*
ntfs_name_cache
;
extern
struct
kmem_cache
*
ntfs_inode_cache
;
extern
struct
kmem_cache
*
ntfs_big_inode_cache
;
extern
struct
kmem_cache
*
ntfs_attr_ctx_cache
;
extern
struct
kmem_cache
*
ntfs_index_ctx_cache
;
/* The various operations structs defined throughout the driver files. */
extern
struct
address_space_operations
ntfs_aops
;
...
...
fs/ntfs/super.c
View file @
2cb5b6be
This diff is collapsed.
Click to expand it.
fs/ntfs/upcase.c
View file @
2cb5b6be
...
...
@@ -3,10 +3,7 @@
* Part of the Linux-NTFS project.
*
* Copyright (c) 2001 Richard Russon <ntfs@flatcap.org>
* Copyright (c) 2001-2004 Anton Altaparmakov
*
* Modified for mkntfs inclusion 9 June 2001 by Anton Altaparmakov.
* Modified for kernel inclusion 10 September 2001 by Anton Altparmakov.
* Copyright (c) 2001-2006 Anton Altaparmakov
*
* This program 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
...
...
@@ -75,12 +72,13 @@ ntfschar *generate_default_upcase(void)
if
(
!
uc
)
return
uc
;
memset
(
uc
,
0
,
default_upcase_len
*
sizeof
(
ntfschar
));
/* Generate the little endian Unicode upcase table used by ntfs. */
for
(
i
=
0
;
i
<
default_upcase_len
;
i
++
)
uc
[
i
]
=
cpu_to_le16
(
i
);
for
(
r
=
0
;
uc_run_table
[
r
][
0
];
r
++
)
for
(
i
=
uc_run_table
[
r
][
0
];
i
<
uc_run_table
[
r
][
1
];
i
++
)
uc
[
i
]
=
cpu_to_le16
(
(
le16_to_cpu
(
uc
[
i
])
+
uc_run_table
[
r
][
2
])
)
;
uc
[
i
]
=
cpu_to_le16
(
le16_to_cpu
(
uc
[
i
])
+
uc_run_table
[
r
][
2
]);
for
(
r
=
0
;
uc_dup_table
[
r
][
0
];
r
++
)
for
(
i
=
uc_dup_table
[
r
][
0
];
i
<
uc_dup_table
[
r
][
1
];
i
+=
2
)
uc
[
i
+
1
]
=
cpu_to_le16
(
le16_to_cpu
(
uc
[
i
+
1
])
-
1
);
...
...
fs/ntfs/volume.h
View file @
2cb5b6be
...
...
@@ -2,7 +2,7 @@
* volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
* of the Linux-NTFS project.
*
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (c) 2001-200
6
Anton Altaparmakov
* Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
...
...
@@ -41,10 +41,8 @@ typedef struct {
* structure has stabilized... (AIA)
*/
/* Device specifics. */
struct
super_block
*
sb
;
/* Pointer back to the super_block,
so we don't have to get the offset
every time. */
LCN
nr_blocks
;
/* Number of NTFS_BLOCK_SIZE bytes
struct
super_block
*
sb
;
/* Pointer back to the super_block. */
LCN
nr_blocks
;
/* Number of sb->s_blocksize bytes
sized blocks on the device. */
/* Configuration provided by user at mount time. */
unsigned
long
flags
;
/* Miscellaneous flags, see below. */
...
...
@@ -141,8 +139,8 @@ typedef enum {
NV_ShowSystemFiles
,
/* 1: Return system files in ntfs_readdir(). */
NV_CaseSensitive
,
/* 1: Treat file names as case sensitive and
create filenames in the POSIX namespace.
Otherwise be case insensitive
and create
file names in WIN32
namespace. */
Otherwise be case insensitive
but still
create file names in POSIX
namespace. */
NV_LogFileEmpty
,
/* 1: $LogFile journal is empty. */
NV_QuotaOutOfDate
,
/* 1: $Quota is out of date. */
NV_UsnJrnlStamped
,
/* 1: $UsnJrnl has been stamped. */
...
...
@@ -153,7 +151,7 @@ typedef enum {
* Macro tricks to expand the NVolFoo(), NVolSetFoo(), and NVolClearFoo()
* functions.
*/
#define
NVOL_FN
S(flag) \
#define
DEFINE_NVOL_BIT_OP
S(flag) \
static inline int NVol##flag(ntfs_volume *vol) \
{ \
return test_bit(NV_##flag, &(vol)->flags); \
...
...
@@ -168,12 +166,12 @@ static inline void NVolClear##flag(ntfs_volume *vol) \
}
/* Emit the ntfs volume bitops functions. */
NVOL_FN
S
(
Errors
)
NVOL_FN
S
(
ShowSystemFiles
)
NVOL_FN
S
(
CaseSensitive
)
NVOL_FN
S
(
LogFileEmpty
)
NVOL_FN
S
(
QuotaOutOfDate
)
NVOL_FN
S
(
UsnJrnlStamped
)
NVOL_FN
S
(
SparseEnabled
)
DEFINE_NVOL_BIT_OP
S
(
Errors
)
DEFINE_NVOL_BIT_OP
S
(
ShowSystemFiles
)
DEFINE_NVOL_BIT_OP
S
(
CaseSensitive
)
DEFINE_NVOL_BIT_OP
S
(
LogFileEmpty
)
DEFINE_NVOL_BIT_OP
S
(
QuotaOutOfDate
)
DEFINE_NVOL_BIT_OP
S
(
UsnJrnlStamped
)
DEFINE_NVOL_BIT_OP
S
(
SparseEnabled
)
#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