diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-05-21 12:03:22 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-06-27 04:39:22 -0400 |
commit | 6802e3400ff4549525930ee744030c36fce9cc73 (patch) | |
tree | db889bf5337c1d3bb12ebbf571c3c1cad1040496 /fs/gfs2/incore.h | |
parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) |
[GFS2] Clean up the glock core
This patch implements a number of cleanups to the core of the
GFS2 glock code. As a result a lot of code is removed. It looks
like a really big change, but actually a large part of this patch
is either removing or moving existing code.
There are some new bits too though, such as the new run_queue()
function which is considerably streamlined. Highlights of this
patch include:
o Fixes a cluster coherency bug during SH -> EX lock conversions
o Removes the "glmutex" code in favour of a single bit lock
o Removes the ->go_xmote_bh() for inodes since it was duplicating
->go_lock()
o We now only use the ->lm_lock() function for both locks and
unlocks (i.e. unlock is a lock with target mode LM_ST_UNLOCKED)
o The fast path is considerably shortly, giving performance gains
especially with lock_nolock
o The glock_workqueue is now used for all the callbacks from the DLM
which allows us to simplify the lock_dlm module (see following patch)
o The way is now open to make further changes such as eliminating the two
threads (gfs2_glockd and gfs2_scand) in favour of a more efficient
scheme.
This patch has undergone extensive testing with various test suites
so it should be pretty stable by now.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index eabe5eac41da..4b734c6e34f0 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -128,20 +128,20 @@ struct gfs2_bufdata { | |||
128 | 128 | ||
129 | struct gfs2_glock_operations { | 129 | struct gfs2_glock_operations { |
130 | void (*go_xmote_th) (struct gfs2_glock *gl); | 130 | void (*go_xmote_th) (struct gfs2_glock *gl); |
131 | void (*go_xmote_bh) (struct gfs2_glock *gl); | 131 | int (*go_xmote_bh) (struct gfs2_glock *gl, struct gfs2_holder *gh); |
132 | void (*go_inval) (struct gfs2_glock *gl, int flags); | 132 | void (*go_inval) (struct gfs2_glock *gl, int flags); |
133 | int (*go_demote_ok) (struct gfs2_glock *gl); | 133 | int (*go_demote_ok) (struct gfs2_glock *gl); |
134 | int (*go_lock) (struct gfs2_holder *gh); | 134 | int (*go_lock) (struct gfs2_holder *gh); |
135 | void (*go_unlock) (struct gfs2_holder *gh); | 135 | void (*go_unlock) (struct gfs2_holder *gh); |
136 | int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl); | ||
136 | const int go_type; | 137 | const int go_type; |
137 | const unsigned long go_min_hold_time; | 138 | const unsigned long go_min_hold_time; |
138 | }; | 139 | }; |
139 | 140 | ||
140 | enum { | 141 | enum { |
141 | /* States */ | 142 | /* States */ |
142 | HIF_HOLDER = 6, | 143 | HIF_HOLDER = 6, /* Set for gh that "holds" the glock */ |
143 | HIF_FIRST = 7, | 144 | HIF_FIRST = 7, |
144 | HIF_ABORTED = 9, | ||
145 | HIF_WAIT = 10, | 145 | HIF_WAIT = 10, |
146 | }; | 146 | }; |
147 | 147 | ||
@@ -154,20 +154,20 @@ struct gfs2_holder { | |||
154 | unsigned gh_flags; | 154 | unsigned gh_flags; |
155 | 155 | ||
156 | int gh_error; | 156 | int gh_error; |
157 | unsigned long gh_iflags; | 157 | unsigned long gh_iflags; /* HIF_... */ |
158 | unsigned long gh_ip; | 158 | unsigned long gh_ip; |
159 | }; | 159 | }; |
160 | 160 | ||
161 | enum { | 161 | enum { |
162 | GLF_LOCK = 1, | 162 | GLF_LOCK = 1, |
163 | GLF_STICKY = 2, | 163 | GLF_STICKY = 2, |
164 | GLF_DEMOTE = 3, | 164 | GLF_DEMOTE = 3, |
165 | GLF_PENDING_DEMOTE = 4, | 165 | GLF_PENDING_DEMOTE = 4, |
166 | GLF_DIRTY = 5, | 166 | GLF_DEMOTE_IN_PROGRESS = 5, |
167 | GLF_DEMOTE_IN_PROGRESS = 6, | 167 | GLF_DIRTY = 6, |
168 | GLF_LFLUSH = 7, | 168 | GLF_LFLUSH = 7, |
169 | GLF_WAITERS2 = 8, | 169 | GLF_INVALIDATE_IN_PROGRESS = 8, |
170 | GLF_CONV_DEADLK = 9, | 170 | GLF_REPLY_PENDING = 9, |
171 | }; | 171 | }; |
172 | 172 | ||
173 | struct gfs2_glock { | 173 | struct gfs2_glock { |
@@ -179,19 +179,14 @@ struct gfs2_glock { | |||
179 | spinlock_t gl_spin; | 179 | spinlock_t gl_spin; |
180 | 180 | ||
181 | unsigned int gl_state; | 181 | unsigned int gl_state; |
182 | unsigned int gl_target; | ||
183 | unsigned int gl_reply; | ||
182 | unsigned int gl_hash; | 184 | unsigned int gl_hash; |
183 | unsigned int gl_demote_state; /* state requested by remote node */ | 185 | unsigned int gl_demote_state; /* state requested by remote node */ |
184 | unsigned long gl_demote_time; /* time of first demote request */ | 186 | unsigned long gl_demote_time; /* time of first demote request */ |
185 | struct pid *gl_owner_pid; | ||
186 | unsigned long gl_ip; | ||
187 | struct list_head gl_holders; | 187 | struct list_head gl_holders; |
188 | struct list_head gl_waiters1; /* HIF_MUTEX */ | ||
189 | struct list_head gl_waiters3; /* HIF_PROMOTE */ | ||
190 | 188 | ||
191 | const struct gfs2_glock_operations *gl_ops; | 189 | const struct gfs2_glock_operations *gl_ops; |
192 | |||
193 | struct gfs2_holder *gl_req_gh; | ||
194 | |||
195 | void *gl_lock; | 190 | void *gl_lock; |
196 | char *gl_lvb; | 191 | char *gl_lvb; |
197 | atomic_t gl_lvb_count; | 192 | atomic_t gl_lvb_count; |