aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-08-30 12:50:28 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-30 12:50:28 -0400
commit899be4d3b7e00bf364d84c1c8cfe8bbbd1e3507b (patch)
treefd3af3ebb3c237a4c309c3f48902f9550864c39e /fs/gfs2/glock.c
parentd6a53727683bbf993c01ab49b45e0eac17e23df1 (diff)
[GFS2] Add superblock into key for glock lookups
This adds the superblock as a key for glock lookups. Since the glocks are already stored in a per-superblock table, this has no effect at the moment. Later on this will change though. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 679cb836ed0c..b8ccb27906e8 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -200,6 +200,7 @@ static inline int queue_empty(struct gfs2_glock *gl, struct list_head *head)
200 */ 200 */
201 201
202static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket, 202static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
203 const struct gfs2_sbd *sdp,
203 const struct lm_lockname *name) 204 const struct lm_lockname *name)
204{ 205{
205 struct gfs2_glock *gl; 206 struct gfs2_glock *gl;
@@ -209,6 +210,8 @@ static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
209 continue; 210 continue;
210 if (!lm_name_equal(&gl->gl_name, name)) 211 if (!lm_name_equal(&gl->gl_name, name))
211 continue; 212 continue;
213 if (gl->gl_sbd != sdp)
214 continue;
212 215
213 kref_get(&gl->gl_ref); 216 kref_get(&gl->gl_ref);
214 217
@@ -233,7 +236,7 @@ static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
233 struct gfs2_glock *gl; 236 struct gfs2_glock *gl;
234 237
235 read_lock(&bucket->hb_lock); 238 read_lock(&bucket->hb_lock);
236 gl = search_bucket(bucket, name); 239 gl = search_bucket(bucket, sdp, name);
237 read_unlock(&bucket->hb_lock); 240 read_unlock(&bucket->hb_lock);
238 241
239 return gl; 242 return gl;
@@ -266,7 +269,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
266 bucket = &sdp->sd_gl_hash[gl_hash(&name)]; 269 bucket = &sdp->sd_gl_hash[gl_hash(&name)];
267 270
268 read_lock(&bucket->hb_lock); 271 read_lock(&bucket->hb_lock);
269 gl = search_bucket(bucket, &name); 272 gl = search_bucket(bucket, sdp, &name);
270 read_unlock(&bucket->hb_lock); 273 read_unlock(&bucket->hb_lock);
271 274
272 if (gl || !create) { 275 if (gl || !create) {
@@ -311,7 +314,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
311 goto fail_aspace; 314 goto fail_aspace;
312 315
313 write_lock(&bucket->hb_lock); 316 write_lock(&bucket->hb_lock);
314 tmp = search_bucket(bucket, &name); 317 tmp = search_bucket(bucket, sdp, &name);
315 if (tmp) { 318 if (tmp) {
316 write_unlock(&bucket->hb_lock); 319 write_unlock(&bucket->hb_lock);
317 glock_free(gl); 320 glock_free(gl);