diff options
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 5040220c3732..7868cc122ac7 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -97,6 +97,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff, | |||
97 | nilfs_transaction_abort(inode->i_sb); | 97 | nilfs_transaction_abort(inode->i_sb); |
98 | goto out; | 98 | goto out; |
99 | } | 99 | } |
100 | nilfs_mark_inode_dirty(inode); | ||
100 | nilfs_transaction_commit(inode->i_sb); /* never fails */ | 101 | nilfs_transaction_commit(inode->i_sb); /* never fails */ |
101 | /* Error handling should be detailed */ | 102 | /* Error handling should be detailed */ |
102 | set_buffer_new(bh_result); | 103 | set_buffer_new(bh_result); |
@@ -322,7 +323,6 @@ struct inode *nilfs_new_inode(struct inode *dir, int mode) | |||
322 | nilfs_init_acl(), proper cancellation of | 323 | nilfs_init_acl(), proper cancellation of |
323 | above jobs should be considered */ | 324 | above jobs should be considered */ |
324 | 325 | ||
325 | mark_inode_dirty(inode); | ||
326 | return inode; | 326 | return inode; |
327 | 327 | ||
328 | failed_acl: | 328 | failed_acl: |
@@ -525,7 +525,6 @@ void nilfs_update_inode(struct inode *inode, struct buffer_head *ibh) | |||
525 | 525 | ||
526 | raw_inode = nilfs_ifile_map_inode(sbi->s_ifile, ino, ibh); | 526 | raw_inode = nilfs_ifile_map_inode(sbi->s_ifile, ino, ibh); |
527 | 527 | ||
528 | /* The buffer is guarded with lock_buffer() by the caller */ | ||
529 | if (test_and_clear_bit(NILFS_I_NEW, &ii->i_state)) | 528 | if (test_and_clear_bit(NILFS_I_NEW, &ii->i_state)) |
530 | memset(raw_inode, 0, NILFS_MDT(sbi->s_ifile)->mi_entry_size); | 529 | memset(raw_inode, 0, NILFS_MDT(sbi->s_ifile)->mi_entry_size); |
531 | set_bit(NILFS_I_INODE_DIRTY, &ii->i_state); | 530 | set_bit(NILFS_I_INODE_DIRTY, &ii->i_state); |
@@ -599,6 +598,7 @@ void nilfs_truncate(struct inode *inode) | |||
599 | if (IS_SYNC(inode)) | 598 | if (IS_SYNC(inode)) |
600 | nilfs_set_transaction_flag(NILFS_TI_SYNC); | 599 | nilfs_set_transaction_flag(NILFS_TI_SYNC); |
601 | 600 | ||
601 | nilfs_mark_inode_dirty(inode); | ||
602 | nilfs_set_file_dirty(NILFS_SB(sb), inode, 0); | 602 | nilfs_set_file_dirty(NILFS_SB(sb), inode, 0); |
603 | nilfs_transaction_commit(sb); | 603 | nilfs_transaction_commit(sb); |
604 | /* May construct a logical segment and may fail in sync mode. | 604 | /* May construct a logical segment and may fail in sync mode. |
@@ -623,6 +623,7 @@ void nilfs_delete_inode(struct inode *inode) | |||
623 | truncate_inode_pages(&inode->i_data, 0); | 623 | truncate_inode_pages(&inode->i_data, 0); |
624 | 624 | ||
625 | nilfs_truncate_bmap(ii, 0); | 625 | nilfs_truncate_bmap(ii, 0); |
626 | nilfs_mark_inode_dirty(inode); | ||
626 | nilfs_free_inode(inode); | 627 | nilfs_free_inode(inode); |
627 | /* nilfs_free_inode() marks inode buffer dirty */ | 628 | /* nilfs_free_inode() marks inode buffer dirty */ |
628 | if (IS_SYNC(inode)) | 629 | if (IS_SYNC(inode)) |
@@ -664,7 +665,6 @@ int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode, | |||
664 | int err; | 665 | int err; |
665 | 666 | ||
666 | spin_lock(&sbi->s_inode_lock); | 667 | spin_lock(&sbi->s_inode_lock); |
667 | /* Caller of this function MUST lock s_inode_lock */ | ||
668 | if (ii->i_bh == NULL) { | 668 | if (ii->i_bh == NULL) { |
669 | spin_unlock(&sbi->s_inode_lock); | 669 | spin_unlock(&sbi->s_inode_lock); |
670 | err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino, | 670 | err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino, |
@@ -746,9 +746,7 @@ int nilfs_mark_inode_dirty(struct inode *inode) | |||
746 | "failed to reget inode block.\n"); | 746 | "failed to reget inode block.\n"); |
747 | return err; | 747 | return err; |
748 | } | 748 | } |
749 | lock_buffer(ibh); | ||
750 | nilfs_update_inode(inode, ibh); | 749 | nilfs_update_inode(inode, ibh); |
751 | unlock_buffer(ibh); | ||
752 | nilfs_mdt_mark_buffer_dirty(ibh); | 750 | nilfs_mdt_mark_buffer_dirty(ibh); |
753 | nilfs_mdt_mark_dirty(sbi->s_ifile); | 751 | nilfs_mdt_mark_dirty(sbi->s_ifile); |
754 | brelse(ibh); | 752 | brelse(ibh); |