search for: btrfs_alloc_path

Displaying 20 results from an estimated 46 matches for "btrfs_alloc_path".

2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...ux-2.6.38/fs/btrfs/ctree.c linux-2.6.38.new/fs/btrfs/ctree.c --- linux-2.6.38/fs/btrfs/ctree.c 2011-03-15 10:20:32.000000000 +0900 +++ linux-2.6.38.new/fs/btrfs/ctree.c 2011-03-23 11:28:09.000000000 +0900 @@ -3840,7 +3840,8 @@ int btrfs_insert_item(struct btrfs_trans unsigned long ptr; path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size); if (!ret) { leaf = path->nodes[0]; diff -urNp linux-2.6.38/fs/btrfs/disk-io.c linux-2.6.38.new/fs/btrfs/disk-io.c --- linux-2.6.38/fs/btrfs/disk-io.c 2011-03-15 10:20:...
2010 Jan 19
1
static analysis tool cppcheck meets the btrfs code - four issues
...he.c:906]: (style) Redundant condition. It is safe to deallocate a NULL pointer Duplicate. 3. [./btrfs/relocation.c:3278]: (error) Memory leak: cluster The source code is         cluster = kzalloc(sizeof(*cluster), GFP_NOFS);         if (!cluster)                 return -ENOMEM;         path = btrfs_alloc_path();         if (!path)                 return -ENOMEM; Suggest new code         cluster = kzalloc(sizeof(*cluster), GFP_NOFS);         if (!cluster)                 return -ENOMEM;         path = btrfs_alloc_path();         if (!path)         {                 kfree( cluster);                 ret...
2013 Aug 27
7
[PATCH] Btrfs: fix deadlock in uuid scan kthread
...x f42e412..44cd21b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3465,7 +3465,7 @@ static int btrfs_uuid_scan_kthread(void *data) int slot; struct btrfs_root_item root_item; u32 item_size; - struct btrfs_trans_handle *trans; + struct btrfs_trans_handle *trans = NULL; path = btrfs_alloc_path(); if (!path) { @@ -3509,7 +3509,13 @@ static int btrfs_uuid_scan_kthread(void *data) (int)sizeof(root_item)); if (btrfs_root_refs(&root_item) == 0) goto skip; - if (!btrfs_is_empty_uuid(root_item.uuid)) { + + if (!btrfs_is_empty_uuid(root_item.uuid) || + !btrfs_is_empty...
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...t); BUG_ON(ret); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a824372..75a6647 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2088,16 +2088,17 @@ void btrfs_orphan_cleanup(struct btrfs_root *root) struct inode *inode; int ret = 0, nr_unlink = 0, nr_truncate = 0; - path = btrfs_alloc_path(); - if (!path) + if (!xchg(&root->clean_orphans, 0)) return; + + path = btrfs_alloc_path(); + BUG_ON(!path); path->reada = -1; key.objectid = BTRFS_ORPHAN_OBJECTID; btrfs_set_key_type(&key, BTRFS_ORPHAN_ITEM_KEY); key.offset = (u64)-1; - while (1) { ret = btrfs_se...
2012 May 22
1
warnings met in introduce extent buffer cache for each i-node patch
...084eec>] ? try_to_wake_up+0x1bc/0x2b0 May 22 09:23:57 bigbox kernel: [56455.53268 [<ffffffff812facef>] ? set_state_bits+0x3f/0x80 May 22 09:23:57 bigbox kernel: [56455fff8116228c>] ? kmem_cache_alloc+0x10c/0x140 May 22 09:23:57 bigbox kernel: [56455.532713] [<ffffffff812be2ca>] ? btrfs_alloc_path+0x1a/0x20 May 22 09:23:57 bigbox kernel: [5645532] [<ffffffff812e3713>] insert_reserved_file_extent.constpr13+0x73/0x270 May 22 09:23:57 bigbox kernel: [56455.532746] [<ffffffff812df6eb>] ? join_transactio0x2b/0x2b0 May 22 09:23:57 bigbox kernel: [56455.532759] [<ffffffff812e1224&...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...eaf; + unsigned long name_ptr; + const char *name = ".orphandir"; + int name_len = strlen(name); + int ret = 0; + u32 data_size; + + key.objectid = root->inode->i_ino; + btrfs_set_key_type(&key, BTRFS_ORPHAN_DIR_ITEM_KEY); + key.offset = btrfs_name_hash(name, name_len); + path = btrfs_alloc_path(); + data_size = sizeof(*dir_item) + name_len; + dir_item = insert_with_overflow(trans, root, path, &key, + data_size, name, name_len); + if (IS_ERR(dir_item)) { + ret = PTR_ERR(dir_item); + if (ret == -EEXIST) + printk(KERN_ERR "trying to create an orphan dir on a" +...
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...t btrfs_trans_handle *trans, u64 num_refs; u64 extent_flags; - WARN_ON(num_bytes < root->sectorsize); + if (metadata && + !btrfs_fs_incompat(root->fs_info, + BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)) { + offset = root->leafsize; + metadata = 0; + } + path = btrfs_alloc_path(); path->reada = 1; + key.objectid = bytenr; - key.offset = num_bytes; - btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); + key.offset = offset; + if (metadata) + key.type = BTRFS_METADATA_ITEM_KEY; + else + key.type = BTRFS_EXTENT_ITEM_KEY; + +again: ret = btrfs_search_slot(trans, r...
2012 May 27
0
[RFC PATCH] Decrease Metadata Fragment Using A Caterpillar Band Method
...node->num_bytes, parent, ref_root, @@ -4860,6 +4883,8 @@ static int __btrfs_free_extent(struct bt int num_to_del = 1; u32 item_size; u64 refs; + u8 factor = btrfs_cater_factor(extent_op->cater_index_factor); + u8 index = btrfs_cater_index(extent_op->cater_index_factor); path = btrfs_alloc_path(); if (!path) @@ -5023,7 +5048,11 @@ static int __btrfs_free_extent(struct bt bytenr >> PAGE_CACHE_SHIFT, (bytenr + num_bytes - 1) >> PAGE_CACHE_SHIFT); } - + + if (btrfs_cater_blocks_free(root, bytenr, num_bytes, factor, index)) { + bytenr = bytenr - num_byt...
2011 Jul 21
10
[PATCH v5 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup
While testing raid-auto-repair patches I''m going to send out later, I just found the very last bug in my current scrub patch series: Changelog v4->v5: - fixed a deadlock when fixup is taking longer while scrub is about to end Original message follows: ------------------------ This patch set introduces two new features for scrub. They share the backref iteration code which is the
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...if (ret) - return ret; - - if (ref_count != 1) - return 1; - - old_root = root->dirty_root->root; - ref_generation = old_root->root_key.offset; - - /* all references are created in running transaction */ - if (min_generation > ref_generation) { - ret = 0; - goto out; - } - - path = btrfs_alloc_path(); - if (!path) { - ret = -ENOMEM; - goto out; - } - - path->skip_locking = 1; - /* if no item found, the extent is referenced by other snapshot */ - ret = btrfs_search_slot(NULL, old_root, key, path, 0, 0); - if (ret) - goto out; - - eb = path->nodes[0]; - item = btrfs_item_ptr(eb, path-&...
2007 Nov 12
0
[PATCH]Minor fix for find_search_start
...oup(root->fs_info, last); } - cache = btrfs_find_block_group(root, cache, last, data, 0); + if (!full_scan) + cache = btrfs_find_block_group(root, cache, last, data, 0); *cache_ret = cache; cache_miss = 0; goto again; @@ -955,8 +957,8 @@ static int find_free_extent(struct btrfs path = btrfs_alloc_path(); check_failed: - search_start = find_search_start(root, &block_group, - search_start, total_needed, data); + search_start = find_search_start(root, &block_group, search_start, + total_needed, data, full_scan); cached_start = search_start; btrfs_init_path(path);
2013 Feb 27
0
[PATCH 3/3] Btrfs: remove reduplicate check about root in the function btrfs_clean_quota_tree
...eletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 69fa487..aee4b1c 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -742,9 +742,6 @@ static int btrfs_clean_quota_tree(struct btrfs_trans_handle *trans, int ret; int nr = 0; - if (!root) - return -EINVAL; - path = btrfs_alloc_path(); if (!path) return -ENOMEM; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2013 Jun 13
0
[PATCH] Btrfs: fix not being able to find skinny extents during relocate
...uct btrfs_path *path; struct btrfs_key key; int ret; + bool skinny = btrfs_fs_incompat(rc->extent_root->fs_info, + SKINNY_METADATA); if (tree_block_processed(bytenr, blocksize, rc)) return 0; @@ -3319,10 +3321,15 @@ static int __add_tree_block(struct reloc_control *rc, path = btrfs_alloc_path(); if (!path) return -ENOMEM; - +again: key.objectid = bytenr; - key.type = BTRFS_EXTENT_ITEM_KEY; - key.offset = blocksize; + if (skinny) { + key.type = BTRFS_METADATA_ITEM_KEY; + key.offset = (u64)-1; + } else { + key.type = BTRFS_EXTENT_ITEM_KEY; + key.offset = blocksize; + } path...
2011 Jul 14
0
btrfs panic
...0x89 [btrfs] [ 1998.478275] [<ffffffffa025dbe1>] btrfs_try_spin_lock+0x2a/0x89 [btrfs] [ 1998.478275] [<ffffffffa021d025>] btrfs_search_slot+0x39c/0x4c0 [btrfs] [ 1998.478275] [<ffffffffa022a7c9>] btrfs_lookup_xattr+0x76/0xd7 [btrfs] [ 1998.478275] [<ffffffffa0219290>] ? btrfs_alloc_path+0x1a/0x1c [btrfs] [ 1998.478275] [<ffffffff81114a76>] ? kmem_cache_alloc+0x57/0xfc [ 1998.478275] [<ffffffffa0240d00>] ? btrfs_file_aio_write+0x45/0x49a [btrfs] [ 1998.478275] [<ffffffffa024c066>] __btrfs_getxattr+0x86/0x11c [btrfs] [ 1998.478275] [<ffffffffa024c466>] bt...
2013 Mar 04
2
[PATCH 1/2] Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails
...ans, struct extent_buffer *tmp; struct extent_buffer *old; struct timespec cur_time = CURRENT_TIME; - int ret; + int ret = 0; u64 to_reserve = 0; u64 index = 0; u64 objectid; @@ -1081,40 +1086,36 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, path = btrfs_alloc_path(); if (!path) { - ret = pending->error = -ENOMEM; - return ret; + pending->error = -ENOMEM; + return 0; } new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); if (!new_root_item) { - ret = pending->error = -ENOMEM; + pending->error = -ENOMEM; goto root_item_allo...
2010 Nov 17
0
[PATCH] Btrfs: handle NFS lookups properly
...BTRFS_I(dir)->root; + struct btrfs_inode_ref *iref; + struct btrfs_root_ref *rref; + struct extent_buffer *leaf; + unsigned long name_ptr; + struct btrfs_key key; + int name_len; + int ret; + + if (!dir || !inode) + return -EINVAL; + + if (!S_ISDIR(dir->i_mode)) + return -EINVAL; + + path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; + path->leave_spinning = 1; + + if (inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) { + key.objectid = BTRFS_I(inode)->root->root_key.objectid; + key.type = BTRFS_ROOT_BACKREF_KEY; + key.offset = (u64)-1; + root = root->fs_info->tree_root; + } els...
2012 Oct 01
1
[RFC] [PATCH] Btrfs: rework can_nocow_odirect
...- struct btrfs_path *path; - int ret; - struct extent_buffer *leaf; struct btrfs_root *root = BTRFS_I(inode)->root; - struct btrfs_file_extent_item *fi; - struct btrfs_key key; u64 disk_bytenr; u64 backref_offset; u64 extent_end; u64 num_bytes; - int slot; - int found_type; - - path = btrfs_alloc_path(); - if (!path) - return -ENOMEM; - - ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(inode), - offset, 0); - if (ret < 0) - goto out; - slot = path->slots[0]; - if (ret == 1) { - if (slot == 0) { - /* can''t find the item, must cow */ - ret = 0; - got...
2011 Jan 18
6
BUG while writing to USB btrfs filesystem
While untar''ing an image to an sd card via a reader, I got the following bug. The system also has a btrfs root, and a whole swath of processes went into uninterruptable sleep. I was able to poke around via ssh and sysrq, and already had netconsole set up to capture the bug. Root fs is on /dev/sdi1, and /dev/sdj2 is the card reader which was the target of the untar. [29571.448889] sd
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...u64 bytenr, u64 parent, + u64 root_objectid) +{ + struct btrfs_key key; + int ret; + + key.objectid = bytenr; + if (parent) { + key.type = BTRFS_SHARED_BLOCK_REF_KEY; + key.offset = parent; + } else { + key.type = BTRFS_TREE_BLOCK_REF_KEY; + key.offset = root_objectid; } - path = btrfs_alloc_path(); - if (!path) - return -ENOMEM; - ret = lookup_extent_backref(trans, extent_root, path, - bytenr, orig_parent, orig_root, - orig_generation, owner_objectid, 1); - if (ret) - goto out; - ret = remove_extent_backref(trans, extent_root, path); - if (ret) - goto out; - ret = insert_e...
2011 Oct 06
26
[PATCH v0 00/18] btfs: Subvolume Quota Groups
This is a first draft of a subvolume quota implementation. It is possible to limit subvolumes and any group of subvolumes and also to track the amount of space that will get freed when deleting snapshots. The current version is functionally incomplete, with the main missing feature being the initial scan and rescan of an existing filesystem. I put some effort into writing an introduction into