aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-04 09:49:55 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-04 09:49:55 -0400
commit5029996547a9f3988459e11955c13259495308ef (patch)
tree4667c98c19a6f39dc820e4eb648ecfa03b29bce2
parente9fc2aa091ab8fa46e60d4c9d06a89305c441652 (diff)
[GFS2] Tidy up locking code
As per Jan Engelhardt's second email, this removes some unused code, and fixes up indenting in various places. Cc: Jan Engelhardt <jengelh@linux01.gwdg.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/glock.c53
-rw-r--r--fs/gfs2/glock.h6
-rw-r--r--fs/gfs2/lm.c62
-rw-r--r--fs/gfs2/lm.h25
-rw-r--r--fs/gfs2/lm_interface.h2
-rw-r--r--fs/gfs2/locking.c10
-rw-r--r--fs/gfs2/main.c2
7 files changed, 47 insertions, 113 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 989f4f78f9be..fac271f390bf 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -300,8 +300,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
300 300
301 /* If this glock protects actual on-disk data or metadata blocks, 301 /* If this glock protects actual on-disk data or metadata blocks,
302 create a VFS inode to manage the pages/buffers holding them. */ 302 create a VFS inode to manage the pages/buffers holding them. */
303 if (glops == &gfs2_inode_glops || 303 if (glops == &gfs2_inode_glops || glops == &gfs2_rgrp_glops) {
304 glops == &gfs2_rgrp_glops) {
305 gl->gl_aspace = gfs2_aspace_get(sdp); 304 gl->gl_aspace = gfs2_aspace_get(sdp);
306 if (!gl->gl_aspace) { 305 if (!gl->gl_aspace) {
307 error = -ENOMEM; 306 error = -ENOMEM;
@@ -820,13 +819,11 @@ static void xmote_bh(struct gfs2_glock *gl, unsigned int ret)
820 819
821 if (!gh) 820 if (!gh)
822 gl->gl_stamp = jiffies; 821 gl->gl_stamp = jiffies;
823
824 else if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { 822 else if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
825 spin_lock(&gl->gl_spin); 823 spin_lock(&gl->gl_spin);
826 list_del_init(&gh->gh_list); 824 list_del_init(&gh->gh_list);
827 gh->gh_error = -EIO; 825 gh->gh_error = -EIO;
828 spin_unlock(&gl->gl_spin); 826 spin_unlock(&gl->gl_spin);
829
830 } else if (test_bit(HIF_DEMOTE, &gh->gh_iflags)) { 827 } else if (test_bit(HIF_DEMOTE, &gh->gh_iflags)) {
831 spin_lock(&gl->gl_spin); 828 spin_lock(&gl->gl_spin);
832 list_del_init(&gh->gh_list); 829 list_del_init(&gh->gh_list);
@@ -842,7 +839,7 @@ static void xmote_bh(struct gfs2_glock *gl, unsigned int ret)
842 spin_unlock(&gl->gl_spin); 839 spin_unlock(&gl->gl_spin);
843 840
844 if (ret & LM_OUT_CANCELED) 841 if (ret & LM_OUT_CANCELED)
845 handle_callback(gl, LM_ST_UNLOCKED); /* Lame */ 842 handle_callback(gl, LM_ST_UNLOCKED);
846 843
847 } else if (ret & LM_OUT_CANCELED) { 844 } else if (ret & LM_OUT_CANCELED) {
848 spin_lock(&gl->gl_spin); 845 spin_lock(&gl->gl_spin);
@@ -916,11 +913,8 @@ void gfs2_glock_xmote_th(struct gfs2_glock *gl, unsigned int state, int flags)
916 gfs2_assert_warn(sdp, state != LM_ST_UNLOCKED); 913 gfs2_assert_warn(sdp, state != LM_ST_UNLOCKED);
917 gfs2_assert_warn(sdp, state != gl->gl_state); 914 gfs2_assert_warn(sdp, state != gl->gl_state);
918 915
919 if (gl->gl_state == LM_ST_EXCLUSIVE) { 916 if (gl->gl_state == LM_ST_EXCLUSIVE && glops->go_sync)
920 if (glops->go_sync) 917 glops->go_sync(gl, DIO_METADATA | DIO_DATA | DIO_RELEASE);
921 glops->go_sync(gl,
922 DIO_METADATA | DIO_DATA | DIO_RELEASE);
923 }
924 918
925 gfs2_glock_hold(gl); 919 gfs2_glock_hold(gl);
926 gl->gl_req_bh = xmote_bh; 920 gl->gl_req_bh = xmote_bh;
@@ -1006,10 +1000,8 @@ void gfs2_glock_drop_th(struct gfs2_glock *gl)
1006 gfs2_assert_warn(sdp, queue_empty(gl, &gl->gl_holders)); 1000 gfs2_assert_warn(sdp, queue_empty(gl, &gl->gl_holders));
1007 gfs2_assert_warn(sdp, gl->gl_state != LM_ST_UNLOCKED); 1001 gfs2_assert_warn(sdp, gl->gl_state != LM_ST_UNLOCKED);
1008 1002
1009 if (gl->gl_state == LM_ST_EXCLUSIVE) { 1003 if (gl->gl_state == LM_ST_EXCLUSIVE && glops->go_sync)
1010 if (glops->go_sync) 1004 glops->go_sync(gl, DIO_METADATA | DIO_DATA | DIO_RELEASE);
1011 glops->go_sync(gl, DIO_METADATA | DIO_DATA | DIO_RELEASE);
1012 }
1013 1005
1014 gfs2_glock_hold(gl); 1006 gfs2_glock_hold(gl);
1015 gl->gl_req_bh = drop_bh; 1007 gl->gl_req_bh = drop_bh;
@@ -1041,9 +1033,8 @@ static void do_cancels(struct gfs2_holder *gh)
1041 while (gl->gl_req_gh != gh && 1033 while (gl->gl_req_gh != gh &&
1042 !test_bit(HIF_HOLDER, &gh->gh_iflags) && 1034 !test_bit(HIF_HOLDER, &gh->gh_iflags) &&
1043 !list_empty(&gh->gh_list)) { 1035 !list_empty(&gh->gh_list)) {
1044 if (gl->gl_req_bh && 1036 if (gl->gl_req_bh && !(gl->gl_req_gh &&
1045 !(gl->gl_req_gh && 1037 (gl->gl_req_gh->gh_flags & GL_NOCANCEL))) {
1046 (gl->gl_req_gh->gh_flags & GL_NOCANCEL))) {
1047 spin_unlock(&gl->gl_spin); 1038 spin_unlock(&gl->gl_spin);
1048 gfs2_lm_cancel(gl->gl_sbd, gl->gl_lock); 1039 gfs2_lm_cancel(gl->gl_sbd, gl->gl_lock);
1049 msleep(100); 1040 msleep(100);
@@ -1323,10 +1314,8 @@ static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state,
1323 1314
1324 spin_lock(&gl->gl_spin); 1315 spin_lock(&gl->gl_spin);
1325 1316
1326 if (test_bit(GLF_LOCK, &gl->gl_flags) || 1317 if (test_bit(GLF_LOCK, &gl->gl_flags) || !list_empty(&gl->gl_holders) ||
1327 !list_empty(&gl->gl_holders) || 1318 !list_empty(&gl->gl_waiters1) || !list_empty(&gl->gl_waiters2) ||
1328 !list_empty(&gl->gl_waiters1) ||
1329 !list_empty(&gl->gl_waiters2) ||
1330 !list_empty(&gl->gl_waiters3) || 1319 !list_empty(&gl->gl_waiters3) ||
1331 relaxed_state_ok(gl->gl_state, state, flags)) { 1320 relaxed_state_ok(gl->gl_state, state, flags)) {
1332 spin_unlock(&gl->gl_spin); 1321 spin_unlock(&gl->gl_spin);
@@ -1690,19 +1679,6 @@ void gfs2_lvb_unhold(struct gfs2_glock *gl)
1690 gfs2_glock_put(gl); 1679 gfs2_glock_put(gl);
1691} 1680}
1692 1681
1693#if 0
1694void gfs2_lvb_sync(struct gfs2_glock *gl)
1695{
1696 gfs2_glmutex_lock(gl);
1697
1698 gfs2_assert(gl->gl_sbd, atomic_read(&gl->gl_lvb_count));
1699 if (!gfs2_assert_warn(gl->gl_sbd, gfs2_glock_is_held_excl(gl)))
1700 gfs2_lm_sync_lvb(gl->gl_sbd, gl->gl_lock, gl->gl_lvb);
1701
1702 gfs2_glmutex_unlock(gl);
1703}
1704#endif /* 0 */
1705
1706static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name, 1682static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,
1707 unsigned int state) 1683 unsigned int state)
1708{ 1684{
@@ -1813,8 +1789,7 @@ static int demote_ok(struct gfs2_glock *gl)
1813 if (test_bit(GLF_STICKY, &gl->gl_flags)) 1789 if (test_bit(GLF_STICKY, &gl->gl_flags))
1814 demote = 0; 1790 demote = 0;
1815 else if (test_bit(GLF_PREFETCH, &gl->gl_flags)) 1791 else if (test_bit(GLF_PREFETCH, &gl->gl_flags))
1816 demote = time_after_eq(jiffies, 1792 demote = time_after_eq(jiffies, gl->gl_stamp +
1817 gl->gl_stamp +
1818 gfs2_tune_get(sdp, gt_prefetch_secs) * HZ); 1793 gfs2_tune_get(sdp, gt_prefetch_secs) * HZ);
1819 else if (glops->go_demote_ok) 1794 else if (glops->go_demote_ok)
1820 demote = glops->go_demote_ok(gl); 1795 demote = glops->go_demote_ok(gl);
@@ -1872,8 +1847,7 @@ void gfs2_reclaim_glock(struct gfs2_sbd *sdp)
1872 1847
1873 if (gfs2_glmutex_trylock(gl)) { 1848 if (gfs2_glmutex_trylock(gl)) {
1874 if (queue_empty(gl, &gl->gl_holders) && 1849 if (queue_empty(gl, &gl->gl_holders) &&
1875 gl->gl_state != LM_ST_UNLOCKED && 1850 gl->gl_state != LM_ST_UNLOCKED && demote_ok(gl))
1876 demote_ok(gl))
1877 handle_callback(gl, LM_ST_UNLOCKED); 1851 handle_callback(gl, LM_ST_UNLOCKED);
1878 gfs2_glmutex_unlock(gl); 1852 gfs2_glmutex_unlock(gl);
1879 } 1853 }
@@ -2036,8 +2010,7 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
2036 cont = 0; 2010 cont = 0;
2037 2011
2038 for (x = 0; x < GFS2_GL_HASH_SIZE; x++) 2012 for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
2039 if (examine_bucket(clear_glock, sdp, 2013 if (examine_bucket(clear_glock, sdp, &sdp->sd_gl_hash[x]))
2040 &sdp->sd_gl_hash[x]))
2041 cont = 1; 2014 cont = 1;
2042 2015
2043 if (!wait || !cont) 2016 if (!wait || !cont)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 07a8d02a234d..1a90a1983beb 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -51,17 +51,17 @@ static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
51 51
52static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl) 52static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl)
53{ 53{
54 return (gl->gl_state == LM_ST_EXCLUSIVE); 54 return gl->gl_state == LM_ST_EXCLUSIVE;
55} 55}
56 56
57static inline int gfs2_glock_is_held_dfrd(struct gfs2_glock *gl) 57static inline int gfs2_glock_is_held_dfrd(struct gfs2_glock *gl)
58{ 58{
59 return (gl->gl_state == LM_ST_DEFERRED); 59 return gl->gl_state == LM_ST_DEFERRED;
60} 60}
61 61
62static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl) 62static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl)
63{ 63{
64 return (gl->gl_state == LM_ST_SHARED); 64 return gl->gl_state == LM_ST_SHARED;
65} 65}
66 66
67static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl) 67static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
diff --git a/fs/gfs2/lm.c b/fs/gfs2/lm.c
index 1a9e75da19d1..fb918c7de655 100644
--- a/fs/gfs2/lm.c
+++ b/fs/gfs2/lm.c
@@ -124,10 +124,8 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
124int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name, 124int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
125 lm_lock_t **lockp) 125 lm_lock_t **lockp)
126{ 126{
127 int error; 127 int error = -EIO;
128 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 128 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
129 error = -EIO;
130 else
131 error = sdp->sd_lockstruct.ls_ops->lm_get_lock( 129 error = sdp->sd_lockstruct.ls_ops->lm_get_lock(
132 sdp->sd_lockstruct.ls_lockspace, name, lockp); 130 sdp->sd_lockstruct.ls_lockspace, name, lockp);
133 return error; 131 return error;
@@ -143,12 +141,9 @@ unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
143 unsigned int cur_state, unsigned int req_state, 141 unsigned int cur_state, unsigned int req_state,
144 unsigned int flags) 142 unsigned int flags)
145{ 143{
146 int ret; 144 int ret = 0;
147 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 145 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
148 ret = 0; 146 ret = sdp->sd_lockstruct.ls_ops->lm_lock(lock, cur_state,
149 else
150 ret = sdp->sd_lockstruct.ls_ops->lm_lock(lock,
151 cur_state,
152 req_state, flags); 147 req_state, flags);
153 return ret; 148 return ret;
154} 149}
@@ -156,10 +151,8 @@ unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
156unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock, 151unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock,
157 unsigned int cur_state) 152 unsigned int cur_state)
158{ 153{
159 int ret; 154 int ret = 0;
160 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 155 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
161 ret = 0;
162 else
163 ret = sdp->sd_lockstruct.ls_ops->lm_unlock(lock, cur_state); 156 ret = sdp->sd_lockstruct.ls_ops->lm_unlock(lock, cur_state);
164 return ret; 157 return ret;
165} 158}
@@ -172,10 +165,8 @@ void gfs2_lm_cancel(struct gfs2_sbd *sdp, lm_lock_t *lock)
172 165
173int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp) 166int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp)
174{ 167{
175 int error; 168 int error = -EIO;
176 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 169 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
177 error = -EIO;
178 else
179 error = sdp->sd_lockstruct.ls_ops->lm_hold_lvb(lock, lvbp); 170 error = sdp->sd_lockstruct.ls_ops->lm_hold_lvb(lock, lvbp);
180 return error; 171 return error;
181} 172}
@@ -186,50 +177,33 @@ void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb)
186 sdp->sd_lockstruct.ls_ops->lm_unhold_lvb(lock, lvb); 177 sdp->sd_lockstruct.ls_ops->lm_unhold_lvb(lock, lvb);
187} 178}
188 179
189#if 0
190void gfs2_lm_sync_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb)
191{
192 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
193 sdp->sd_lockstruct.ls_ops->lm_sync_lvb(lock, lvb);
194}
195#endif /* 0 */
196
197int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name, 180int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name,
198 struct file *file, struct file_lock *fl) 181 struct file *file, struct file_lock *fl)
199{ 182{
200 int error; 183 int error = -EIO;
201 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 184 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
202 error = -EIO;
203 else
204 error = sdp->sd_lockstruct.ls_ops->lm_plock_get( 185 error = sdp->sd_lockstruct.ls_ops->lm_plock_get(
205 sdp->sd_lockstruct.ls_lockspace, 186 sdp->sd_lockstruct.ls_lockspace, name, file, fl);
206 name, file, fl);
207 return error; 187 return error;
208} 188}
209 189
210int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name, 190int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name,
211 struct file *file, int cmd, struct file_lock *fl) 191 struct file *file, int cmd, struct file_lock *fl)
212{ 192{
213 int error; 193 int error = -EIO;
214 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 194 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
215 error = -EIO;
216 else
217 error = sdp->sd_lockstruct.ls_ops->lm_plock( 195 error = sdp->sd_lockstruct.ls_ops->lm_plock(
218 sdp->sd_lockstruct.ls_lockspace, 196 sdp->sd_lockstruct.ls_lockspace, name, file, cmd, fl);
219 name, file, cmd, fl);
220 return error; 197 return error;
221} 198}
222 199
223int gfs2_lm_punlock(struct gfs2_sbd *sdp, struct lm_lockname *name, 200int gfs2_lm_punlock(struct gfs2_sbd *sdp, struct lm_lockname *name,
224 struct file *file, struct file_lock *fl) 201 struct file *file, struct file_lock *fl)
225{ 202{
226 int error; 203 int error = -EIO;
227 if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) 204 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
228 error = -EIO;
229 else
230 error = sdp->sd_lockstruct.ls_ops->lm_punlock( 205 error = sdp->sd_lockstruct.ls_ops->lm_punlock(
231 sdp->sd_lockstruct.ls_lockspace, 206 sdp->sd_lockstruct.ls_lockspace, name, file, fl);
232 name, file, fl);
233 return error; 207 return error;
234} 208}
235 209
diff --git a/fs/gfs2/lm.h b/fs/gfs2/lm.h
index 15839aaa4ca6..dbef88852ef3 100644
--- a/fs/gfs2/lm.h
+++ b/fs/gfs2/lm.h
@@ -16,9 +16,9 @@ int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent);
16void gfs2_lm_others_may_mount(struct gfs2_sbd *sdp); 16void gfs2_lm_others_may_mount(struct gfs2_sbd *sdp);
17void gfs2_lm_unmount(struct gfs2_sbd *sdp); 17void gfs2_lm_unmount(struct gfs2_sbd *sdp);
18int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...) 18int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
19__attribute__ ((format(printf, 2, 3))); 19 __attribute__ ((format(printf, 2, 3)));
20int gfs2_lm_get_lock(struct gfs2_sbd *sdp, 20int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
21 struct lm_lockname *name, lm_lock_t **lockp); 21 lm_lock_t **lockp);
22void gfs2_lm_put_lock(struct gfs2_sbd *sdp, lm_lock_t *lock); 22void gfs2_lm_put_lock(struct gfs2_sbd *sdp, lm_lock_t *lock);
23unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock, 23unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
24 unsigned int cur_state, unsigned int req_state, 24 unsigned int cur_state, unsigned int req_state,
@@ -28,16 +28,13 @@ unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock,
28void gfs2_lm_cancel(struct gfs2_sbd *sdp, lm_lock_t *lock); 28void gfs2_lm_cancel(struct gfs2_sbd *sdp, lm_lock_t *lock);
29int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp); 29int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp);
30void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb); 30void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb);
31int gfs2_lm_plock_get(struct gfs2_sbd *sdp, 31int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name,
32 struct lm_lockname *name, 32 struct file *file, struct file_lock *fl);
33 struct file *file, struct file_lock *fl); 33int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name,
34int gfs2_lm_plock(struct gfs2_sbd *sdp, 34 struct file *file, int cmd, struct file_lock *fl);
35 struct lm_lockname *name, 35int gfs2_lm_punlock(struct gfs2_sbd *sdp, struct lm_lockname *name,
36 struct file *file, int cmd, struct file_lock *fl); 36 struct file *file, struct file_lock *fl);
37int gfs2_lm_punlock(struct gfs2_sbd *sdp, 37void gfs2_lm_recovery_done(struct gfs2_sbd *sdp, unsigned int jid,
38 struct lm_lockname *name, 38 unsigned int message);
39 struct file *file, struct file_lock *fl);
40void gfs2_lm_recovery_done(struct gfs2_sbd *sdp,
41 unsigned int jid, unsigned int message);
42 39
43#endif /* __LM_DOT_H__ */ 40#endif /* __LM_DOT_H__ */
diff --git a/fs/gfs2/lm_interface.h b/fs/gfs2/lm_interface.h
index e1e89d92a8db..0bf4c276e0fe 100644
--- a/fs/gfs2/lm_interface.h
+++ b/fs/gfs2/lm_interface.h
@@ -260,8 +260,6 @@ struct lm_lockstruct {
260 int ls_flags; 260 int ls_flags;
261}; 261};
262 262
263void __init gfs2_init_lmh(void);
264
265/* 263/*
266 * Lock module bottom interface. A lock module makes itself available to GFS 264 * Lock module bottom interface. A lock module makes itself available to GFS
267 * with these functions. 265 * with these functions.
diff --git a/fs/gfs2/locking.c b/fs/gfs2/locking.c
index 11c4068105cc..fce2001e5e25 100644
--- a/fs/gfs2/locking.c
+++ b/fs/gfs2/locking.c
@@ -27,8 +27,8 @@ struct lmh_wrapper {
27/* List of registered low-level locking protocols. A file system selects one 27/* List of registered low-level locking protocols. A file system selects one
28 of them by name at mount time, e.g. lock_nolock, lock_dlm. */ 28 of them by name at mount time, e.g. lock_nolock, lock_dlm. */
29 29
30static struct list_head lmh_list; 30static LIST_HEAD(lmh_list);
31static struct mutex lmh_lock; 31static DEFINE_MUTEX(lmh_lock);
32 32
33/** 33/**
34 * gfs2_register_lockproto - Register a low-level locking protocol 34 * gfs2_register_lockproto - Register a low-level locking protocol
@@ -180,12 +180,6 @@ void gfs2_withdraw_lockproto(struct lm_lockstruct *lockstruct)
180 mutex_unlock(&lmh_lock); 180 mutex_unlock(&lmh_lock);
181} 181}
182 182
183void __init gfs2_init_lmh(void)
184{
185 mutex_init(&lmh_lock);
186 INIT_LIST_HEAD(&lmh_list);
187}
188
189EXPORT_SYMBOL_GPL(gfs2_register_lockproto); 183EXPORT_SYMBOL_GPL(gfs2_register_lockproto);
190EXPORT_SYMBOL_GPL(gfs2_unregister_lockproto); 184EXPORT_SYMBOL_GPL(gfs2_unregister_lockproto);
191 185
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index b46f400705a2..143fda727a9c 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -65,8 +65,6 @@ static int __init init_gfs2_fs(void)
65{ 65{
66 int error; 66 int error;
67 67
68 gfs2_init_lmh();
69
70 error = gfs2_sys_init(); 68 error = gfs2_sys_init();
71 if (error) 69 if (error)
72 return error; 70 return error;