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 213391 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 third of five patches
gl-clean-3.diff (text/plain), 6.01 KB, created by
Steve Whitehouse
on 2007-10-02 13:38:03 UTC
(
hide
)
Description:
The third of five patches
Filename:
MIME Type:
Creator:
Steve Whitehouse
Created:
2007-10-02 13:38:03 UTC
Size:
6.01 KB
patch
obsolete
>From swhiteho@redhat.com Mon Jul 30 05:54:18 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:18 -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 > l6U9sCFr014089; Mon, 30 Jul 2007 05:54:17 -0400 >From: Steven Whitehouse <swhiteho@redhat.com> >To: cluster-devel@redhat.com >Cc: Steven Whitehouse <swhiteho@redhat.com> >Subject: [PATCH] [GFS2] Merge ->go_drop_th() with ->go_xmote_th() >Date: Mon, 30 Jul 2007 10:32:16 +0100 >Message-Id: <11857879493817-git-send-email-swhiteho@redhat.com> >X-Mailer: git-send-email 1.5.1.2 >In-Reply-To: <11857879472203-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> >X-Evolution-Source: imap://swhiteho@pobox.fab.redhat.com/ >Content-Transfer-Encoding: 8bit >Mime-Version: 1.0 > >The drop and xmote callbacks were functionally identical >for glock types which had those callbacks. This patch >merges the functions while at the same time adding >an extra variable to the go_xmote_th() function for >future use (the new state). Thus both the new and old >states are now available in that callback. > >This results in a fair amount of duplicate code being removed. > >Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> > >diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c >index 79d61ff..dd23ab1 100644 >--- a/fs/gfs2/glock.c >+++ b/fs/gfs2/glock.c >@@ -822,7 +822,7 @@ static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh) > unsigned int lck_ret; > > if (glops->go_xmote_th) >- glops->go_xmote_th(gl); >+ 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)); >@@ -901,8 +901,8 @@ static void gfs2_glock_drop_th(struct gfs2_glock *gl) > const struct gfs2_glock_operations *glops = gl->gl_ops; > unsigned int ret; > >- if (glops->go_drop_th) >- glops->go_drop_th(gl); >+ if (glops->go_xmote_th) >+ glops->go_xmote_th(gl, LM_ST_UNLOCKED); > > gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); > gfs2_assert_warn(sdp, list_empty(&gl->gl_holders)); >diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c >index 777ca46..3a9729f 100644 >--- a/fs/gfs2/glops.c >+++ b/fs/gfs2/glops.c >@@ -114,7 +114,7 @@ static void gfs2_pte_inval(struct gfs2_glock *gl) > * not return to caller to demote/unlock the glock until I/O is complete. > */ > >-static void meta_go_sync(struct gfs2_glock *gl) >+static void meta_go_sync(struct gfs2_glock *gl, unsigned new_state) > { > if (gl->gl_state != LM_ST_EXCLUSIVE) > return; >@@ -178,7 +178,7 @@ static void inode_go_sync(struct gfs2_glock *gl) > * > */ > >-static void inode_go_xmote_th(struct gfs2_glock *gl) >+static void inode_go_xmote_th(struct gfs2_glock *gl, unsigned new_state) > { > if (gl->gl_state != LM_ST_UNLOCKED) > gfs2_pte_inval(gl); >@@ -207,22 +207,6 @@ static void inode_go_xmote_bh(struct gfs2_glock *gl) > } > > /** >- * inode_go_drop_th - unlock a glock >- * @gl: the glock >- * >- * Invoked from rq_demote(). >- * Another node needs the lock in EXCLUSIVE mode, or lock (unused for too long) >- * is being purged from our node's glock cache; we're dropping lock. >- */ >- >-static void inode_go_drop_th(struct gfs2_glock *gl) >-{ >- gfs2_pte_inval(gl); >- if (gl->gl_state == LM_ST_EXCLUSIVE) >- inode_go_sync(gl); >-} >- >-/** > * inode_go_inval - prepare a inode glock to be released > * @gl: the glock > * @flags: >@@ -363,7 +347,7 @@ static void rgrp_go_unlock(struct gfs2_holder *gh) > * > */ > >-static void trans_go_xmote_th(struct gfs2_glock *gl) >+static void trans_go_xmote_th(struct gfs2_glock *gl, unsigned new_state) > { > struct gfs2_sbd *sdp = gl->gl_sbd; > >@@ -408,24 +392,6 @@ static void trans_go_xmote_bh(struct gfs2_glock *gl) > } > > /** >- * trans_go_drop_th - unlock the transaction glock >- * @gl: the glock >- * >- * We want to sync the device even with localcaching. Remember >- * that localcaching journal replay only marks buffers dirty. >- */ >- >-static void trans_go_drop_th(struct gfs2_glock *gl) >-{ >- struct gfs2_sbd *sdp = gl->gl_sbd; >- >- if (test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { >- gfs2_meta_syncfs(sdp); >- gfs2_log_shutdown(sdp); >- } >-} >- >-/** > * quota_go_demote_ok - Check to see if it's ok to unlock a quota glock > * @gl: the glock > * >@@ -439,14 +405,12 @@ static int quota_go_demote_ok(struct gfs2_glock *gl) > > const struct gfs2_glock_operations gfs2_meta_glops = { > .go_xmote_th = meta_go_sync, >- .go_drop_th = meta_go_sync, > .go_type = LM_TYPE_META, > }; > > const struct gfs2_glock_operations gfs2_inode_glops = { > .go_xmote_th = inode_go_xmote_th, > .go_xmote_bh = inode_go_xmote_bh, >- .go_drop_th = inode_go_drop_th, > .go_inval = inode_go_inval, > .go_demote_ok = inode_go_demote_ok, > .go_lock = inode_go_lock, >@@ -456,7 +420,6 @@ const struct gfs2_glock_operations gfs2_inode_glops = { > > const struct gfs2_glock_operations gfs2_rgrp_glops = { > .go_xmote_th = meta_go_sync, >- .go_drop_th = meta_go_sync, > .go_inval = meta_go_inval, > .go_demote_ok = rgrp_go_demote_ok, > .go_lock = rgrp_go_lock, >@@ -467,7 +430,6 @@ const struct gfs2_glock_operations gfs2_rgrp_glops = { > const struct gfs2_glock_operations gfs2_trans_glops = { > .go_xmote_th = trans_go_xmote_th, > .go_xmote_bh = trans_go_xmote_bh, >- .go_drop_th = trans_go_drop_th, > .go_type = LM_TYPE_NONDISK, > }; > >diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h >index 170ba93..8b91f83 100644 >--- a/fs/gfs2/incore.h >+++ b/fs/gfs2/incore.h >@@ -122,9 +122,8 @@ struct gfs2_bufdata { > }; > > struct gfs2_glock_operations { >- void (*go_xmote_th) (struct gfs2_glock *gl); >+ void (*go_xmote_th) (struct gfs2_glock *gl, unsigned new_state); > void (*go_xmote_bh) (struct gfs2_glock *gl); >- void (*go_drop_th) (struct gfs2_glock *gl); > void (*go_inval) (struct gfs2_glock *gl, int flags); > int (*go_demote_ok) (struct gfs2_glock *gl); > int (*go_lock) (struct gfs2_holder *gh); >-- >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