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
4aaad610
Commit
4aaad610
authored
Apr 25, 2004
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTFS: - Remove unused ntfs_dirty_inode().
- Cleanup super operations declaration.
parent
2eb323cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
74 deletions
+52
-74
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+3
-1
fs/ntfs/inode.c
fs/ntfs/inode.c
+1
-34
fs/ntfs/inode.h
fs/ntfs/inode.h
+4
-7
fs/ntfs/super.c
fs/ntfs/super.c
+44
-32
No files found.
fs/ntfs/ChangeLog
View file @
4aaad610
...
...
@@ -19,7 +19,7 @@ ToDo:
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.
2.1.8
- WIP.
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
...
...
@@ -28,6 +28,8 @@ ToDo:
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.
2.1.7 - Enable NFS exporting of mounted NTFS volumes.
...
...
fs/ntfs/inode.c
View file @
4aaad610
...
...
@@ -381,7 +381,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
...
...
@@ -1736,39 +1736,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
...
...
fs/ntfs/inode.h
View file @
4aaad610
...
...
@@ -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
*/
...
...
@@ -233,8 +233,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
);
...
...
@@ -248,4 +246,3 @@ extern int ntfs_setattr(struct dentry *dentry, struct iattr *attr);
#endif
#endif
/* _LINUX_NTFS_FS_INODE_H */
fs/ntfs/super.c
View file @
4aaad610
...
...
@@ -9,13 +9,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
*/
...
...
@@ -102,7 +102,7 @@ static BOOL parse_options(ntfs_volume *vol, char *opt)
if (*v) \
goto needs_val; \
} \
}
}
#define NTFS_GETOPT(option, variable) \
if (!strcmp(p, option)) { \
if (!v || !*v) \
...
...
@@ -110,14 +110,14 @@ static BOOL parse_options(ntfs_volume *vol, char *opt)
variable = simple_strtoul(ov = v, &v, 0); \
if (*v) \
goto needs_val; \
}
}
#define NTFS_GETOPT_BOOL(option, variable) \
if (!strcmp(p, option)) { \
BOOL val; \
if (!simple_getbool(v, &val)) \
goto needs_bool; \
variable = val; \
}
}
#define NTFS_GETOPT_OPTIONS_ARRAY(option, variable, opt_array) \
if (!strcmp(p, option)) { \
int _i; \
...
...
@@ -400,7 +400,7 @@ static BOOL is_boot_sector_ntfs(const struct super_block *sb,
le32_to_cpu
(
b
->
bpb
.
large_sectors
)
||
b
->
bpb
.
fats
)
goto
not_ntfs
;
/* Check clusters per file mft record value is valid. */
if
((
u8
)
b
->
clusters_per_mft_record
<
0xe1
||
if
((
u8
)
b
->
clusters_per_mft_record
<
0xe1
||
(
u8
)
b
->
clusters_per_mft_record
>
0xf7
)
switch
(
b
->
clusters_per_mft_record
)
{
case
1
:
case
2
:
case
4
:
case
8
:
case
16
:
case
32
:
case
64
:
...
...
@@ -409,7 +409,7 @@ static BOOL is_boot_sector_ntfs(const struct super_block *sb,
goto
not_ntfs
;
}
/* Check clusters per index block value is valid. */
if
((
u8
)
b
->
clusters_per_index_record
<
0xe1
||
if
((
u8
)
b
->
clusters_per_index_record
<
0xe1
||
(
u8
)
b
->
clusters_per_index_record
>
0xf7
)
switch
(
b
->
clusters_per_index_record
)
{
case
1
:
case
2
:
case
4
:
case
8
:
case
16
:
case
32
:
case
64
:
...
...
@@ -529,7 +529,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
* parse_ntfs_boot_sector - parse the boot sector and store the data in @vol
* @vol: volume structure to initialise with data from boot sector
* @b: boot sector to parse
*
*
* Parse the ntfs boot sector @b and store all imporant information therein in
* the ntfs super block @vol. Return TRUE on success and FALSE on error.
*/
...
...
@@ -592,10 +592,10 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
ntfs_debug
(
"vol->mft_record_size_mask = 0x%x"
,
vol
->
mft_record_size_mask
);
ntfs_debug
(
"vol->mft_record_size_bits = %i (0x%x)"
,
vol
->
mft_record_size_bits
,
vol
->
mft_record_size_bits
);
vol
->
mft_record_size_bits
,
vol
->
mft_record_size_bits
);
clusters_per_index_record
=
b
->
clusters_per_index_record
;
ntfs_debug
(
"clusters_per_index_record = %i (0x%x)"
,
clusters_per_index_record
,
clusters_per_index_record
);
clusters_per_index_record
,
clusters_per_index_record
);
if
(
clusters_per_index_record
>
0
)
vol
->
index_record_size
=
vol
->
cluster_size
<<
(
ffs
(
clusters_per_index_record
)
-
1
);
...
...
@@ -610,7 +610,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
vol
->
index_record_size_mask
=
vol
->
index_record_size
-
1
;
vol
->
index_record_size_bits
=
ffs
(
vol
->
index_record_size
)
-
1
;
ntfs_debug
(
"vol->index_record_size = %i (0x%x)"
,
vol
->
index_record_size
,
vol
->
index_record_size
);
vol
->
index_record_size
,
vol
->
index_record_size
);
ntfs_debug
(
"vol->index_record_size_mask = 0x%x"
,
vol
->
index_record_size_mask
);
ntfs_debug
(
"vol->index_record_size_bits = %i (0x%x)"
,
...
...
@@ -920,7 +920,7 @@ static BOOL load_system_files(ntfs_volume *vol)
/*
* Get the inode for the attribute definitions file and parse the
* attribute definitions.
*/
*/
tmp_ino
=
ntfs_iget
(
sb
,
FILE_AttrDef
);
if
(
IS_ERR
(
tmp_ino
)
||
is_bad_inode
(
tmp_ino
))
{
if
(
!
IS_ERR
(
tmp_ino
))
...
...
@@ -1321,24 +1321,36 @@ struct super_operations ntfs_mount_sops = {
struct
super_operations
ntfs_sops
=
{
.
alloc_inode
=
ntfs_alloc_big_inode
,
/* VFS: Allocate new inode. */
.
destroy_inode
=
ntfs_destroy_big_inode
,
/* VFS: Deallocate inode. */
//.dirty_inode = ntfs_dirty_inode, /* VFS: Called from
// __mark_inode_dirty(). */
//.write_inode = NULL, /* VFS: Write dirty inode to disk. */
.
put_inode
=
ntfs_put_inode
,
/* VFS: Called just before the inode
reference count is decreased. */
//.delete_inode = NULL, /* VFS: Delete inode from disk. Called
// when i_count becomes 0 and i_nlink
// is also 0. */
.
put_super
=
ntfs_put_super
,
/* Syscall: umount. */
//write_super = NULL, /* Flush dirty super block to disk. */
//write_super_lockfs = NULL, /* ? */
//unlockfs = NULL, /* ? */
.
statfs
=
ntfs_statfs
,
/* Syscall: statfs */
.
remount_fs
=
ntfs_remount
,
/* Syscall: mount -o remount. */
.
put_inode
=
ntfs_put_inode
,
/* VFS: Called just before
the inode reference count
is decreased. */
#ifdef NTFS_RW
//.dirty_inode = NULL, /* VFS: Called from
// __mark_inode_dirty(). */
//.write_inode = NULL, /* VFS: Write dirty inode to
// disk. */
//.drop_inode = NULL, /* VFS: Called just after the
// inode reference count has
// been decreased to zero.
// NOTE: The inode lock is
// held. See fs/inode.c::
// generic_drop_inode(). */
//.delete_inode = NULL, /* VFS: Delete inode from disk.
// Called when i_count becomes
// 0 and i_nlink is also 0. */
//.write_super = NULL, /* Flush dirty super block to
// disk. */
//.write_super_lockfs = NULL, /* ? */
//.unlockfs = NULL, /* ? */
#endif
.
put_super
=
ntfs_put_super
,
/* Syscall: umount. */
.
statfs
=
ntfs_statfs
,
/* Syscall: statfs */
.
remount_fs
=
ntfs_remount
,
/* Syscall: mount -o remount. */
.
clear_inode
=
ntfs_clear_big_inode
,
/* VFS: Called when an inode is
removed from memory. */
//.umount_begin = NULL, /* Forced umount. */
.
show_options
=
ntfs_show_options
,
/* Show mount options in proc. */
//.umount_begin = NULL, /* Forced umount. */
.
show_options
=
ntfs_show_options
,
/* Show mount options in
proc. */
};
...
...
@@ -1489,7 +1501,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
goto
err_out_now
;
}
/*
/*
* TODO: When we start coping with sector sizes different from
* NTFS_BLOCK_SIZE, we now probably need to set the blocksize of the
* device (probably to NTFS_BLOCK_SIZE).
...
...
@@ -1757,7 +1769,7 @@ static int __init init_ntfs_fs(void)
}
ntfs_inode_cache
=
kmem_cache_create
(
ntfs_inode_cache_name
,
sizeof
(
ntfs_inode
),
0
,
sizeof
(
ntfs_inode
),
0
,
SLAB_HWCACHE_ALIGN
|
SLAB_RECLAIM_ACCOUNT
,
NULL
,
NULL
);
if
(
!
ntfs_inode_cache
)
{
printk
(
KERN_CRIT
"NTFS: Failed to create %s!
\n
"
,
...
...
@@ -1766,7 +1778,7 @@ static int __init init_ntfs_fs(void)
}
ntfs_big_inode_cache
=
kmem_cache_create
(
ntfs_big_inode_cache_name
,
sizeof
(
big_ntfs_inode
),
0
,
sizeof
(
big_ntfs_inode
),
0
,
SLAB_HWCACHE_ALIGN
|
SLAB_RECLAIM_ACCOUNT
,
ntfs_big_inode_init_once
,
NULL
);
if
(
!
ntfs_big_inode_cache
)
{
...
...
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