]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/segment.h
Merge tag 'defconfig-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[karo-tx-linux.git] / fs / f2fs / segment.h
index 7091204680f49383ff269f0b8c35834e2c5297d8..55973f7b0330be844e17c0f02b7c02d661ca8c3e 100644 (file)
@@ -347,8 +347,8 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
        if (test_and_clear_bit(segno, free_i->free_segmap)) {
                free_i->free_segments++;
 
-               next = find_next_bit(free_i->free_segmap, TOTAL_SEGS(sbi),
-                                                               start_segno);
+               next = find_next_bit(free_i->free_segmap,
+                               start_segno + sbi->segs_per_sec, start_segno);
                if (next >= start_segno + sbi->segs_per_sec) {
                        if (test_and_clear_bit(secno, free_i->free_secmap))
                                free_i->free_sections++;
@@ -486,6 +486,10 @@ static inline bool need_inplace_update(struct inode *inode)
        if (S_ISDIR(inode->i_mode))
                return false;
 
+       /* this is only set during fdatasync */
+       if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU))
+               return true;
+
        switch (SM_I(sbi)->ipu_policy) {
        case F2FS_IPU_FORCE:
                return true;