aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/glock.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 98e845b7841b..11066d8647d2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1945,13 +1945,9 @@ static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
1945{ 1945{
1946 struct gfs2_glock_iter *gi = seq->private; 1946 struct gfs2_glock_iter *gi = seq->private;
1947 loff_t n = *pos; 1947 loff_t n = *pos;
1948 int ret;
1949
1950 if (gi->last_pos <= *pos)
1951 n = (*pos - gi->last_pos);
1952 1948
1953 ret = rhashtable_walk_start(&gi->hti); 1949 rhashtable_walk_enter(&gl_hash_table, &gi->hti);
1954 if (ret) 1950 if (rhashtable_walk_start(&gi->hti) != 0)
1955 return NULL; 1951 return NULL;
1956 1952
1957 do { 1953 do {
@@ -1959,6 +1955,7 @@ static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
1959 } while (gi->gl && n--); 1955 } while (gi->gl && n--);
1960 1956
1961 gi->last_pos = *pos; 1957 gi->last_pos = *pos;
1958
1962 return gi->gl; 1959 return gi->gl;
1963} 1960}
1964 1961
@@ -1970,6 +1967,7 @@ static void *gfs2_glock_seq_next(struct seq_file *seq, void *iter_ptr,
1970 (*pos)++; 1967 (*pos)++;
1971 gi->last_pos = *pos; 1968 gi->last_pos = *pos;
1972 gfs2_glock_iter_next(gi); 1969 gfs2_glock_iter_next(gi);
1970
1973 return gi->gl; 1971 return gi->gl;
1974} 1972}
1975 1973
@@ -1980,6 +1978,7 @@ static void gfs2_glock_seq_stop(struct seq_file *seq, void *iter_ptr)
1980 1978
1981 gi->gl = NULL; 1979 gi->gl = NULL;
1982 rhashtable_walk_stop(&gi->hti); 1980 rhashtable_walk_stop(&gi->hti);
1981 rhashtable_walk_exit(&gi->hti);
1983} 1982}
1984 1983
1985static int gfs2_glock_seq_show(struct seq_file *seq, void *iter_ptr) 1984static int gfs2_glock_seq_show(struct seq_file *seq, void *iter_ptr)
@@ -2042,12 +2041,10 @@ static int __gfs2_glocks_open(struct inode *inode, struct file *file,
2042 struct gfs2_glock_iter *gi = seq->private; 2041 struct gfs2_glock_iter *gi = seq->private;
2043 2042
2044 gi->sdp = inode->i_private; 2043 gi->sdp = inode->i_private;
2045 gi->last_pos = 0;
2046 seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN); 2044 seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN);
2047 if (seq->buf) 2045 if (seq->buf)
2048 seq->size = GFS2_SEQ_GOODSIZE; 2046 seq->size = GFS2_SEQ_GOODSIZE;
2049 gi->gl = NULL; 2047 gi->gl = NULL;
2050 rhashtable_walk_enter(&gl_hash_table, &gi->hti);
2051 } 2048 }
2052 return ret; 2049 return ret;
2053} 2050}
@@ -2063,7 +2060,6 @@ static int gfs2_glocks_release(struct inode *inode, struct file *file)
2063 struct gfs2_glock_iter *gi = seq->private; 2060 struct gfs2_glock_iter *gi = seq->private;
2064 2061
2065 gi->gl = NULL; 2062 gi->gl = NULL;
2066 rhashtable_walk_exit(&gi->hti);
2067 return seq_release_private(inode, file); 2063 return seq_release_private(inode, file);
2068} 2064}
2069 2065