diff options
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index bed0dc967f29..013aed2f3539 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h | |||
@@ -472,15 +472,20 @@ static inline int utilization(struct f2fs_sb_info *sbi) | |||
472 | * F2FS_IPU_UTIL - if FS utilization is over threashold, | 472 | * F2FS_IPU_UTIL - if FS utilization is over threashold, |
473 | * F2FS_IPU_SSR_UTIL - if SSR mode is activated and FS utilization is over | 473 | * F2FS_IPU_SSR_UTIL - if SSR mode is activated and FS utilization is over |
474 | * threashold, | 474 | * threashold, |
475 | * F2FS_IPU_FSYNC - activated in fsync path only for high performance flash | ||
476 | * storages. IPU will be triggered only if the # of dirty | ||
477 | * pages over min_fsync_blocks. | ||
475 | * F2FS_IPUT_DISABLE - disable IPU. (=default option) | 478 | * F2FS_IPUT_DISABLE - disable IPU. (=default option) |
476 | */ | 479 | */ |
477 | #define DEF_MIN_IPU_UTIL 70 | 480 | #define DEF_MIN_IPU_UTIL 70 |
481 | #define DEF_MIN_FSYNC_BLOCKS 8 | ||
478 | 482 | ||
479 | enum { | 483 | enum { |
480 | F2FS_IPU_FORCE, | 484 | F2FS_IPU_FORCE, |
481 | F2FS_IPU_SSR, | 485 | F2FS_IPU_SSR, |
482 | F2FS_IPU_UTIL, | 486 | F2FS_IPU_UTIL, |
483 | F2FS_IPU_SSR_UTIL, | 487 | F2FS_IPU_SSR_UTIL, |
488 | F2FS_IPU_FSYNC, | ||
484 | F2FS_IPU_DISABLE, | 489 | F2FS_IPU_DISABLE, |
485 | }; | 490 | }; |
486 | 491 | ||
@@ -492,10 +497,6 @@ static inline bool need_inplace_update(struct inode *inode) | |||
492 | if (S_ISDIR(inode->i_mode)) | 497 | if (S_ISDIR(inode->i_mode)) |
493 | return false; | 498 | return false; |
494 | 499 | ||
495 | /* this is only set during fdatasync */ | ||
496 | if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) | ||
497 | return true; | ||
498 | |||
499 | switch (SM_I(sbi)->ipu_policy) { | 500 | switch (SM_I(sbi)->ipu_policy) { |
500 | case F2FS_IPU_FORCE: | 501 | case F2FS_IPU_FORCE: |
501 | return true; | 502 | return true; |
@@ -511,6 +512,11 @@ static inline bool need_inplace_update(struct inode *inode) | |||
511 | if (need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) | 512 | if (need_SSR(sbi) && utilization(sbi) > SM_I(sbi)->min_ipu_util) |
512 | return true; | 513 | return true; |
513 | break; | 514 | break; |
515 | case F2FS_IPU_FSYNC: | ||
516 | /* this is only set during fdatasync */ | ||
517 | if (is_inode_flag_set(F2FS_I(inode), FI_NEED_IPU)) | ||
518 | return true; | ||
519 | break; | ||
514 | case F2FS_IPU_DISABLE: | 520 | case F2FS_IPU_DISABLE: |
515 | break; | 521 | break; |
516 | } | 522 | } |