linux/fs/f2fs
Namjae Jeon b2b3460a94 f2fs: reorganise the function get_victim_by_default
Fix the function get_victim_by_default, where it checks
for the condition  that p.min_segno != NULL_SEGNO as
shown:

if (p.min_segno != NULL_SEGNO)
           goto got_it;

and if above condition is true then

got_it:
        if (p.min_segno != NULL_SEGNO) {

So this condition is being checked twice. Hence move the goto
statement after the if condition so that duplication of condition
check is avoided.

Also this function makes a call to get_max_cost() to compute
the max cost based on the f2fs_sbi_info and victim policy. Since
get_max_cost depends on on three parameters of victim_sel_policy
=> alloc_mode, gc_mode & ofs_unit, once this victim policy is
initialised, these value will not change till the execution
time of get_victim_by_default() & also f2fs_sbi_info structure
parameters will not change.

Hence making calls to get_max_cost() in while loop does not seems to
be a good point. Instead we can call it once in begining and store
the results in local variable, which later can serve our purpose
for comparing the cost with max cost inside the while loop.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Pankaj Kumar <pankaj.km@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-06-06 14:20:46 +09:00
..
acl.c mode_t, whack-a-mole at 11... 2013-04-09 14:13:05 -04:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: fix incorrect iputs during the dentry recovery 2013-05-28 15:03:06 +09:00
data.c f2fs: push some variables to debug part 2013-05-28 15:03:05 +09:00
debug.c f2fs: use list_for_each_entry rather than list_for_each_entry_safe 2013-05-28 15:03:02 +09:00
dir.c f2fs: cover cp_file information with ilock 2013-05-28 15:03:06 +09:00
f2fs.h f2fs: push some variables to debug part 2013-05-28 15:03:05 +09:00
file.c f2fs: reuse the locked dnode page and its inode 2013-05-28 15:03:04 +09:00
gc.c f2fs: reorganise the function get_victim_by_default 2013-06-06 14:20:46 +09:00
gc.h f2fs: avoid frequent background GC 2013-04-26 10:35:03 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inode.c f2fs: fix wrong condition check 2013-05-28 15:03:03 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: cover cp_file information with ilock 2013-05-28 15:03:06 +09:00
node.c f2fs: add debug msgs in the recovery routine 2013-05-28 15:03:02 +09:00
node.h f2fs: optimize several routines in node.h 2013-05-28 15:03:05 +09:00
recovery.c f2fs: fix dentry recovery routine 2013-05-28 15:03:05 +09:00
segment.c f2fs: push some variables to debug part 2013-05-28 15:03:05 +09:00
segment.h f2fs: modify the number of issued pages to merge IOs 2013-04-30 12:07:32 +09:00
super.c f2fs: add f2fs_readonly() 2013-05-28 15:03:03 +09:00
xattr.c f2fs: handle errors from get_node_page calls 2013-06-03 19:49:09 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00