diff options
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index edd1b356d667..451dfb4041e8 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -625,29 +625,14 @@ static int f2fs_drop_inode(struct inode *inode) | |||
625 | return generic_drop_inode(inode); | 625 | return generic_drop_inode(inode); |
626 | } | 626 | } |
627 | 627 | ||
628 | /* | 628 | int f2fs_inode_dirtied(struct inode *inode) |
629 | * f2fs_dirty_inode() is called from __mark_inode_dirty() | ||
630 | * | ||
631 | * We should call set_dirty_inode to write the dirty inode through write_inode. | ||
632 | */ | ||
633 | static void f2fs_dirty_inode(struct inode *inode, int flags) | ||
634 | { | 629 | { |
635 | struct f2fs_sb_info *sbi = F2FS_I_SB(inode); | 630 | struct f2fs_sb_info *sbi = F2FS_I_SB(inode); |
636 | 631 | ||
637 | if (inode->i_ino == F2FS_NODE_INO(sbi) || | ||
638 | inode->i_ino == F2FS_META_INO(sbi)) | ||
639 | return; | ||
640 | |||
641 | if (flags == I_DIRTY_TIME) | ||
642 | return; | ||
643 | |||
644 | if (is_inode_flag_set(inode, FI_AUTO_RECOVER)) | ||
645 | clear_inode_flag(inode, FI_AUTO_RECOVER); | ||
646 | |||
647 | spin_lock(&sbi->inode_lock[DIRTY_META]); | 632 | spin_lock(&sbi->inode_lock[DIRTY_META]); |
648 | if (is_inode_flag_set(inode, FI_DIRTY_INODE)) { | 633 | if (is_inode_flag_set(inode, FI_DIRTY_INODE)) { |
649 | spin_unlock(&sbi->inode_lock[DIRTY_META]); | 634 | spin_unlock(&sbi->inode_lock[DIRTY_META]); |
650 | return; | 635 | return 1; |
651 | } | 636 | } |
652 | 637 | ||
653 | set_inode_flag(inode, FI_DIRTY_INODE); | 638 | set_inode_flag(inode, FI_DIRTY_INODE); |
@@ -656,6 +641,8 @@ static void f2fs_dirty_inode(struct inode *inode, int flags) | |||
656 | inc_page_count(sbi, F2FS_DIRTY_IMETA); | 641 | inc_page_count(sbi, F2FS_DIRTY_IMETA); |
657 | stat_inc_dirty_inode(sbi, DIRTY_META); | 642 | stat_inc_dirty_inode(sbi, DIRTY_META); |
658 | spin_unlock(&sbi->inode_lock[DIRTY_META]); | 643 | spin_unlock(&sbi->inode_lock[DIRTY_META]); |
644 | |||
645 | return 0; | ||
659 | } | 646 | } |
660 | 647 | ||
661 | void f2fs_inode_synced(struct inode *inode) | 648 | void f2fs_inode_synced(struct inode *inode) |
@@ -675,6 +662,28 @@ void f2fs_inode_synced(struct inode *inode) | |||
675 | spin_unlock(&sbi->inode_lock[DIRTY_META]); | 662 | spin_unlock(&sbi->inode_lock[DIRTY_META]); |
676 | } | 663 | } |
677 | 664 | ||
665 | /* | ||
666 | * f2fs_dirty_inode() is called from __mark_inode_dirty() | ||
667 | * | ||
668 | * We should call set_dirty_inode to write the dirty inode through write_inode. | ||
669 | */ | ||
670 | static void f2fs_dirty_inode(struct inode *inode, int flags) | ||
671 | { | ||
672 | struct f2fs_sb_info *sbi = F2FS_I_SB(inode); | ||
673 | |||
674 | if (inode->i_ino == F2FS_NODE_INO(sbi) || | ||
675 | inode->i_ino == F2FS_META_INO(sbi)) | ||
676 | return; | ||
677 | |||
678 | if (flags == I_DIRTY_TIME) | ||
679 | return; | ||
680 | |||
681 | if (is_inode_flag_set(inode, FI_AUTO_RECOVER)) | ||
682 | clear_inode_flag(inode, FI_AUTO_RECOVER); | ||
683 | |||
684 | f2fs_inode_dirtied(inode); | ||
685 | } | ||
686 | |||
678 | static void f2fs_i_callback(struct rcu_head *head) | 687 | static void f2fs_i_callback(struct rcu_head *head) |
679 | { | 688 | { |
680 | struct inode *inode = container_of(head, struct inode, i_rcu); | 689 | struct inode *inode = container_of(head, struct inode, i_rcu); |