diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-06-22 14:40:07 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-06-22 17:24:55 -0400 |
commit | df152c241df9e9d2b9a65d37bd02961abe7f591a (patch) | |
tree | 47e0c71919ed437db33530a200113a562b9c6b89 /fs/ocfs2/super.c | |
parent | 3211949f8998dde71d9fe2e063de045ece5e0473 (diff) |
ocfs2: Disable orphan scanning for local and hard-ro mounts
Local and Hard-RO mounts do not need orphan scanning.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 3e8a68b103ab..0746e1abdfc7 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -205,11 +205,10 @@ static const match_table_t tokens = { | |||
205 | #ifdef CONFIG_DEBUG_FS | 205 | #ifdef CONFIG_DEBUG_FS |
206 | static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) | 206 | static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) |
207 | { | 207 | { |
208 | int out = 0; | ||
209 | int i; | ||
210 | struct ocfs2_cluster_connection *cconn = osb->cconn; | 208 | struct ocfs2_cluster_connection *cconn = osb->cconn; |
211 | struct ocfs2_recovery_map *rm = osb->recovery_map; | 209 | struct ocfs2_recovery_map *rm = osb->recovery_map; |
212 | struct ocfs2_orphan_scan *os; | 210 | struct ocfs2_orphan_scan *os = &osb->osb_orphan_scan; |
211 | int i, out = 0; | ||
213 | 212 | ||
214 | out += snprintf(buf + out, len - out, | 213 | out += snprintf(buf + out, len - out, |
215 | "%10s => Id: %-s Uuid: %-s Gen: 0x%X Label: %-s\n", | 214 | "%10s => Id: %-s Uuid: %-s Gen: 0x%X Label: %-s\n", |
@@ -305,6 +304,16 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) | |||
305 | atomic_read(&osb->s_num_inodes_stolen)); | 304 | atomic_read(&osb->s_num_inodes_stolen)); |
306 | spin_unlock(&osb->osb_lock); | 305 | spin_unlock(&osb->osb_lock); |
307 | 306 | ||
307 | out += snprintf(buf + out, len - out, "OrphanScan => "); | ||
308 | out += snprintf(buf + out, len - out, "Local: %u Global: %u ", | ||
309 | os->os_count, os->os_seqno); | ||
310 | out += snprintf(buf + out, len - out, " Last Scan: "); | ||
311 | if (atomic_read(&os->os_state) == ORPHAN_SCAN_INACTIVE) | ||
312 | out += snprintf(buf + out, len - out, "Disabled\n"); | ||
313 | else | ||
314 | out += snprintf(buf + out, len - out, "%lu seconds ago\n", | ||
315 | (get_seconds() - os->os_scantime.tv_sec)); | ||
316 | |||
308 | out += snprintf(buf + out, len - out, "%10s => %3s %10s\n", | 317 | out += snprintf(buf + out, len - out, "%10s => %3s %10s\n", |
309 | "Slots", "Num", "RecoGen"); | 318 | "Slots", "Num", "RecoGen"); |
310 | for (i = 0; i < osb->max_slots; ++i) { | 319 | for (i = 0; i < osb->max_slots; ++i) { |
@@ -315,13 +324,6 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) | |||
315 | i, osb->slot_recovery_generations[i]); | 324 | i, osb->slot_recovery_generations[i]); |
316 | } | 325 | } |
317 | 326 | ||
318 | os = &osb->osb_orphan_scan; | ||
319 | out += snprintf(buf + out, len - out, "Orphan Scan=> "); | ||
320 | out += snprintf(buf + out, len - out, "Local: %u Global: %u ", | ||
321 | os->os_count, os->os_seqno); | ||
322 | out += snprintf(buf + out, len - out, " Last Scan: %lu seconds ago\n", | ||
323 | (get_seconds() - os->os_scantime.tv_sec)); | ||
324 | |||
325 | return out; | 327 | return out; |
326 | } | 328 | } |
327 | 329 | ||
@@ -1179,6 +1181,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1179 | atomic_set(&osb->vol_state, VOLUME_MOUNTED_QUOTAS); | 1181 | atomic_set(&osb->vol_state, VOLUME_MOUNTED_QUOTAS); |
1180 | wake_up(&osb->osb_mount_event); | 1182 | wake_up(&osb->osb_mount_event); |
1181 | 1183 | ||
1184 | /* Start this when the mount is almost sure of being successful */ | ||
1185 | ocfs2_orphan_scan_init(osb); | ||
1186 | |||
1182 | mlog_exit(status); | 1187 | mlog_exit(status); |
1183 | return status; | 1188 | return status; |
1184 | 1189 | ||
@@ -1983,13 +1988,6 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1983 | goto bail; | 1988 | goto bail; |
1984 | } | 1989 | } |
1985 | 1990 | ||
1986 | status = ocfs2_orphan_scan_init(osb); | ||
1987 | if (status) { | ||
1988 | mlog(ML_ERROR, "Unable to initialize delayed orphan scan\n"); | ||
1989 | mlog_errno(status); | ||
1990 | goto bail; | ||
1991 | } | ||
1992 | |||
1993 | init_waitqueue_head(&osb->checkpoint_event); | 1991 | init_waitqueue_head(&osb->checkpoint_event); |
1994 | atomic_set(&osb->needs_checkpoint, 0); | 1992 | atomic_set(&osb->needs_checkpoint, 0); |
1995 | 1993 | ||