Lines Matching refs:dpolicy
986 struct discard_policy *dpolicy, in __init_discard_policy() argument
990 dpolicy->type = discard_type; in __init_discard_policy()
991 dpolicy->sync = true; in __init_discard_policy()
992 dpolicy->ordered = false; in __init_discard_policy()
993 dpolicy->granularity = granularity; in __init_discard_policy()
995 dpolicy->max_requests = DEF_MAX_DISCARD_REQUEST; in __init_discard_policy()
996 dpolicy->io_aware_gran = MAX_PLIST_NUM; in __init_discard_policy()
999 dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME; in __init_discard_policy()
1000 dpolicy->mid_interval = DEF_MID_DISCARD_ISSUE_TIME; in __init_discard_policy()
1001 dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME; in __init_discard_policy()
1002 dpolicy->io_aware = true; in __init_discard_policy()
1003 dpolicy->sync = false; in __init_discard_policy()
1004 dpolicy->ordered = true; in __init_discard_policy()
1006 dpolicy->granularity = 1; in __init_discard_policy()
1007 dpolicy->max_interval = DEF_MIN_DISCARD_ISSUE_TIME; in __init_discard_policy()
1010 dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME; in __init_discard_policy()
1011 dpolicy->mid_interval = DEF_MID_DISCARD_ISSUE_TIME; in __init_discard_policy()
1012 dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME; in __init_discard_policy()
1013 dpolicy->io_aware = false; in __init_discard_policy()
1015 dpolicy->io_aware = false; in __init_discard_policy()
1017 dpolicy->max_requests = UINT_MAX; in __init_discard_policy()
1018 dpolicy->io_aware = false; in __init_discard_policy()
1027 struct discard_policy *dpolicy, in __submit_discard_cmd() argument
1036 struct list_head *wait_list = (dpolicy->type == DPOLICY_FSTRIM) ? in __submit_discard_cmd()
1038 int flag = dpolicy->sync ? REQ_SYNC : 0; in __submit_discard_cmd()
1057 while (total_len && *issued < dpolicy->max_requests && !err) { in __submit_discard_cmd()
1068 if (*issued == dpolicy->max_requests) in __submit_discard_cmd()
1312 struct discard_policy *dpolicy) in __issue_discard_cmd_orderly() argument
1341 if (dpolicy->io_aware && !is_idle(sbi)) { in __issue_discard_cmd_orderly()
1347 err = __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd_orderly()
1349 if (issued >= dpolicy->max_requests) in __issue_discard_cmd_orderly()
1372 struct discard_policy *dpolicy) in __issue_discard_cmd() argument
1382 if (i + 1 < dpolicy->granularity) in __issue_discard_cmd()
1385 if (i + 1 < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered) in __issue_discard_cmd()
1386 return __issue_discard_cmd_orderly(sbi, dpolicy); in __issue_discard_cmd()
1400 if (dpolicy->io_aware && i < dpolicy->io_aware_gran && in __issue_discard_cmd()
1406 __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd()
1408 if (issued >= dpolicy->max_requests) in __issue_discard_cmd()
1415 if (issued >= dpolicy->max_requests || io_interrupted) in __issue_discard_cmd()
1473 struct discard_policy *dpolicy, in __wait_discard_cmd_range() argument
1477 struct list_head *wait_list = (dpolicy->type == DPOLICY_FSTRIM) ? in __wait_discard_cmd_range()
1490 if (dc->len < dpolicy->granularity) in __wait_discard_cmd_range()
1514 struct discard_policy *dpolicy) in __wait_all_discard_cmd() argument
1519 if (dpolicy) in __wait_all_discard_cmd()
1520 return __wait_discard_cmd_range(sbi, dpolicy, 0, UINT_MAX); in __wait_all_discard_cmd()
1571 struct discard_policy dpolicy; in f2fs_wait_discard_bios() local
1574 __init_discard_policy(sbi, &dpolicy, DPOLICY_UMOUNT, in f2fs_wait_discard_bios()
1576 __issue_discard_cmd(sbi, &dpolicy); in f2fs_wait_discard_bios()
1591 struct discard_policy dpolicy; in issue_discard_thread() local
1598 __init_discard_policy(sbi, &dpolicy, DPOLICY_BG, in issue_discard_thread()
1616 wait_ms = dpolicy.max_interval; in issue_discard_thread()
1621 __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1); in issue_discard_thread()
1625 issued = __issue_discard_cmd(sbi, &dpolicy); in issue_discard_thread()
1627 __wait_all_discard_cmd(sbi, &dpolicy); in issue_discard_thread()
1628 wait_ms = dpolicy.min_interval; in issue_discard_thread()
1630 wait_ms = dpolicy.mid_interval; in issue_discard_thread()
1632 wait_ms = dpolicy.max_interval; in issue_discard_thread()
2575 struct discard_policy *dpolicy, in __issue_discard_cmd_range() argument
2608 if (dc->len < dpolicy->granularity) in __issue_discard_cmd_range()
2616 err = __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd_range()
2618 if (issued >= dpolicy->max_requests) { in __issue_discard_cmd_range()
2653 struct discard_policy dpolicy; in f2fs_trim_fs() local
2705 __init_discard_policy(sbi, &dpolicy, DPOLICY_FSTRIM, cpc.trim_minlen); in f2fs_trim_fs()
2706 trimmed = __issue_discard_cmd_range(sbi, &dpolicy, in f2fs_trim_fs()
2709 trimmed += __wait_discard_cmd_range(sbi, &dpolicy, in f2fs_trim_fs()