diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 14:34:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 14:34:40 -0400 |
commit | 2ac232f37fa0e8551856a575fe299c47b65b4d66 (patch) | |
tree | 58ff15ecdbc383415a82ea678e5191db16a479f3 /fs/ext3/fsync.c | |
parent | fa8f53ace4af9470d8414427cb3dc3c0ffc4f182 (diff) | |
parent | 5cf49d763eb141d236e92be6d4a0dc94e31fa886 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
jbd: change the field "b_cow_tid" of struct journal_head from type unsigned to tid_t
ext3.txt: update the links in the section "useful links" to the latest ones
ext3: Fix data corruption in inodes with journalled data
ext2: check xattr name_len before acquiring xattr_sem in ext2_xattr_get
ext3: Fix compilation with -DDX_DEBUG
quota: Remove unused declaration
jbd: Use WRITE_SYNC in journal checkpoint.
jbd: Fix oops in journal_remove_journal_head()
ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
ext3/ioctl.c: silence sparse warnings about different address spaces
ext3/ext4 Documentation: remove bh/nobh since it has been deprecated
ext3: Improve truncate error handling
ext3: use proper little-endian bitops
ext2: include fs.h into ext2_fs.h
ext3: Fix oops in ext3_try_to_allocate_with_rsv()
jbd: fix a bug of leaking jh->b_jcount
jbd: remove dependency on __GFP_NOFAIL
ext3: Convert ext3 to new truncate calling convention
jbd: Add fixed tracepoints
ext3: Add fixed tracepoints
Resolve conflicts in fs/ext3/fsync.c due to fsync locking push-down and
new fixed tracepoints.
Diffstat (limited to 'fs/ext3/fsync.c')
-rw-r--r-- | fs/ext3/fsync.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index 0bcf63adb80a..d494c554c6e6 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/jbd.h> | 30 | #include <linux/jbd.h> |
31 | #include <linux/ext3_fs.h> | 31 | #include <linux/ext3_fs.h> |
32 | #include <linux/ext3_jbd.h> | 32 | #include <linux/ext3_jbd.h> |
33 | #include <trace/events/ext3.h> | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * akpm: A new design for ext3_sync_file(). | 36 | * akpm: A new design for ext3_sync_file(). |
@@ -51,12 +52,14 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
51 | int ret, needs_barrier = 0; | 52 | int ret, needs_barrier = 0; |
52 | tid_t commit_tid; | 53 | tid_t commit_tid; |
53 | 54 | ||
55 | trace_ext3_sync_file_enter(file, datasync); | ||
56 | |||
54 | if (inode->i_sb->s_flags & MS_RDONLY) | 57 | if (inode->i_sb->s_flags & MS_RDONLY) |
55 | return 0; | 58 | return 0; |
56 | 59 | ||
57 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 60 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
58 | if (ret) | 61 | if (ret) |
59 | return ret; | 62 | goto out; |
60 | 63 | ||
61 | /* | 64 | /* |
62 | * Taking the mutex here just to keep consistent with how fsync was | 65 | * Taking the mutex here just to keep consistent with how fsync was |
@@ -83,7 +86,8 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
83 | */ | 86 | */ |
84 | if (ext3_should_journal_data(inode)) { | 87 | if (ext3_should_journal_data(inode)) { |
85 | mutex_unlock(&inode->i_mutex); | 88 | mutex_unlock(&inode->i_mutex); |
86 | return ext3_force_commit(inode->i_sb); | 89 | ret = ext3_force_commit(inode->i_sb); |
90 | goto out; | ||
87 | } | 91 | } |
88 | 92 | ||
89 | if (datasync) | 93 | if (datasync) |
@@ -104,6 +108,9 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
104 | */ | 108 | */ |
105 | if (needs_barrier) | 109 | if (needs_barrier) |
106 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); | 110 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
111 | |||
107 | mutex_unlock(&inode->i_mutex); | 112 | mutex_unlock(&inode->i_mutex); |
113 | out: | ||
114 | trace_ext3_sync_file_exit(inode, ret); | ||
108 | return ret; | 115 | return ret; |
109 | } | 116 | } |