]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/gc.c
ocfs2: return non-zero st_blocks for inline data
[karo-tx-linux.git] / fs / f2fs / gc.c
index fedbf67a0842780b53862dcb3855db246e12d347..f610c2a9bdde9561d3be71ab4d674376db8ec401 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/kthread.h>
 #include <linux/delay.h>
 #include <linux/freezer.h>
-#include <linux/blkdev.h>
 
 #include "f2fs.h"
 #include "node.h"
@@ -173,9 +172,9 @@ static unsigned int get_max_cost(struct f2fs_sb_info *sbi,
 {
        /* SSR allocates in a segment unit */
        if (p->alloc_mode == SSR)
-               return 1 << sbi->log_blocks_per_seg;
+               return sbi->blocks_per_seg;
        if (p->gc_mode == GC_GREEDY)
-               return (1 << sbi->log_blocks_per_seg) * p->ofs_unit;
+               return sbi->blocks_per_seg * p->ofs_unit;
        else if (p->gc_mode == GC_CB)
                return UINT_MAX;
        else /* No other gc_mode */
@@ -832,8 +831,10 @@ gc_more:
 
        if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE)))
                goto stop;
-       if (unlikely(f2fs_cp_error(sbi)))
+       if (unlikely(f2fs_cp_error(sbi))) {
+               ret = -EIO;
                goto stop;
+       }
 
        if (gc_type == BG_GC && has_not_enough_free_secs(sbi, sec_freed)) {
                gc_type = FG_GC;