[tracker/forced-mtime-check-per-directory: 3/3] tracker-miner-fs: force mtime checks on inconsistent mounts



commit 8e84b4e91d81fb686753800650621ba1896d1bde
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Sep 6 17:52:10 2011 +0200

    tracker-miner-fs: force mtime checks on inconsistent mounts
    
    If a mount is reported to be unmounted in the store, but was found mounted when
    tracker-miner-fs started, force a mtime check in the mount.

 src/miners/fs/tracker-miner-files.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index a12e0b5..0496a3e 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -1027,6 +1027,16 @@ init_mount_points (TrackerMinerFiles *miner_files)
 				                         TRACKER_STORAGE_TYPE_IS_OPTICAL (type),
 				                         accumulator);
 
+				if (mount_point) {
+					GFile *file;
+
+					/* Add the current mount point as reported to have incorrect
+					 * state. We will force mtime checks on this mount points,
+					 * even if no-mtime-check-needed was set. */
+					file = g_file_new_for_path (mount_point);
+					tracker_miner_fs_force_mtime_checking (TRACKER_MINER_FS (miner), file);
+					g_object_unref (file);
+				}
 			}
 		} else if (!(state & VOLUME_MOUNTED) &&
 		           (state & VOLUME_MOUNTED_IN_STORE)) {
@@ -1040,6 +1050,8 @@ init_mount_points (TrackerMinerFiles *miner_files)
 				                    NULL,
 				                    FALSE,
 				                    accumulator);
+				/* There's no need to force mtime check in these inconsistent
+				 * mount points, as they are not mounted right now. */
 			}
 		}
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]