Compare commits
2 Commits
19246a5bce
...
85941cbbf0
Author | SHA1 | Date |
---|---|---|
Yu Watanabe | 85941cbbf0 | |
Yu Watanabe | 0e88b0933c |
|
@ -182,10 +182,8 @@ static int switch_root_initramfs(void) {
|
||||||
* Writeback
|
* Writeback
|
||||||
* Dirty
|
* Dirty
|
||||||
*
|
*
|
||||||
* Return true if the sum of these fields is greater than the previous
|
* Return true if the sum of these fields is changed from the previous value input. For all other issues,
|
||||||
* value input. For all other issues, report the failure and indicate that
|
* report the failure and indicate that the sync is not making progress. */
|
||||||
* the sync is not making progress.
|
|
||||||
*/
|
|
||||||
static int sync_making_progress(unsigned long long *prev_dirty) {
|
static int sync_making_progress(unsigned long long *prev_dirty) {
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
unsigned long long val = 0;
|
unsigned long long val = 0;
|
||||||
|
@ -211,15 +209,13 @@ static int sync_making_progress(unsigned long long *prev_dirty) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (sscanf(line, "%*s %llu %*s", &ull) != 1) {
|
if (sscanf(line, "%*s %llu %*s", &ull) != 1)
|
||||||
log_warning_errno(errno_or_else(EIO), "Failed to parse /proc/meminfo field, ignoring: %m");
|
return log_warning_errno(errno_or_else(EIO), "Failed to parse /proc/meminfo field: %m");
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
val += ull;
|
val += ull;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = *prev_dirty > val;
|
r = *prev_dirty != val;
|
||||||
*prev_dirty = val;
|
*prev_dirty = val;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue