diff options
author | Tejun Heo <tj@kernel.org> | 2014-09-07 20:51:29 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-09-07 20:51:29 -0400 |
commit | 908c7f1949cb7cc6e92ba8f18f2998e87e265b8e (patch) | |
tree | af885c65c6fe794cab7b7ad37bd811531a2a2ac5 /fs/ext2 | |
parent | ebd8fef304f99da84d4a52ad056f6137ac9652d4 (diff) |
percpu_counter: add @gfp to percpu_counter_init()
Percpu allocator now supports allocation mask. Add @gfp to
percpu_counter_init() so that !GFP_KERNEL allocation masks can be used
with percpu_counters too.
We could have left percpu_counter_init() alone and added
percpu_counter_init_gfp(); however, the number of users isn't that
high and introducing _gfp variants to all percpu data structures would
be quite ugly, so let's just do the conversion. This is the one with
the most users. Other percpu data structures are a lot easier to
convert.
This patch doesn't make any functional difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jan Kara <jack@suse.cz>
Acked-by: "David S. Miller" <davem@davemloft.net>
Cc: x86@kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/super.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index b88edc05c230..170dc41e8bf4 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -1067,14 +1067,14 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
1067 | ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); | 1067 | ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); |
1068 | 1068 | ||
1069 | err = percpu_counter_init(&sbi->s_freeblocks_counter, | 1069 | err = percpu_counter_init(&sbi->s_freeblocks_counter, |
1070 | ext2_count_free_blocks(sb)); | 1070 | ext2_count_free_blocks(sb), GFP_KERNEL); |
1071 | if (!err) { | 1071 | if (!err) { |
1072 | err = percpu_counter_init(&sbi->s_freeinodes_counter, | 1072 | err = percpu_counter_init(&sbi->s_freeinodes_counter, |
1073 | ext2_count_free_inodes(sb)); | 1073 | ext2_count_free_inodes(sb), GFP_KERNEL); |
1074 | } | 1074 | } |
1075 | if (!err) { | 1075 | if (!err) { |
1076 | err = percpu_counter_init(&sbi->s_dirs_counter, | 1076 | err = percpu_counter_init(&sbi->s_dirs_counter, |
1077 | ext2_count_dirs(sb)); | 1077 | ext2_count_dirs(sb), GFP_KERNEL); |
1078 | } | 1078 | } |
1079 | if (err) { | 1079 | if (err) { |
1080 | ext2_msg(sb, KERN_ERR, "error: insufficient memory"); | 1080 | ext2_msg(sb, KERN_ERR, "error: insufficient memory"); |