Lines Matching refs:dpolicy
1033 struct discard_policy *dpolicy, in __init_discard_policy() argument
1039 dpolicy->type = discard_type; in __init_discard_policy()
1040 dpolicy->sync = true; in __init_discard_policy()
1041 dpolicy->ordered = false; in __init_discard_policy()
1042 dpolicy->granularity = granularity; in __init_discard_policy()
1044 dpolicy->max_requests = dcc->max_discard_request; in __init_discard_policy()
1045 dpolicy->io_aware_gran = MAX_PLIST_NUM; in __init_discard_policy()
1046 dpolicy->timeout = false; in __init_discard_policy()
1049 dpolicy->min_interval = dcc->min_discard_issue_time; in __init_discard_policy()
1050 dpolicy->mid_interval = dcc->mid_discard_issue_time; in __init_discard_policy()
1051 dpolicy->max_interval = dcc->max_discard_issue_time; in __init_discard_policy()
1052 dpolicy->io_aware = true; in __init_discard_policy()
1053 dpolicy->sync = false; in __init_discard_policy()
1054 dpolicy->ordered = true; in __init_discard_policy()
1056 dpolicy->granularity = 1; in __init_discard_policy()
1058 dpolicy->max_interval = in __init_discard_policy()
1062 dpolicy->min_interval = dcc->min_discard_issue_time; in __init_discard_policy()
1063 dpolicy->mid_interval = dcc->mid_discard_issue_time; in __init_discard_policy()
1064 dpolicy->max_interval = dcc->max_discard_issue_time; in __init_discard_policy()
1065 dpolicy->io_aware = false; in __init_discard_policy()
1067 dpolicy->io_aware = false; in __init_discard_policy()
1069 dpolicy->io_aware = false; in __init_discard_policy()
1071 dpolicy->granularity = 1; in __init_discard_policy()
1072 dpolicy->timeout = true; in __init_discard_policy()
1081 struct discard_policy *dpolicy, in __submit_discard_cmd() argument
1089 struct list_head *wait_list = (dpolicy->type == DPOLICY_FSTRIM) ? in __submit_discard_cmd()
1091 blk_opf_t flag = dpolicy->sync ? REQ_SYNC : 0; in __submit_discard_cmd()
1110 while (total_len && *issued < dpolicy->max_requests && !err) { in __submit_discard_cmd()
1121 if (*issued == dpolicy->max_requests) in __submit_discard_cmd()
1367 struct discard_policy *dpolicy) in __issue_discard_cmd_orderly() argument
1396 if (dpolicy->io_aware && !is_idle(sbi, DISCARD_TIME)) { in __issue_discard_cmd_orderly()
1402 err = __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd_orderly()
1404 if (issued >= dpolicy->max_requests) in __issue_discard_cmd_orderly()
1426 struct discard_policy *dpolicy);
1429 struct discard_policy *dpolicy) in __issue_discard_cmd() argument
1438 if (dpolicy->timeout) in __issue_discard_cmd()
1444 if (dpolicy->timeout && in __issue_discard_cmd()
1448 if (i + 1 < dpolicy->granularity) in __issue_discard_cmd()
1451 if (i + 1 < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered) in __issue_discard_cmd()
1452 return __issue_discard_cmd_orderly(sbi, dpolicy); in __issue_discard_cmd()
1466 if (dpolicy->timeout && in __issue_discard_cmd()
1470 if (dpolicy->io_aware && i < dpolicy->io_aware_gran && in __issue_discard_cmd()
1476 __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd()
1478 if (issued >= dpolicy->max_requests) in __issue_discard_cmd()
1485 if (issued >= dpolicy->max_requests || io_interrupted) in __issue_discard_cmd()
1489 if (dpolicy->type == DPOLICY_UMOUNT && issued) { in __issue_discard_cmd()
1490 __wait_all_discard_cmd(sbi, dpolicy); in __issue_discard_cmd()
1548 struct discard_policy *dpolicy, in __wait_discard_cmd_range() argument
1552 struct list_head *wait_list = (dpolicy->type == DPOLICY_FSTRIM) ? in __wait_discard_cmd_range()
1564 if (iter->len < dpolicy->granularity) in __wait_discard_cmd_range()
1588 struct discard_policy *dpolicy) in __wait_all_discard_cmd() argument
1593 if (dpolicy) in __wait_all_discard_cmd()
1594 return __wait_discard_cmd_range(sbi, dpolicy, 0, UINT_MAX); in __wait_all_discard_cmd()
1645 struct discard_policy dpolicy; in f2fs_issue_discard_timeout() local
1648 __init_discard_policy(sbi, &dpolicy, DPOLICY_UMOUNT, in f2fs_issue_discard_timeout()
1650 __issue_discard_cmd(sbi, &dpolicy); in f2fs_issue_discard_timeout()
1665 struct discard_policy dpolicy; in issue_discard_thread() local
1674 __init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1); in issue_discard_thread()
1676 __init_discard_policy(sbi, &dpolicy, DPOLICY_BG, in issue_discard_thread()
1680 wait_ms = dpolicy.max_interval; in issue_discard_thread()
1701 wait_ms = dpolicy.max_interval; in issue_discard_thread()
1709 issued = __issue_discard_cmd(sbi, &dpolicy); in issue_discard_thread()
1711 __wait_all_discard_cmd(sbi, &dpolicy); in issue_discard_thread()
1712 wait_ms = dpolicy.min_interval; in issue_discard_thread()
1716 wait_ms = dpolicy.mid_interval; in issue_discard_thread()
1718 wait_ms = dpolicy.max_interval; in issue_discard_thread()
2972 struct discard_policy *dpolicy, in __issue_discard_cmd_range() argument
3005 if (dc->len < dpolicy->granularity) in __issue_discard_cmd_range()
3013 err = __submit_discard_cmd(sbi, dpolicy, dc, &issued); in __issue_discard_cmd_range()
3015 if (issued >= dpolicy->max_requests) { in __issue_discard_cmd_range()
3050 struct discard_policy dpolicy; in f2fs_trim_fs() local
3101 __init_discard_policy(sbi, &dpolicy, DPOLICY_FSTRIM, cpc.trim_minlen); in f2fs_trim_fs()
3102 trimmed = __issue_discard_cmd_range(sbi, &dpolicy, in f2fs_trim_fs()
3105 trimmed += __wait_discard_cmd_range(sbi, &dpolicy, in f2fs_trim_fs()