All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode.
@ 2009-06-18  7:48 Tao Ma
  2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Don't init lvb of orphan lock in " Tao Ma
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tao Ma @ 2009-06-18  7:48 UTC (permalink / raw)
  To: ocfs2-devel

Hi Joel/Srini,
	Here are 2 patches for orphan lock in local mode.
patch 1:
	In local mode, we don't need lvb, so don't init it.
patch 2:
	In local mode, orphan lock and unlock don't need to go to dlm part.

Regards,
Tao

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 1/2] ocfs2: Don't init lvb of orphan lock in local mode.
  2009-06-18  7:48 [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Tao Ma
@ 2009-06-18  7:53 ` Tao Ma
  2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Don't call dlm for orphan scan lock if volume is local Tao Ma
  2009-06-18 15:06 ` [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Joel Becker
  2 siblings, 0 replies; 7+ messages in thread
From: Tao Ma @ 2009-06-18  7:53 UTC (permalink / raw)
  To: ocfs2-devel

If the volume is mkfsed and used locally, we only need to
intialize orphan_scan_lock, but no lvb is needed.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
 fs/ocfs2/dlmglue.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index b4b5ea3..5760f58 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -667,8 +667,10 @@ static void ocfs2_orphan_scan_lock_res_init(struct ocfs2_lock_res *res,
 	ocfs2_build_lock_name(OCFS2_LOCK_TYPE_ORPHAN_SCAN, 0, 0, res->l_name);
 	ocfs2_lock_res_init_common(osb, res, OCFS2_LOCK_TYPE_ORPHAN_SCAN,
 				   &ocfs2_orphan_scan_lops, osb);
-	lvb = ocfs2_dlm_lvb(&res->l_lksb);
-	lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION;
+	if (!ocfs2_mount_local(osb)) {
+		lvb = ocfs2_dlm_lvb(&res->l_lksb);
+		lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION;
+	}
 }
 
 void ocfs2_file_lock_res_init(struct ocfs2_lock_res *lockres,
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 2/2] ocfs2: Don't call dlm for orphan scan lock if volume is local.
  2009-06-18  7:48 [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Tao Ma
  2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Don't init lvb of orphan lock in " Tao Ma
@ 2009-06-18  7:53 ` Tao Ma
  2009-06-18 15:06 ` [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Joel Becker
  2 siblings, 0 replies; 7+ messages in thread
From: Tao Ma @ 2009-06-18  7:53 UTC (permalink / raw)
  To: ocfs2-devel

If the volume is mkfsed and mounted locally, orphan scan lock and
unlock don't need to call dlm. Just return directly like other operations.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
 fs/ocfs2/dlmglue.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 5760f58..8210091 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2427,6 +2427,9 @@ int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex)
 	int level = ex ? DLM_LOCK_EX : DLM_LOCK_PR;
 	int status = 0;
 
+	if (ocfs2_mount_local(osb))
+		goto bail;
+
 	lockres = &osb->osb_orphan_scan.os_lockres;
 	status = ocfs2_cluster_lock(osb, lockres, level, 0, 0);
 	if (status < 0)
@@ -2435,6 +2438,8 @@ int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex)
 	lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
 	if (lvb->lvb_version == OCFS2_ORPHAN_LVB_VERSION)
 		*seqno = be32_to_cpu(lvb->lvb_os_seqno);
+
+bail:
 	return status;
 }
 
@@ -2444,6 +2449,9 @@ void ocfs2_orphan_scan_unlock(struct ocfs2_super *osb, u32 seqno, int ex)
 	struct ocfs2_orphan_scan_lvb *lvb;
 	int level = ex ? DLM_LOCK_EX : DLM_LOCK_PR;
 
+	if (ocfs2_mount_local(osb))
+		return;
+
 	lockres = &osb->osb_orphan_scan.os_lockres;
 	lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
 	lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION;
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode.
  2009-06-18  7:48 [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Tao Ma
  2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Don't init lvb of orphan lock in " Tao Ma
  2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Don't call dlm for orphan scan lock if volume is local Tao Ma
@ 2009-06-18 15:06 ` Joel Becker
  2009-06-18 16:06   ` Sunil Mushran
  2 siblings, 1 reply; 7+ messages in thread
From: Joel Becker @ 2009-06-18 15:06 UTC (permalink / raw)
  To: ocfs2-devel

On Thu, Jun 18, 2009 at 03:48:08PM +0800, Tao Ma wrote:
> Hi Joel/Srini,
> 	Here are 2 patches for orphan lock in local mode.
> patch 1:
> 	In local mode, we don't need lvb, so don't init it.
> patch 2:
> 	In local mode, orphan lock and unlock don't need to go to dlm part.

	I would think we don't even need the orphan scan in local mode.

Joel

-- 

"Every day I get up and look through the Forbes list of the richest
 people in America. If I'm not there, I go to work."
        - Robert Orben

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode.
  2009-06-18 15:06 ` [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Joel Becker
@ 2009-06-18 16:06   ` Sunil Mushran
  2009-06-18 17:21     ` Joel Becker
  0 siblings, 1 reply; 7+ messages in thread
From: Sunil Mushran @ 2009-06-18 16:06 UTC (permalink / raw)
  To: ocfs2-devel

Joel Becker wrote:
> On Thu, Jun 18, 2009 at 03:48:08PM +0800, Tao Ma wrote:
>   
>> Hi Joel/Srini,
>> 	Here are 2 patches for orphan lock in local mode.
>> patch 1:
>> 	In local mode, we don't need lvb, so don't init it.
>> patch 2:
>> 	In local mode, orphan lock and unlock don't need to go to dlm part.
>>     
> 	I would think we don't even need the orphan scan in local mode.
>
> Joel

Tao, Good catch.

Yes, we don't need the orphan scan in local mount. The earlier patch
that scans all the orphans slots mount should be sufficient.

Not calling ocfs2_orphan_scan_init() in ocfs2_initialize_super() should
be sufficient. But we should add Tao's patch 2 too for completeness.

Sunil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode.
  2009-06-18 16:06   ` Sunil Mushran
@ 2009-06-18 17:21     ` Joel Becker
  2009-06-18 17:33       ` Sunil Mushran
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Becker @ 2009-06-18 17:21 UTC (permalink / raw)
  To: ocfs2-devel

On Thu, Jun 18, 2009 at 09:06:02AM -0700, Sunil Mushran wrote:
> Joel Becker wrote:
> > On Thu, Jun 18, 2009 at 03:48:08PM +0800, Tao Ma wrote:
> >   
> >> Hi Joel/Srini,
> >> 	Here are 2 patches for orphan lock in local mode.
> >> patch 1:
> >> 	In local mode, we don't need lvb, so don't init it.
> >> patch 2:
> >> 	In local mode, orphan lock and unlock don't need to go to dlm part.
> >>     
> > 	I would think we don't even need the orphan scan in local mode.
> >
> > Joel
> 
> Tao, Good catch.
> 
> Yes, we don't need the orphan scan in local mount. The earlier patch
> that scans all the orphans slots mount should be sufficient.
> 
> Not calling ocfs2_orphan_scan_init() in ocfs2_initialize_super() should
> be sufficient. But we should add Tao's patch 2 too for completeness.

	Do we need the hard_readonly check like other lock types?

Joel

-- 

"Baby, even the losers
 Get luck sometimes.
 Even the losers
 Keep a little bit of pride."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode.
  2009-06-18 17:21     ` Joel Becker
@ 2009-06-18 17:33       ` Sunil Mushran
  0 siblings, 0 replies; 7+ messages in thread
From: Sunil Mushran @ 2009-06-18 17:33 UTC (permalink / raw)
  To: ocfs2-devel

Joel Becker wrote:
> 	Do we need the hard_readonly check like other lock types?

That too. So local and hard ro. I would prefer it in lock and
unlock also because we end up using existing code as template code.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-06-18 17:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18  7:48 [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Tao Ma
2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: Don't init lvb of orphan lock in " Tao Ma
2009-06-18  7:53 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Don't call dlm for orphan scan lock if volume is local Tao Ma
2009-06-18 15:06 ` [Ocfs2-devel] [PATCH 0/2] orphan lock fixes for local mode Joel Becker
2009-06-18 16:06   ` Sunil Mushran
2009-06-18 17:21     ` Joel Becker
2009-06-18 17:33       ` Sunil Mushran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.