diff options
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 4d5d63d9d2c0..1ed81f40da0d 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -1977,6 +1977,8 @@ static const struct seq_operations gfs2_sbstats_seq_ops = { | |||
1977 | .show = gfs2_sbstats_seq_show, | 1977 | .show = gfs2_sbstats_seq_show, |
1978 | }; | 1978 | }; |
1979 | 1979 | ||
1980 | #define GFS2_SEQ_GOODSIZE min(PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER, 65536UL) | ||
1981 | |||
1980 | static int gfs2_glocks_open(struct inode *inode, struct file *file) | 1982 | static int gfs2_glocks_open(struct inode *inode, struct file *file) |
1981 | { | 1983 | { |
1982 | int ret = seq_open_private(file, &gfs2_glock_seq_ops, | 1984 | int ret = seq_open_private(file, &gfs2_glock_seq_ops, |
@@ -1985,9 +1987,9 @@ static int gfs2_glocks_open(struct inode *inode, struct file *file) | |||
1985 | struct seq_file *seq = file->private_data; | 1987 | struct seq_file *seq = file->private_data; |
1986 | struct gfs2_glock_iter *gi = seq->private; | 1988 | struct gfs2_glock_iter *gi = seq->private; |
1987 | gi->sdp = inode->i_private; | 1989 | gi->sdp = inode->i_private; |
1988 | seq->buf = kmalloc(8*PAGE_SIZE, GFP_KERNEL | __GFP_NOWARN); | 1990 | seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN); |
1989 | if (seq->buf) | 1991 | if (seq->buf) |
1990 | seq->size = 8*PAGE_SIZE; | 1992 | seq->size = GFS2_SEQ_GOODSIZE; |
1991 | } | 1993 | } |
1992 | return ret; | 1994 | return ret; |
1993 | } | 1995 | } |
@@ -2000,9 +2002,9 @@ static int gfs2_glstats_open(struct inode *inode, struct file *file) | |||
2000 | struct seq_file *seq = file->private_data; | 2002 | struct seq_file *seq = file->private_data; |
2001 | struct gfs2_glock_iter *gi = seq->private; | 2003 | struct gfs2_glock_iter *gi = seq->private; |
2002 | gi->sdp = inode->i_private; | 2004 | gi->sdp = inode->i_private; |
2003 | seq->buf = kmalloc(8*PAGE_SIZE, GFP_KERNEL | __GFP_NOWARN); | 2005 | seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN); |
2004 | if (seq->buf) | 2006 | if (seq->buf) |
2005 | seq->size = 8*PAGE_SIZE; | 2007 | seq->size = GFS2_SEQ_GOODSIZE; |
2006 | } | 2008 | } |
2007 | return ret; | 2009 | return ret; |
2008 | } | 2010 | } |