diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-01-12 05:43:39 -0500 |
---|---|---|
committer | Steven Whitehouse <steve@dolmen.chygwyn.com> | 2009-03-24 07:21:14 -0400 |
commit | f057f6cdf64175db1151b1f5d110e29904f119a1 (patch) | |
tree | 582dbf358e351f64977620c29ebf772d693b1948 /fs/gfs2/recovery.c | |
parent | 22077f57dec8fcbeb1112b35313961c0902ff038 (diff) |
GFS2: Merge lock_dlm module into GFS2
This is the big patch that I've been working on for some time
now. There are many reasons for wanting to make this change
such as:
o Reducing overhead by eliminating duplicated fields between structures
o Simplifcation of the code (reduces the code size by a fair bit)
o The locking interface is now the DLM interface itself as proposed
some time ago.
o Fewer lookups of glocks when processing replies from the DLM
o Fewer memory allocations/deallocations for each glock
o Scope to do further optimisations in the future (but this patch is
more than big enough for now!)
Please note that (a) this patch relates to the lock_dlm module and
not the DLM itself, that is still a separate module; and (b) that
we retain the ability to build GFS2 as a standalone single node
filesystem with out requiring the DLM.
This patch needs a lot of testing, hence my keeping it I restarted
my -git tree after the last merge window. That way, this has the maximum
exposure before its merged. This is (modulo a few minor bug fixes) the
same patch that I've been posting on and off the the last three months
and its passed a number of different tests so far.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/recovery.c')
-rw-r--r-- | fs/gfs2/recovery.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index efd09c3d2b26..247e8f7d6b3d 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/buffer_head.h> | 13 | #include <linux/buffer_head.h> |
14 | #include <linux/gfs2_ondisk.h> | 14 | #include <linux/gfs2_ondisk.h> |
15 | #include <linux/crc32.h> | 15 | #include <linux/crc32.h> |
16 | #include <linux/lm_interface.h> | ||
17 | #include <linux/kthread.h> | 16 | #include <linux/kthread.h> |
18 | #include <linux/freezer.h> | 17 | #include <linux/freezer.h> |
19 | 18 | ||
@@ -427,20 +426,23 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header_host *hea | |||
427 | } | 426 | } |
428 | 427 | ||
429 | 428 | ||
430 | static void gfs2_lm_recovery_done(struct gfs2_sbd *sdp, unsigned int jid, | 429 | static void gfs2_recovery_done(struct gfs2_sbd *sdp, unsigned int jid, |
431 | unsigned int message) | 430 | unsigned int message) |
432 | { | 431 | { |
433 | if (!sdp->sd_lockstruct.ls_ops->lm_recovery_done) | 432 | char env_jid[20]; |
434 | return; | 433 | char env_status[20]; |
435 | 434 | char *envp[] = { env_jid, env_status, NULL }; | |
436 | if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) | 435 | struct lm_lockstruct *ls = &sdp->sd_lockstruct; |
437 | sdp->sd_lockstruct.ls_ops->lm_recovery_done( | 436 | ls->ls_recover_jid_done = jid; |
438 | sdp->sd_lockstruct.ls_lockspace, jid, message); | 437 | ls->ls_recover_jid_status = message; |
438 | sprintf(env_jid, "JID=%d", jid); | ||
439 | sprintf(env_status, "RECOVERY=%s", | ||
440 | message == LM_RD_SUCCESS ? "Done" : "Failed"); | ||
441 | kobject_uevent_env(&sdp->sd_kobj, KOBJ_CHANGE, envp); | ||
439 | } | 442 | } |
440 | 443 | ||
441 | |||
442 | /** | 444 | /** |
443 | * gfs2_recover_journal - recovery a given journal | 445 | * gfs2_recover_journal - recover a given journal |
444 | * @jd: the struct gfs2_jdesc describing the journal | 446 | * @jd: the struct gfs2_jdesc describing the journal |
445 | * | 447 | * |
446 | * Acquire the journal's lock, check to see if the journal is clean, and | 448 | * Acquire the journal's lock, check to see if the journal is clean, and |
@@ -561,7 +563,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd) | |||
561 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) | 563 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) |
562 | gfs2_glock_dq_uninit(&ji_gh); | 564 | gfs2_glock_dq_uninit(&ji_gh); |
563 | 565 | ||
564 | gfs2_lm_recovery_done(sdp, jd->jd_jid, LM_RD_SUCCESS); | 566 | gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_SUCCESS); |
565 | 567 | ||
566 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) | 568 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) |
567 | gfs2_glock_dq_uninit(&j_gh); | 569 | gfs2_glock_dq_uninit(&j_gh); |
@@ -581,7 +583,7 @@ fail_gunlock_j: | |||
581 | fs_info(sdp, "jid=%u: %s\n", jd->jd_jid, (error) ? "Failed" : "Done"); | 583 | fs_info(sdp, "jid=%u: %s\n", jd->jd_jid, (error) ? "Failed" : "Done"); |
582 | 584 | ||
583 | fail: | 585 | fail: |
584 | gfs2_lm_recovery_done(sdp, jd->jd_jid, LM_RD_GAVEUP); | 586 | gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_GAVEUP); |
585 | return error; | 587 | return error; |
586 | } | 588 | } |
587 | 589 | ||