aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2009-06-22 14:40:07 -0400
committerJoel Becker <joel.becker@oracle.com>2009-06-22 17:24:55 -0400
commitdf152c241df9e9d2b9a65d37bd02961abe7f591a (patch)
tree47e0c71919ed437db33530a200113a562b9c6b89 /fs/ocfs2/dlmglue.c
parent3211949f8998dde71d9fe2e063de045ece5e0473 (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/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index d3d1f9372f7e..1841bbb49cb6 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2366,15 +2366,20 @@ void ocfs2_inode_unlock(struct inode *inode,
2366 mlog_exit_void(); 2366 mlog_exit_void();
2367} 2367}
2368 2368
2369int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex) 2369int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno)
2370{ 2370{
2371 struct ocfs2_lock_res *lockres; 2371 struct ocfs2_lock_res *lockres;
2372 struct ocfs2_orphan_scan_lvb *lvb; 2372 struct ocfs2_orphan_scan_lvb *lvb;
2373 int level = ex ? DLM_LOCK_EX : DLM_LOCK_PR;
2374 int status = 0; 2373 int status = 0;
2375 2374
2375 if (ocfs2_is_hard_readonly(osb))
2376 return -EROFS;
2377
2378 if (ocfs2_mount_local(osb))
2379 return 0;
2380
2376 lockres = &osb->osb_orphan_scan.os_lockres; 2381 lockres = &osb->osb_orphan_scan.os_lockres;
2377 status = ocfs2_cluster_lock(osb, lockres, level, 0, 0); 2382 status = ocfs2_cluster_lock(osb, lockres, DLM_LOCK_EX, 0, 0);
2378 if (status < 0) 2383 if (status < 0)
2379 return status; 2384 return status;
2380 2385
@@ -2388,17 +2393,18 @@ int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex)
2388 return status; 2393 return status;
2389} 2394}
2390 2395
2391void ocfs2_orphan_scan_unlock(struct ocfs2_super *osb, u32 seqno, int ex) 2396void ocfs2_orphan_scan_unlock(struct ocfs2_super *osb, u32 seqno)
2392{ 2397{
2393 struct ocfs2_lock_res *lockres; 2398 struct ocfs2_lock_res *lockres;
2394 struct ocfs2_orphan_scan_lvb *lvb; 2399 struct ocfs2_orphan_scan_lvb *lvb;
2395 int level = ex ? DLM_LOCK_EX : DLM_LOCK_PR;
2396 2400
2397 lockres = &osb->osb_orphan_scan.os_lockres; 2401 if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb)) {
2398 lvb = ocfs2_dlm_lvb(&lockres->l_lksb); 2402 lockres = &osb->osb_orphan_scan.os_lockres;
2399 lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION; 2403 lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
2400 lvb->lvb_os_seqno = cpu_to_be32(seqno); 2404 lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION;
2401 ocfs2_cluster_unlock(osb, lockres, level); 2405 lvb->lvb_os_seqno = cpu_to_be32(seqno);
2406 ocfs2_cluster_unlock(osb, lockres, DLM_LOCK_EX);
2407 }
2402} 2408}
2403 2409
2404int ocfs2_super_lock(struct ocfs2_super *osb, 2410int ocfs2_super_lock(struct ocfs2_super *osb,