summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-15 22:29:51 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-15 22:29:51 -0500
commitbf3f14d6342cfb37eab8f0cddd0e4d4063fd9fc9 (patch)
tree2907cdfb8da2c43bf4c599bc3d398274e21dfc91 /fs/gfs2/glock.c
parent75224c93fa985f4a6fb983f53208f5c5aa555fbf (diff)
downloadlinux-bf3f14d6342cfb37eab8f0cddd0e4d4063fd9fc9.tar.bz2
rhashtable: Revert nested table changes.
This reverts commits: 6a25478077d987edc5e2f880590a2bc5fcab4441 9dbbfb0ab6680c6a85609041011484e6658e7d3c 40137906c5f55c252194ef5834130383e639536f It's too risky to put in this late in the release cycle. We'll put these changes into the next merge window instead. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 70e94170af85..94f50cac91c6 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1420,32 +1420,26 @@ static struct shrinker glock_shrinker = {
* @sdp: the filesystem
* @bucket: the bucket
*
- * Note that the function can be called multiple times on the same
- * object. So the user must ensure that the function can cope with
- * that.
*/
static void glock_hash_walk(glock_examiner examiner, const struct gfs2_sbd *sdp)
{
struct gfs2_glock *gl;
- struct rhashtable_iter iter;
-
- rhashtable_walk_enter(&gl_hash_table, &iter);
-
- do {
- gl = ERR_PTR(rhashtable_walk_start(&iter));
- if (gl)
- continue;
+ struct rhash_head *pos;
+ const struct bucket_table *tbl;
+ int i;
- while ((gl = rhashtable_walk_next(&iter)) && !IS_ERR(gl))
+ rcu_read_lock();
+ tbl = rht_dereference_rcu(gl_hash_table.tbl, &gl_hash_table);
+ for (i = 0; i < tbl->size; i++) {
+ rht_for_each_entry_rcu(gl, pos, tbl, i, gl_node) {
if ((gl->gl_name.ln_sbd == sdp) &&
lockref_get_not_dead(&gl->gl_lockref))
examiner(gl);
-
- rhashtable_walk_stop(&iter);
- } while (cond_resched(), gl == ERR_PTR(-EAGAIN));
-
- rhashtable_walk_exit(&iter);
+ }
+ }
+ rcu_read_unlock();
+ cond_resched();
}
/**