diff options
-rw-r--r-- | fs/ocfs2/journal.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/ocfs2.h | 4 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 8 |
3 files changed, 15 insertions, 1 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 44ed768782ed..4a3b9e6b31ad 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -1900,6 +1900,8 @@ void ocfs2_queue_orphan_scan(struct ocfs2_super *osb) | |||
1900 | * number and update LVB so other node will skip the scan for a while | 1900 | * number and update LVB so other node will skip the scan for a while |
1901 | */ | 1901 | */ |
1902 | seqno++; | 1902 | seqno++; |
1903 | os->os_count++; | ||
1904 | os->os_scantime = CURRENT_TIME; | ||
1903 | unlock: | 1905 | unlock: |
1904 | ocfs2_orphan_scan_unlock(osb, seqno, DLM_LOCK_EX); | 1906 | ocfs2_orphan_scan_unlock(osb, seqno, DLM_LOCK_EX); |
1905 | out: | 1907 | out: |
@@ -1939,6 +1941,8 @@ int ocfs2_orphan_scan_init(struct ocfs2_super *osb) | |||
1939 | 1941 | ||
1940 | os = &osb->osb_orphan_scan; | 1942 | os = &osb->osb_orphan_scan; |
1941 | os->os_osb = osb; | 1943 | os->os_osb = osb; |
1944 | os->os_count = 0; | ||
1945 | os->os_scantime = CURRENT_TIME; | ||
1942 | mutex_init(&os->os_lock); | 1946 | mutex_init(&os->os_lock); |
1943 | 1947 | ||
1944 | INIT_DELAYED_WORK(&os->os_orphan_scan_work, | 1948 | INIT_DELAYED_WORK(&os->os_orphan_scan_work, |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 1fde52c96d25..ab285be023b2 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -156,7 +156,9 @@ struct ocfs2_orphan_scan { | |||
156 | struct ocfs2_super *os_osb; | 156 | struct ocfs2_super *os_osb; |
157 | struct ocfs2_lock_res os_lockres; /* lock to synchronize scans */ | 157 | struct ocfs2_lock_res os_lockres; /* lock to synchronize scans */ |
158 | struct delayed_work os_orphan_scan_work; | 158 | struct delayed_work os_orphan_scan_work; |
159 | u32 os_seqno; /* incremented on every scan */ | 159 | struct timespec os_scantime; /* time this node ran the scan */ |
160 | u32 os_count; /* tracks node specific scans */ | ||
161 | u32 os_seqno; /* tracks cluster wide scans */ | ||
160 | }; | 162 | }; |
161 | 163 | ||
162 | struct ocfs2_dlm_debug { | 164 | struct ocfs2_dlm_debug { |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 44ac27e2d1f5..d05f3caec410 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -208,6 +208,7 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) | |||
208 | int i; | 208 | int i; |
209 | struct ocfs2_cluster_connection *cconn = osb->cconn; | 209 | struct ocfs2_cluster_connection *cconn = osb->cconn; |
210 | struct ocfs2_recovery_map *rm = osb->recovery_map; | 210 | struct ocfs2_recovery_map *rm = osb->recovery_map; |
211 | struct ocfs2_orphan_scan *os; | ||
211 | 212 | ||
212 | out += snprintf(buf + out, len - out, | 213 | out += snprintf(buf + out, len - out, |
213 | "%10s => Id: %-s Uuid: %-s Gen: 0x%X Label: %-s\n", | 214 | "%10s => Id: %-s Uuid: %-s Gen: 0x%X Label: %-s\n", |
@@ -309,6 +310,13 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) | |||
309 | i, osb->slot_recovery_generations[i]); | 310 | i, osb->slot_recovery_generations[i]); |
310 | } | 311 | } |
311 | 312 | ||
313 | os = &osb->osb_orphan_scan; | ||
314 | out += snprintf(buf + out, len - out, "Orphan Scan=> "); | ||
315 | out += snprintf(buf + out, len - out, "Local: %u Global: %u ", | ||
316 | os->os_count, os->os_seqno); | ||
317 | out += snprintf(buf + out, len - out, " Last Scan: %lu seconds ago\n", | ||
318 | (get_seconds() - os->os_scantime.tv_sec)); | ||
319 | |||
312 | return out; | 320 | return out; |
313 | } | 321 | } |
314 | 322 | ||