diff options
Diffstat (limited to 'fs/jbd2/commit.c')
| -rw-r--r-- | fs/jbd2/commit.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 7c068c189d80..6494c81e3b0a 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
| @@ -26,7 +26,9 @@ | |||
| 26 | #include <linux/backing-dev.h> | 26 | #include <linux/backing-dev.h> |
| 27 | #include <linux/bio.h> | 27 | #include <linux/bio.h> |
| 28 | #include <linux/blkdev.h> | 28 | #include <linux/blkdev.h> |
| 29 | #include <linux/bitops.h> | ||
| 29 | #include <trace/events/jbd2.h> | 30 | #include <trace/events/jbd2.h> |
| 31 | #include <asm/system.h> | ||
| 30 | 32 | ||
| 31 | /* | 33 | /* |
| 32 | * Default IO end handler for temporary BJ_IO buffer_heads. | 34 | * Default IO end handler for temporary BJ_IO buffer_heads. |
| @@ -236,7 +238,7 @@ static int journal_submit_data_buffers(journal_t *journal, | |||
| 236 | spin_lock(&journal->j_list_lock); | 238 | spin_lock(&journal->j_list_lock); |
| 237 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { | 239 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { |
| 238 | mapping = jinode->i_vfs_inode->i_mapping; | 240 | mapping = jinode->i_vfs_inode->i_mapping; |
| 239 | jinode->i_flags |= JI_COMMIT_RUNNING; | 241 | set_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
| 240 | spin_unlock(&journal->j_list_lock); | 242 | spin_unlock(&journal->j_list_lock); |
| 241 | /* | 243 | /* |
| 242 | * submit the inode data buffers. We use writepage | 244 | * submit the inode data buffers. We use writepage |
| @@ -251,7 +253,8 @@ static int journal_submit_data_buffers(journal_t *journal, | |||
| 251 | spin_lock(&journal->j_list_lock); | 253 | spin_lock(&journal->j_list_lock); |
| 252 | J_ASSERT(jinode->i_transaction == commit_transaction); | 254 | J_ASSERT(jinode->i_transaction == commit_transaction); |
| 253 | commit_transaction->t_flushed_data_blocks = 1; | 255 | commit_transaction->t_flushed_data_blocks = 1; |
| 254 | jinode->i_flags &= ~JI_COMMIT_RUNNING; | 256 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
| 257 | smp_mb__after_clear_bit(); | ||
| 255 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); | 258 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); |
| 256 | } | 259 | } |
| 257 | spin_unlock(&journal->j_list_lock); | 260 | spin_unlock(&journal->j_list_lock); |
| @@ -272,7 +275,7 @@ static int journal_finish_inode_data_buffers(journal_t *journal, | |||
| 272 | /* For locking, see the comment in journal_submit_data_buffers() */ | 275 | /* For locking, see the comment in journal_submit_data_buffers() */ |
| 273 | spin_lock(&journal->j_list_lock); | 276 | spin_lock(&journal->j_list_lock); |
| 274 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { | 277 | list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) { |
| 275 | jinode->i_flags |= JI_COMMIT_RUNNING; | 278 | set_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
| 276 | spin_unlock(&journal->j_list_lock); | 279 | spin_unlock(&journal->j_list_lock); |
| 277 | err = filemap_fdatawait(jinode->i_vfs_inode->i_mapping); | 280 | err = filemap_fdatawait(jinode->i_vfs_inode->i_mapping); |
| 278 | if (err) { | 281 | if (err) { |
| @@ -288,7 +291,8 @@ static int journal_finish_inode_data_buffers(journal_t *journal, | |||
| 288 | ret = err; | 291 | ret = err; |
| 289 | } | 292 | } |
| 290 | spin_lock(&journal->j_list_lock); | 293 | spin_lock(&journal->j_list_lock); |
| 291 | jinode->i_flags &= ~JI_COMMIT_RUNNING; | 294 | clear_bit(__JI_COMMIT_RUNNING, &jinode->i_flags); |
| 295 | smp_mb__after_clear_bit(); | ||
| 292 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); | 296 | wake_up_bit(&jinode->i_flags, __JI_COMMIT_RUNNING); |
| 293 | } | 297 | } |
| 294 | 298 | ||
