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
507388c9
Commit
507388c9
authored
Mar 28, 2003
by
Andrew Morton
Committed by
Dave Jones
Mar 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] speed up ext3_sync_file()
There is never a need to write out b_assoc_buffers() in ext3_sync_file().
parent
864c2acd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
fs/ext3/fsync.c
fs/ext3/fsync.c
+19
-10
No files found.
fs/ext3/fsync.c
View file @
507388c9
...
...
@@ -34,7 +34,7 @@
* akpm: A new design for ext3_sync_file().
*
* This is only called from sys_fsync(), sys_fdatasync() and sys_msync().
* There cannot be a transaction open by this task.
(AKPM: quotas?)
* There cannot be a transaction open by this task.
* Another task could have dirtied this inode. Its data can be in any
* state in the journalling system.
*
...
...
@@ -50,19 +50,28 @@
int
ext3_sync_file
(
struct
file
*
file
,
struct
dentry
*
dentry
,
int
datasync
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
int
ret
;
J_ASSERT
(
ext3_journal_current_handle
()
==
0
);
/*
* fsync_inode_buffers() just walks private_list and waits
* on them. It's a no-op for full data journalling because
* private_list will be empty.
* Really, we only need to start I/O on the dirty buffers -
* we'll end up waiting on them in commit.
* data=writeback:
* The caller's filemap_fdatawrite()/wait will sync the data.
* ext3_force_commit() will sync the metadata
*
* data=ordered:
* The caller's filemap_fdatawrite() will write the data and
* ext3_force_commit() will wait on the buffers. Then the caller's
* filemap_fdatawait() will wait on the pages (but all IO is complete)
* Not pretty, but it works.
*
* data=journal:
* filemap_fdatawrite won't do anything (the buffers are clean).
* ext3_force_commit will write the file data into the journal and
* will wait on that.
* filemap_fdatawait() will encounter a ton of newly-dirtied pages
* (they were dirtied by commit). But that's OK - the blocks are
* safe in-journal, which is all fsync() needs to ensure.
*/
ret
=
sync_mapping_buffers
(
inode
->
i_mapping
);
ext3_force_commit
(
inode
->
i_sb
);
return
ret
;
return
0
;
}
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