Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 213401 Details for
Bug 221152
GFS2: Clean up of glock code
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
The fourth of five patches
gl-clean-4.diff (text/plain), 6.63 KB, created by
Steve Whitehouse
on 2007-10-02 13:38:33 UTC
(
hide
)
Description:
The fourth of five patches
Filename:
MIME Type:
Creator:
Steve Whitehouse
Created:
2007-10-02 13:38:33 UTC
Size:
6.63 KB
patch
obsolete
>From swhiteho@redhat.com Mon Jul 30 05:54:20 2007 >Return-Path: <swhiteho@redhat.com> >Received: from pobox.fab.redhat.com ([unix socket]) by pobox.fab.redhat.com > (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with LMTPA; Mon, 30 Jul 2007 > 05:54:20 -0400 >X-Sieve: CMU Sieve 2.2 >Received: from localhost.localdomain (vpn-14-116.rdu.redhat.com > [10.11.14.116]) by pobox.fab.redhat.com (8.13.1/8.13.1) with ESMTP id > l6U9sCFs014089; Mon, 30 Jul 2007 05:54:19 -0400 >From: Steven Whitehouse <swhiteho@redhat.com> >To: cluster-devel@redhat.com >Cc: Steven Whitehouse <swhiteho@redhat.com> >Subject: [PATCH] [GFS2] Merge gfs2_glock_drop_th() into > gfs2_glock_xmote_th() >Date: Mon, 30 Jul 2007 10:32:17 +0100 >Message-Id: <11857879512912-git-send-email-swhiteho@redhat.com> >X-Mailer: git-send-email 1.5.1.2 >In-Reply-To: <11857879493817-git-send-email-swhiteho@redhat.com> >References: <11857879381186-git-send-email-swhiteho@redhat.com> > <1185787946183-git-send-email-swhiteho@redhat.com> > <11857879472203-git-send-email-swhiteho@redhat.com> > <11857879493817-git-send-email-swhiteho@redhat.com> >X-Evolution-Source: imap://swhiteho@pobox.fab.redhat.com/ >Content-Transfer-Encoding: 8bit >Mime-Version: 1.0 > >These two functions were very similar in form. After the previous >patch its fairly easy to merge them. Also there was some left >over code in drop_bh() which was unused since we no longer use >gfs2_holder structures for "drop"s. > >Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> > >diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c >index dd23ab1..6324f57 100644 >--- a/fs/gfs2/glock.c >+++ b/fs/gfs2/glock.c >@@ -55,7 +55,6 @@ typedef void (*glock_examiner) (struct gfs2_glock * gl); > static int gfs2_dump_lockstate(struct gfs2_sbd *sdp); > static int dump_glock(struct glock_iter *gi, struct gfs2_glock *gl); > static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh); >-static void gfs2_glock_drop_th(struct gfs2_glock *gl); > static DECLARE_RWSEM(gfs2_umount_flush_sem); > static struct dentry *gfs2_root; > >@@ -544,16 +543,9 @@ static int rq_demote(struct gfs2_glock *gl) > return 0; > } > set_bit(GLF_LOCK, &gl->gl_flags); >- if (gl->gl_demote_state == LM_ST_UNLOCKED || >- gl->gl_state != LM_ST_EXCLUSIVE) { >- spin_unlock(&gl->gl_spin); >- gfs2_glock_drop_th(gl); >- } else { >- spin_unlock(&gl->gl_spin); >- gfs2_glock_xmote_th(gl, NULL); >- } >+ spin_unlock(&gl->gl_spin); >+ gfs2_glock_xmote_th(gl, NULL); > spin_lock(&gl->gl_spin); >- > return 0; > } > >@@ -750,7 +742,7 @@ static void xmote_bh(struct gfs2_glock *gl, unsigned int ret) > if (gl->gl_state != gl->gl_demote_state) { > gl->gl_req_bh = NULL; > spin_unlock(&gl->gl_spin); >- gfs2_glock_drop_th(gl); >+ gfs2_glock_xmote_th(gl, NULL); > gfs2_glock_put(gl); > return; > } >@@ -803,47 +795,6 @@ out: > } > > /** >- * gfs2_glock_xmote_th - Call into the lock module to acquire or change a glock >- * @gl: The glock in question >- * @state: the requested state >- * @flags: modifier flags to the lock call >- * >- */ >- >-static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh) >-{ >- struct gfs2_sbd *sdp = gl->gl_sbd; >- int flags = gh ? gh->gh_flags : 0; >- unsigned state = gh ? gh->gh_state : gl->gl_demote_state; >- const struct gfs2_glock_operations *glops = gl->gl_ops; >- int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB | >- LM_FLAG_NOEXP | LM_FLAG_ANY | >- LM_FLAG_PRIORITY); >- unsigned int lck_ret; >- >- if (glops->go_xmote_th) >- glops->go_xmote_th(gl, state); >- >- gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); >- gfs2_assert_warn(sdp, list_empty(&gl->gl_holders)); >- gfs2_assert_warn(sdp, state != LM_ST_UNLOCKED); >- gfs2_assert_warn(sdp, state != gl->gl_state); >- >- gfs2_glock_hold(gl); >- gl->gl_req_bh = xmote_bh; >- >- lck_ret = gfs2_lm_lock(sdp, gl->gl_lock, gl->gl_state, state, lck_flags); >- >- if (gfs2_assert_withdraw(sdp, !(lck_ret & LM_OUT_ERROR))) >- return; >- >- if (lck_ret & LM_OUT_ASYNC) >- gfs2_assert_warn(sdp, lck_ret == LM_OUT_ASYNC); >- else >- xmote_bh(gl, lck_ret); >-} >- >-/** > * drop_bh - Called after a lock module unlock completes > * @gl: the glock > * @ret: the return status >@@ -857,7 +808,6 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret) > { > struct gfs2_sbd *sdp = gl->gl_sbd; > const struct gfs2_glock_operations *glops = gl->gl_ops; >- struct gfs2_holder *gh = gl->gl_req_gh; > > gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); > gfs2_assert_warn(sdp, list_empty(&gl->gl_holders)); >@@ -869,57 +819,59 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret) > if (glops->go_inval) > glops->go_inval(gl, DIO_METADATA); > >- if (gh) { >- spin_lock(&gl->gl_spin); >- list_del_init(&gh->gh_list); >- gh->gh_error = 0; >- spin_unlock(&gl->gl_spin); >- } >- > spin_lock(&gl->gl_spin); >- gl->gl_req_gh = NULL; > gl->gl_req_bh = NULL; > clear_bit(GLF_LOCK, &gl->gl_flags); > run_queue(gl); > spin_unlock(&gl->gl_spin); > > gfs2_glock_put(gl); >- >- if (gh) >- gfs2_holder_wake(gh); > } > > /** >- * gfs2_glock_drop_th - call into the lock module to unlock a lock >- * @gl: the glock >+ * gfs2_glock_xmote_th - Call into the lock module to acquire or change a glock >+ * @gl: The glock in question >+ * @state: the requested state >+ * @flags: modifier flags to the lock call > * > */ > >-static void gfs2_glock_drop_th(struct gfs2_glock *gl) >+static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh) > { > struct gfs2_sbd *sdp = gl->gl_sbd; >+ int flags = gh ? gh->gh_flags : 0; >+ unsigned state = gh ? gh->gh_state : gl->gl_demote_state; > const struct gfs2_glock_operations *glops = gl->gl_ops; >- unsigned int ret; >+ int lck_flags = flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB | >+ LM_FLAG_NOEXP | LM_FLAG_ANY | >+ LM_FLAG_PRIORITY); >+ unsigned int lck_ret; > > if (glops->go_xmote_th) >- glops->go_xmote_th(gl, LM_ST_UNLOCKED); >+ glops->go_xmote_th(gl, state); > > gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); > gfs2_assert_warn(sdp, list_empty(&gl->gl_holders)); >- gfs2_assert_warn(sdp, gl->gl_state != LM_ST_UNLOCKED); >+ gfs2_assert_warn(sdp, state != gl->gl_state); > > gfs2_glock_hold(gl); >- gl->gl_req_bh = drop_bh; >+ if (state != LM_ST_UNLOCKED) { >+ gl->gl_req_bh = xmote_bh; >+ lck_ret = gfs2_lm_lock(sdp, gl->gl_lock, gl->gl_state, state, lck_flags); >+ } else { >+ gl->gl_req_bh = drop_bh; >+ lck_ret = gfs2_lm_unlock(sdp, gl->gl_lock, gl->gl_state); >+ } > >- ret = gfs2_lm_unlock(sdp, gl->gl_lock, gl->gl_state); >+ if (gfs2_assert_withdraw(sdp, !(lck_ret & LM_OUT_ERROR))) >+ return; > >- if (gfs2_assert_withdraw(sdp, !(ret & LM_OUT_ERROR))) >+ if ((lck_ret & LM_OUT_ASYNC) == 0) { >+ gl->gl_req_bh(gl, lck_ret); > return; >+ } > >- if (!ret) >- drop_bh(gl, ret); >- else >- gfs2_assert_warn(sdp, ret == LM_OUT_ASYNC); >+ BUG_ON(lck_ret != LM_OUT_ASYNC); > } > > /** >-- >1.5.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 221152
:
213371
|
213381
|
213391
| 213401 |
213411
|
241931