summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-06-16 11:30:07 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2014-06-16 11:30:07 +0200
commiteb1a56be346e49460b6131b7f546f00360e4a78f (patch)
tree0f42fe27378523af195fa1b74f2352720fa7043c
parent65c901f1ebbb1286c7f533abbd8716b5c7d7294e (diff)
Revert "Fix standby timers"
David Zeuthen says: > 1. Checking if a disk is asleep does not wake up the disk (unless its > firmware is broken). > 2. It's not atypical to have disks without any IO for _days_. We still > want to check SMART status for disks in this case. This reverts commit 65c901f1ebbb1286c7f533abbd8716b5c7d7294e.
-rw-r--r--src/udiskslinuxdriveata.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c
index 3b03874..9148dee 100644
--- a/src/udiskslinuxdriveata.c
+++ b/src/udiskslinuxdriveata.c
@@ -88,7 +88,6 @@ struct _UDisksLinuxDriveAta
UDisksThreadedJob *selftest_job;
gboolean secure_erase_in_progress;
- unsigned long drive_read, drive_write;
};
struct _UDisksLinuxDriveAtaClass
@@ -557,39 +556,11 @@ udisks_linux_drive_ata_refresh_smart_sync (UDisksLinuxDriveAta *drive,
else
{
guchar count;
- gchar stat_path[PATH_MAX];
- unsigned long drive_read, drive_write;
- FILE *statf;
- gboolean no_io = FALSE;
-
if (!get_pm_state(device, error, &count))
goto out;
awake = count == 0xFF || count == 0x80;
-
- snprintf (stat_path, sizeof (stat_path), "%s/stat", g_udev_device_get_sysfs_path (device->udev_device));
- statf = fopen (stat_path, "r");
- if (statf == NULL)
- {
- udisks_warning ("Failed to open %s", stat_path);
- }
- else
- {
- int res = fscanf (statf, "%lu %*u %*u %*u %lu", &drive_read, &drive_write);
- fclose (statf);
-
- if (res == 2)
- {
- no_io = (drive_read == drive->drive_read && drive_write == drive->drive_write);
- udisks_debug ("drive_read=%lu, drive_write=%lu, old drive_read=%lu, old drive_write=%lu\n",
- drive_read, drive_write, drive->drive_read, drive->drive_write);
- drive->drive_read = drive_read;
- drive->drive_write = drive_write;
- } else {
- udisks_warning ("Failed to parse %s, only got %i items", stat_path, res);
- }
- }
/* don't wake up disk unless specically asked to */
- if (nowakeup && (!awake || no_io))
+ if (nowakeup && !awake)
{
g_set_error (error,
UDISKS_ERROR,