Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54470
b: refs/heads/master
c: 7a0079d
h: refs/heads/master
v: v3
  • Loading branch information
Robert Peterson authored and Steven Whitehouse committed May 1, 2007
1 parent 45aa219 commit d7fbf30
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fa1de386f4d72f0710b389ccf96308fef87df78
refs/heads/master: 7a0079d9e3fe8826475a08785f3d348c4b509774
29 changes: 21 additions & 8 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,15 +1765,20 @@ static void gfs2_print_symbol(struct glock_iter *gi, const char *fmt,
{
/* when sprint_symbol becomes available in the new kernel, replace this */
/* function with:
char buffer[KSYM_SYMBOL_LEN];
char buffer[KSYM_SYMBOL_LEN];
sprint_symbol(buffer, address);
print_dbg(gi, fmt, buffer);
sprint_symbol(buffer, address);
print_dbg(gi, fmt, buffer);
*/
if (gi)
print_dbg(gi, fmt, address);
else
print_symbol(fmt, address);
char buffer[256];

if (gi) {
memset(buffer, 0, sizeof(buffer));
sprintf(buffer, "%p", address);
print_dbg(gi, fmt, buffer);
}
else
print_symbol(fmt, address);
}

/**
Expand Down Expand Up @@ -1993,14 +1998,19 @@ int __init gfs2_glock_init(void)

static int gfs2_glock_iter_next(struct glock_iter *gi)
{
read_lock(gl_lock_addr(gi->hash));
while (1) {
if (!gi->hb_list) { /* If we don't have a hash bucket yet */
gi->hb_list = &gl_hash_table[gi->hash].hb_list;
if (hlist_empty(gi->hb_list)) {
read_unlock(gl_lock_addr(gi->hash));
gi->hash++;
read_lock(gl_lock_addr(gi->hash));
gi->hb_list = NULL;
if (gi->hash >= GFS2_GL_HASH_SIZE)
if (gi->hash >= GFS2_GL_HASH_SIZE) {
read_unlock(gl_lock_addr(gi->hash));
return 1;
}
else
continue;
}
Expand All @@ -2011,7 +2021,9 @@ static int gfs2_glock_iter_next(struct glock_iter *gi)
}
} else {
if (gi->gl->gl_list.next == NULL) {
read_unlock(gl_lock_addr(gi->hash));
gi->hash++;
read_lock(gl_lock_addr(gi->hash));
gi->hb_list = NULL;
continue;
}
Expand All @@ -2021,6 +2033,7 @@ static int gfs2_glock_iter_next(struct glock_iter *gi)
if (gi->gl)
break;
}
read_unlock(gl_lock_addr(gi->hash));
return 0;
}

Expand Down

0 comments on commit d7fbf30

Please sign in to comment.