aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 63a6152be04b..19b7bf4284ee 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -34,6 +34,7 @@
34#include "disk-io.h" 34#include "disk-io.h"
35#include "btrfs_inode.h" 35#include "btrfs_inode.h"
36#include "transaction.h" 36#include "transaction.h"
37#include "compression.h"
37 38
38static int g_verbose = 0; 39static int g_verbose = 0;
39 40
@@ -304,7 +305,7 @@ static struct fs_path *fs_path_alloc(void)
304{ 305{
305 struct fs_path *p; 306 struct fs_path *p;
306 307
307 p = kmalloc(sizeof(*p), GFP_NOFS); 308 p = kmalloc(sizeof(*p), GFP_KERNEL);
308 if (!p) 309 if (!p)
309 return NULL; 310 return NULL;
310 p->reversed = 0; 311 p->reversed = 0;
@@ -363,11 +364,11 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
363 * First time the inline_buf does not suffice 364 * First time the inline_buf does not suffice
364 */ 365 */
365 if (p->buf == p->inline_buf) { 366 if (p->buf == p->inline_buf) {
366 tmp_buf = kmalloc(len, GFP_NOFS); 367 tmp_buf = kmalloc(len, GFP_KERNEL);
367 if (tmp_buf) 368 if (tmp_buf)
368 memcpy(tmp_buf, p->buf, old_buf_len); 369 memcpy(tmp_buf, p->buf, old_buf_len);
369 } else { 370 } else {
370 tmp_buf = krealloc(p->buf, len, GFP_NOFS); 371 tmp_buf = krealloc(p->buf, len, GFP_KERNEL);
371 } 372 }
372 if (!tmp_buf) 373 if (!tmp_buf)
373 return -ENOMEM; 374 return -ENOMEM;
@@ -995,7 +996,7 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
995 * values are small. 996 * values are small.
996 */ 997 */
997 buf_len = PATH_MAX; 998 buf_len = PATH_MAX;
998 buf = kmalloc(buf_len, GFP_NOFS); 999 buf = kmalloc(buf_len, GFP_KERNEL);
999 if (!buf) { 1000 if (!buf) {
1000 ret = -ENOMEM; 1001 ret = -ENOMEM;
1001 goto out; 1002 goto out;
@@ -1042,7 +1043,7 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
1042 buf = NULL; 1043 buf = NULL;
1043 } else { 1044 } else {
1044 char *tmp = krealloc(buf, buf_len, 1045 char *tmp = krealloc(buf, buf_len,
1045 GFP_NOFS | __GFP_NOWARN); 1046 GFP_KERNEL | __GFP_NOWARN);
1046 1047
1047 if (!tmp) 1048 if (!tmp)
1048 kfree(buf); 1049 kfree(buf);
@@ -1303,7 +1304,7 @@ static int find_extent_clone(struct send_ctx *sctx,
1303 /* We only use this path under the commit sem */ 1304 /* We only use this path under the commit sem */
1304 tmp_path->need_commit_sem = 0; 1305 tmp_path->need_commit_sem = 0;
1305 1306
1306 backref_ctx = kmalloc(sizeof(*backref_ctx), GFP_NOFS); 1307 backref_ctx = kmalloc(sizeof(*backref_ctx), GFP_KERNEL);
1307 if (!backref_ctx) { 1308 if (!backref_ctx) {
1308 ret = -ENOMEM; 1309 ret = -ENOMEM;
1309 goto out; 1310 goto out;
@@ -1984,7 +1985,7 @@ static int name_cache_insert(struct send_ctx *sctx,
1984 nce_head = radix_tree_lookup(&sctx->name_cache, 1985 nce_head = radix_tree_lookup(&sctx->name_cache,
1985 (unsigned long)nce->ino); 1986 (unsigned long)nce->ino);
1986 if (!nce_head) { 1987 if (!nce_head) {
1987 nce_head = kmalloc(sizeof(*nce_head), GFP_NOFS); 1988 nce_head = kmalloc(sizeof(*nce_head), GFP_KERNEL);
1988 if (!nce_head) { 1989 if (!nce_head) {
1989 kfree(nce); 1990 kfree(nce);
1990 return -ENOMEM; 1991 return -ENOMEM;
@@ -2179,7 +2180,7 @@ out_cache:
2179 /* 2180 /*
2180 * Store the result of the lookup in the name cache. 2181 * Store the result of the lookup in the name cache.
2181 */ 2182 */
2182 nce = kmalloc(sizeof(*nce) + fs_path_len(dest) + 1, GFP_NOFS); 2183 nce = kmalloc(sizeof(*nce) + fs_path_len(dest) + 1, GFP_KERNEL);
2183 if (!nce) { 2184 if (!nce) {
2184 ret = -ENOMEM; 2185 ret = -ENOMEM;
2185 goto out; 2186 goto out;
@@ -2315,7 +2316,7 @@ static int send_subvol_begin(struct send_ctx *sctx)
2315 if (!path) 2316 if (!path)
2316 return -ENOMEM; 2317 return -ENOMEM;
2317 2318
2318 name = kmalloc(BTRFS_PATH_NAME_MAX, GFP_NOFS); 2319 name = kmalloc(BTRFS_PATH_NAME_MAX, GFP_KERNEL);
2319 if (!name) { 2320 if (!name) {
2320 btrfs_free_path(path); 2321 btrfs_free_path(path);
2321 return -ENOMEM; 2322 return -ENOMEM;
@@ -2730,7 +2731,7 @@ static int __record_ref(struct list_head *head, u64 dir,
2730{ 2731{
2731 struct recorded_ref *ref; 2732 struct recorded_ref *ref;
2732 2733
2733 ref = kmalloc(sizeof(*ref), GFP_NOFS); 2734 ref = kmalloc(sizeof(*ref), GFP_KERNEL);
2734 if (!ref) 2735 if (!ref)
2735 return -ENOMEM; 2736 return -ENOMEM;
2736 2737
@@ -2755,7 +2756,7 @@ static int dup_ref(struct recorded_ref *ref, struct list_head *list)
2755{ 2756{
2756 struct recorded_ref *new; 2757 struct recorded_ref *new;
2757 2758
2758 new = kmalloc(sizeof(*ref), GFP_NOFS); 2759 new = kmalloc(sizeof(*ref), GFP_KERNEL);
2759 if (!new) 2760 if (!new)
2760 return -ENOMEM; 2761 return -ENOMEM;
2761 2762
@@ -2818,7 +2819,7 @@ add_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino)
2818 struct rb_node *parent = NULL; 2819 struct rb_node *parent = NULL;
2819 struct orphan_dir_info *entry, *odi; 2820 struct orphan_dir_info *entry, *odi;
2820 2821
2821 odi = kmalloc(sizeof(*odi), GFP_NOFS); 2822 odi = kmalloc(sizeof(*odi), GFP_KERNEL);
2822 if (!odi) 2823 if (!odi)
2823 return ERR_PTR(-ENOMEM); 2824 return ERR_PTR(-ENOMEM);
2824 odi->ino = dir_ino; 2825 odi->ino = dir_ino;
@@ -2973,7 +2974,7 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino, bool orphanized)
2973 struct rb_node *parent = NULL; 2974 struct rb_node *parent = NULL;
2974 struct waiting_dir_move *entry, *dm; 2975 struct waiting_dir_move *entry, *dm;
2975 2976
2976 dm = kmalloc(sizeof(*dm), GFP_NOFS); 2977 dm = kmalloc(sizeof(*dm), GFP_KERNEL);
2977 if (!dm) 2978 if (!dm)
2978 return -ENOMEM; 2979 return -ENOMEM;
2979 dm->ino = ino; 2980 dm->ino = ino;
@@ -3040,7 +3041,7 @@ static int add_pending_dir_move(struct send_ctx *sctx,
3040 int exists = 0; 3041 int exists = 0;
3041 int ret; 3042 int ret;
3042 3043
3043 pm = kmalloc(sizeof(*pm), GFP_NOFS); 3044 pm = kmalloc(sizeof(*pm), GFP_KERNEL);
3044 if (!pm) 3045 if (!pm)
3045 return -ENOMEM; 3046 return -ENOMEM;
3046 pm->parent_ino = parent_ino; 3047 pm->parent_ino = parent_ino;
@@ -4280,7 +4281,7 @@ static int __find_xattr(int num, struct btrfs_key *di_key,
4280 strncmp(name, ctx->name, name_len) == 0) { 4281 strncmp(name, ctx->name, name_len) == 0) {
4281 ctx->found_idx = num; 4282 ctx->found_idx = num;
4282 ctx->found_data_len = data_len; 4283 ctx->found_data_len = data_len;
4283 ctx->found_data = kmemdup(data, data_len, GFP_NOFS); 4284 ctx->found_data = kmemdup(data, data_len, GFP_KERNEL);
4284 if (!ctx->found_data) 4285 if (!ctx->found_data)
4285 return -ENOMEM; 4286 return -ENOMEM;
4286 return 1; 4287 return 1;
@@ -4481,7 +4482,7 @@ static ssize_t fill_read_buf(struct send_ctx *sctx, u64 offset, u32 len)
4481 while (index <= last_index) { 4482 while (index <= last_index) {
4482 unsigned cur_len = min_t(unsigned, len, 4483 unsigned cur_len = min_t(unsigned, len,
4483 PAGE_CACHE_SIZE - pg_offset); 4484 PAGE_CACHE_SIZE - pg_offset);
4484 page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); 4485 page = find_or_create_page(inode->i_mapping, index, GFP_KERNEL);
4485 if (!page) { 4486 if (!page) {
4486 ret = -ENOMEM; 4487 ret = -ENOMEM;
4487 break; 4488 break;
@@ -5989,7 +5990,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
5989 goto out; 5990 goto out;
5990 } 5991 }
5991 5992
5992 sctx = kzalloc(sizeof(struct send_ctx), GFP_NOFS); 5993 sctx = kzalloc(sizeof(struct send_ctx), GFP_KERNEL);
5993 if (!sctx) { 5994 if (!sctx) {
5994 ret = -ENOMEM; 5995 ret = -ENOMEM;
5995 goto out; 5996 goto out;
@@ -5997,7 +5998,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
5997 5998
5998 INIT_LIST_HEAD(&sctx->new_refs); 5999 INIT_LIST_HEAD(&sctx->new_refs);
5999 INIT_LIST_HEAD(&sctx->deleted_refs); 6000 INIT_LIST_HEAD(&sctx->deleted_refs);
6000 INIT_RADIX_TREE(&sctx->name_cache, GFP_NOFS); 6001 INIT_RADIX_TREE(&sctx->name_cache, GFP_KERNEL);
6001 INIT_LIST_HEAD(&sctx->name_cache_list); 6002 INIT_LIST_HEAD(&sctx->name_cache_list);
6002 6003
6003 sctx->flags = arg->flags; 6004 sctx->flags = arg->flags;