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/btrfs/disk-io.c | |
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/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 08e65e9cf2aa..61dae01788d7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1180,7 +1180,7 @@ static struct btrfs_subvolume_writers *btrfs_alloc_subvolume_writers(void) | |||
1180 | if (!writers) | 1180 | if (!writers) |
1181 | return ERR_PTR(-ENOMEM); | 1181 | return ERR_PTR(-ENOMEM); |
1182 | 1182 | ||
1183 | ret = percpu_counter_init(&writers->counter, 0); | 1183 | ret = percpu_counter_init(&writers->counter, 0, GFP_KERNEL); |
1184 | if (ret < 0) { | 1184 | if (ret < 0) { |
1185 | kfree(writers); | 1185 | kfree(writers); |
1186 | return ERR_PTR(ret); | 1186 | return ERR_PTR(ret); |
@@ -2185,7 +2185,7 @@ int open_ctree(struct super_block *sb, | |||
2185 | goto fail_srcu; | 2185 | goto fail_srcu; |
2186 | } | 2186 | } |
2187 | 2187 | ||
2188 | ret = percpu_counter_init(&fs_info->dirty_metadata_bytes, 0); | 2188 | ret = percpu_counter_init(&fs_info->dirty_metadata_bytes, 0, GFP_KERNEL); |
2189 | if (ret) { | 2189 | if (ret) { |
2190 | err = ret; | 2190 | err = ret; |
2191 | goto fail_bdi; | 2191 | goto fail_bdi; |
@@ -2193,13 +2193,13 @@ int open_ctree(struct super_block *sb, | |||
2193 | fs_info->dirty_metadata_batch = PAGE_CACHE_SIZE * | 2193 | fs_info->dirty_metadata_batch = PAGE_CACHE_SIZE * |
2194 | (1 + ilog2(nr_cpu_ids)); | 2194 | (1 + ilog2(nr_cpu_ids)); |
2195 | 2195 | ||
2196 | ret = percpu_counter_init(&fs_info->delalloc_bytes, 0); | 2196 | ret = percpu_counter_init(&fs_info->delalloc_bytes, 0, GFP_KERNEL); |
2197 | if (ret) { | 2197 | if (ret) { |
2198 | err = ret; | 2198 | err = ret; |
2199 | goto fail_dirty_metadata_bytes; | 2199 | goto fail_dirty_metadata_bytes; |
2200 | } | 2200 | } |
2201 | 2201 | ||
2202 | ret = percpu_counter_init(&fs_info->bio_counter, 0); | 2202 | ret = percpu_counter_init(&fs_info->bio_counter, 0, GFP_KERNEL); |
2203 | if (ret) { | 2203 | if (ret) { |
2204 | err = ret; | 2204 | err = ret; |
2205 | goto fail_delalloc_bytes; | 2205 | goto fail_delalloc_bytes; |