All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 4/5] ocfs2: Do not initialize lvb in ocfs2_orphan_scan_lock_res_init()
Date: Fri, 19 Jun 2009 14:45:57 -0700	[thread overview]
Message-ID: <1245447958-12996-4-git-send-email-sunil.mushran@oracle.com> (raw)
In-Reply-To: <1245447958-12996-1-git-send-email-sunil.mushran@oracle.com>

No need to call ocfs2_dlm_lvb() in ocfs2_orphan_scan_lock_res_init().

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
---
 fs/ocfs2/dlmglue.c |   11 +++++++----
 fs/ocfs2/journal.c |    1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 6cdeaa7..42ef595 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -644,14 +644,10 @@ static void ocfs2_nfs_sync_lock_res_init(struct ocfs2_lock_res *res,
 static void ocfs2_orphan_scan_lock_res_init(struct ocfs2_lock_res *res,
 					    struct ocfs2_super *osb)
 {
-	struct ocfs2_orphan_scan_lvb *lvb;
-
 	ocfs2_lock_res_init_once(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;
 }
 
 void ocfs2_file_lock_res_init(struct ocfs2_lock_res *lockres,
@@ -2381,9 +2377,16 @@ int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex)
 	if (status < 0)
 		return status;
 
+	/*
+	 * TODO: Add handling for different lvb versions. It is blocked
+	 * on being able to detect valid lvb via stackglue.
+	 */
 	lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
 	if (lvb->lvb_version == OCFS2_ORPHAN_LVB_VERSION)
 		*seqno = be32_to_cpu(lvb->lvb_os_seqno);
+	else
+		*seqno = osb->osb_orphan_scan.os_seqno + 1;
+ 
 	return status;
 }
 
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index e690483..03a43c3 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1952,6 +1952,7 @@ int ocfs2_orphan_scan_init(struct ocfs2_super *osb)
 	atomic_set(&os->os_status, ORPHAN_SCAN_ACTIVE);
 	os->os_osb = osb;
 	os->os_count = 0;
+	os->os_seqno = 0;
 	os->os_scantime = CURRENT_TIME;
 	mutex_init(&os->os_lock);
 
-- 
1.6.0.4

  parent reply	other threads:[~2009-06-19 21:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 21:45 [Ocfs2-devel] [PATCH 1/5] ocfs2: Pin journal head before accessing jh->b_committed_data Sunil Mushran
2009-06-19 21:45 ` [Ocfs2-devel] [PATCH 2/5] ocfs2: Fix ocfs2_osb_dump() Sunil Mushran
2009-06-19 23:31   ` Joel Becker
2009-06-19 21:45 ` [Ocfs2-devel] [PATCH 3/5] ocfs2: Stop orphan scan as early as possible during umount Sunil Mushran
2009-06-19 21:57   ` Joel Becker
2009-06-19 21:45 ` Sunil Mushran [this message]
2009-06-19 21:59   ` [Ocfs2-devel] [PATCH 4/5] ocfs2: Do not initialize lvb in ocfs2_orphan_scan_lock_res_init() Joel Becker
2009-06-19 21:45 ` [Ocfs2-devel] [PATCH 5/5] ocfs2: Disable orphan scanning for local and hard-ro mounts Sunil Mushran
2009-06-19 22:01   ` Joel Becker
2009-06-19 23:31 ` [Ocfs2-devel] [PATCH 1/5] ocfs2: Pin journal head before accessing jh->b_committed_data Joel Becker
2009-06-19 23:53 [Ocfs2-devel] Orphan scan fixes - V2 Sunil Mushran
2009-06-19 23:53 ` [Ocfs2-devel] [PATCH 4/5] ocfs2: Do not initialize lvb in ocfs2_orphan_scan_lock_res_init() Sunil Mushran
2009-06-20  6:05   ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245447958-12996-4-git-send-email-sunil.mushran@oracle.com \
    --to=sunil.mushran@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.