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
63d3803f
Commit
63d3803f
authored
Oct 05, 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
bb8b2c0a
29b9032b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
58 deletions
+88
-58
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+7
-0
fs/ntfs/aops.c
fs/ntfs/aops.c
+42
-0
fs/ntfs/aops.h
fs/ntfs/aops.h
+36
-0
fs/ntfs/index.c
fs/ntfs/index.c
+0
-55
fs/ntfs/index.h
fs/ntfs/index.h
+3
-3
No files found.
fs/ntfs/ChangeLog
View file @
63d3803f
...
...
@@ -47,6 +47,13 @@ ToDo/Notes:
- Implement fs/ntfs/runlist.c::ntfs_rl_truncate_nolock().
- Add MFT_RECORD_OLD as a copy of MFT_RECORD in fs/ntfs/layout.h and
change MFT_RECORD to contain the NTFS 3.1+ specific fields.
- Add a helper function fs/ntfs/aops.c::mark_ntfs_record_dirty() which
marks all buffers belonging to an ntfs record dirty, followed by
marking the page the ntfs record is in dirty and also marking the vfs
inode containing the ntfs record dirty (I_DIRTY_PAGES).
- Switch fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to using the
new helper fs/ntfs/aops.c::mark_ntfs_record_dirty() and remove the no
longer needed fs/ntfs/index.[hc]::__ntfs_index_entry_mark_dirty().
2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
...
...
fs/ntfs/aops.c
View file @
63d3803f
...
...
@@ -27,6 +27,7 @@
#include <linux/swap.h>
#include <linux/buffer_head.h>
#include "aops.h"
#include "ntfs.h"
/**
...
...
@@ -2028,3 +2029,44 @@ struct address_space_operations ntfs_mst_aops = {
belonging to the page. */
#endif
/* NTFS_RW */
};
#ifdef NTFS_RW
/**
* mark_ntfs_record_dirty - mark an ntfs record dirty
* @ni: ntfs inode to which the ntfs record to be marked dirty belongs
* @page: page containing the ntfs record to mark dirty
* @rec_start: byte offset within @page at which the ntfs record begins
*
* If the ntfs record is the same size as the page cache page @page, set all
* buffers in the page dirty. Otherwise, set only the buffers in which the
* ntfs record is located dirty.
*
* Also, set the page containing the ntfs record dirty, which also marks the
* vfs inode the ntfs record belongs to dirty (I_DIRTY_PAGES).
*/
void
mark_ntfs_record_dirty
(
ntfs_inode
*
ni
,
struct
page
*
page
,
unsigned
int
rec_start
)
{
struct
buffer_head
*
bh
,
*
head
;
unsigned
int
rec_end
,
bh_size
,
bh_start
,
bh_end
;
BUG_ON
(
!
page
);
BUG_ON
(
!
page_has_buffers
(
page
));
if
(
ni
->
itype
.
index
.
block_size
==
PAGE_CACHE_SIZE
)
{
__set_page_dirty_buffers
(
page
);
return
;
}
rec_end
=
rec_start
+
ni
->
itype
.
index
.
block_size
;
bh_size
=
ni
->
vol
->
sb
->
s_blocksize
;
bh_start
=
0
;
bh
=
head
=
page_buffers
(
page
);
do
{
bh_end
=
bh_start
+
bh_size
;
if
((
bh_start
>=
rec_start
)
&&
(
bh_end
<=
rec_end
))
set_buffer_dirty
(
bh
);
bh_start
=
bh_end
;
}
while
((
bh
=
bh
->
b_this_page
)
!=
head
);
__set_page_dirty_nobuffers
(
page
);
}
#endif
/* NTFS_RW */
fs/ntfs/aops.h
0 → 100644
View file @
63d3803f
/**
* aops.h - Defines for NTFS kernel address space operations and page cache
* handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001-2004 Anton Altaparmakov
* 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
* 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
* 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
* distribution in the file COPYING); if not, write to the Free Software
* Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LINUX_NTFS_AOPS_H
#define _LINUX_NTFS_AOPS_H
#ifdef NTFS_RW
#include "inode.h"
extern
void
mark_ntfs_record_dirty
(
ntfs_inode
*
ni
,
struct
page
*
page
,
unsigned
int
rec_start
);
#endif
/* NTFS_RW */
#endif
/* _LINUX_NTFS_AOPS_H */
fs/ntfs/index.c
View file @
63d3803f
...
...
@@ -459,58 +459,3 @@ int ntfs_index_lookup(const void *key, const int key_len,
err
=
-
EIO
;
goto
err_out
;
}
#ifdef NTFS_RW
/**
* __ntfs_index_entry_mark_dirty - mark an index allocation entry dirty
* @ictx: ntfs index context describing the index entry
*
* NOTE: You want to use fs/ntfs/index.h::ntfs_index_entry_mark_dirty() instead!
*
* Mark the index allocation entry described by the index entry context @ictx
* dirty.
*
* The index entry must be in an index block belonging to the index allocation
* attribute. Mark the buffers belonging to the index record as well as the
* page cache page the index block is in dirty. This automatically marks the
* VFS inode of the ntfs index inode to which the index entry belongs dirty,
* too (I_DIRTY_PAGES) and this in turn ensures the page buffers, and hence the
* dirty index block, will be written out to disk later.
*/
void
__ntfs_index_entry_mark_dirty
(
ntfs_index_context
*
ictx
)
{
ntfs_inode
*
ni
;
struct
page
*
page
;
struct
buffer_head
*
bh
,
*
head
;
unsigned
int
rec_start
,
rec_end
,
bh_size
,
bh_start
,
bh_end
;
BUG_ON
(
ictx
->
is_in_root
);
ni
=
ictx
->
idx_ni
;
page
=
ictx
->
page
;
BUG_ON
(
!
page_has_buffers
(
page
));
/*
* If the index block is the same size as the page cache page, set all
* the buffers in the page, as well as the page itself, dirty.
*/
if
(
ni
->
itype
.
index
.
block_size
==
PAGE_CACHE_SIZE
)
{
__set_page_dirty_buffers
(
page
);
return
;
}
/* Set only the buffers in which the index block is located dirty. */
rec_start
=
(
unsigned
int
)((
u8
*
)
ictx
->
ia
-
(
u8
*
)
page_address
(
page
));
rec_end
=
rec_start
+
ni
->
itype
.
index
.
block_size
;
bh_size
=
ni
->
vol
->
sb
->
s_blocksize
;
bh_start
=
0
;
bh
=
head
=
page_buffers
(
page
);
do
{
bh_end
=
bh_start
+
bh_size
;
if
((
bh_start
>=
rec_start
)
&&
(
bh_end
<=
rec_end
))
set_buffer_dirty
(
bh
);
bh_start
=
bh_end
;
}
while
((
bh
=
bh
->
b_this_page
)
!=
head
);
/* Finally, set the page itself dirty, too. */
__set_page_dirty_nobuffers
(
page
);
}
#endif
/* NTFS_RW */
fs/ntfs/index.h
View file @
63d3803f
...
...
@@ -30,6 +30,7 @@
#include "inode.h"
#include "attrib.h"
#include "mft.h"
#include "aops.h"
/**
* @idx_ni: index inode containing the @entry described by this context
...
...
@@ -115,8 +116,6 @@ static inline void ntfs_index_entry_flush_dcache_page(ntfs_index_context *ictx)
flush_dcache_page
(
ictx
->
page
);
}
extern
void
__ntfs_index_entry_mark_dirty
(
ntfs_index_context
*
ictx
);
/**
* ntfs_index_entry_mark_dirty - mark an index entry dirty
* @ictx: ntfs index context describing the index entry
...
...
@@ -140,7 +139,8 @@ static inline void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx)
if
(
ictx
->
is_in_root
)
mark_mft_record_dirty
(
ictx
->
actx
->
ntfs_ino
);
else
__ntfs_index_entry_mark_dirty
(
ictx
);
mark_ntfs_record_dirty
(
ictx
->
idx_ni
,
ictx
->
page
,
(
u8
*
)
ictx
->
ia
-
(
u8
*
)
page_address
(
ictx
->
page
));
}
#endif
/* NTFS_RW */
...
...
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