search for: rb_node

Displaying 20 results from an estimated 136 matches for "rb_node".

2012 May 24
2
[PATCH] Btrfs: fix the same inode id problem when doing auto defragment
...t;ino < defrag2->ino) + return -1; + else + return 0; +} + /* pop a record for an inode into the defrag tree. The lock * must be held already * @@ -87,9 +102,9 @@ static void __btrfs_add_inode_defrag(struct inode *inode, parent = *p; entry = rb_entry(parent, struct inode_defrag, rb_node); - if (defrag->ino < entry->ino) + if (__compare_inode_defrag(defrag, entry) < 0) p = &parent->rb_left; - else if (defrag->ino > entry->ino) + else if (__compare_inode_defrag(defrag, entry) > 0) p = &parent->rb_right; else { /* if we'&...
2009 Aug 21
0
[GIT PULL] btrfs rb corruption fix
...tions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 272b9b2..59cba18 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3099,8 +3099,12 @@ static void inode_tree_add(struct inode *inode) { struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_inode *entry; - struct rb_node **p = &root->inode_tree.rb_node; - struct rb_node *parent = NULL; + struct rb_node **p; + struct rb_node *parent; + +again: + p = &root->inode_tree.rb_node; + parent = NULL; spin_lock(&root->inode_lock); while (*p) { @@ -3108,13 +3112,16 @@ static void inode_tree_add(stru...
2010 Oct 30
0
[PATCH] Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) - generated by Coccinelle
...amuel <chris@csamuel.org> diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 454ca52..23cb8da 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -335,7 +335,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, goto out; } if (IS_ERR(rb_node)) { - em = ERR_PTR(PTR_ERR(rb_node)); + em = ERR_CAST(rb_node); goto out; } em = rb_entry(rb_node, struct extent_map, rb_node); @@ -384,7 +384,7 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree, goto out; } if (IS_ERR(rb_node)) { - em = ERR_PTR(PTR_ERR(rb_no...
2008 Sep 25
0
[PATCH 2/4] Add shared reference cache
...= btrfs_add_leaf_ref(root, ref, shared); WARN_ON(ret); btrfs_free_leaf_ref(root, ref); } diff -r 47aa0c51998a ref-cache.c --- a/ref-cache.c Thu Sep 25 16:00:36 2008 +0800 +++ b/ref-cache.c Thu Sep 25 16:02:11 2008 +0800 @@ -78,7 +78,6 @@ } entry = rb_entry(node, struct btrfs_leaf_ref, rb_node); - entry->in_tree = 1; rb_link_node(node, parent, p); rb_insert_color(node, root); return NULL; @@ -103,23 +102,29 @@ return NULL; } -int btrfs_remove_leaf_refs(struct btrfs_root *root, u64 max_root_gen) +int btrfs_remove_leaf_refs(struct btrfs_root *root, u64 max_root_gen, + in...
2010 Mar 20
0
[patch 2/3] btrfs cleanup: remove more dead code
rb_node cannot be an ERR_PTR() here so I removed the misleading check. Also I removed some more dead code at the bottom. It looks like the code from lookup_extent_mapping() may have been copy and pasted into search_extent_mapping()? Signed-off-by: Dan Carpenter <error27@gmail.com> --- This doesn...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...oid cfq_cgroup_service_tree_add(struct cfq_data *cfqd, int add_front) unsigned long rb_key; int left; - if (!add_front) { + if (cfq_data_class_idle(cfqd)) { + rb_key = CFQ_CGROUP_IDLE_DELAY; + parent = rb_last(&cfqdd->service_tree.rb); + if (parent && parent != &cfqd->rb_node) { + __cfqd = rb_entry(parent, struct cfq_data, rb_node); + rb_key += __cfqd->rb_key; + } else + rb_key += jiffies; + } else if (!add_front) { rb_key = cfq_cgroup_slice_offset(cfqd) + jiffies; rb_key += cfqd->slice_resid; cfqd->slice_resid = 0; @@ -400,7 +423,23 @@ static v...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...oid cfq_cgroup_service_tree_add(struct cfq_data *cfqd, int add_front) unsigned long rb_key; int left; - if (!add_front) { + if (cfq_data_class_idle(cfqd)) { + rb_key = CFQ_CGROUP_IDLE_DELAY; + parent = rb_last(&cfqdd->service_tree.rb); + if (parent && parent != &cfqd->rb_node) { + __cfqd = rb_entry(parent, struct cfq_data, rb_node); + rb_key += __cfqd->rb_key; + } else + rb_key += jiffies; + } else if (!add_front) { rb_key = cfq_cgroup_slice_offset(cfqd) + jiffies; rb_key += cfqd->slice_resid; cfqd->slice_resid = 0; @@ -400,7 +423,23 @@ static v...
2006 Aug 02
10
[PATCH 0/6] htb: cleanup
The HTB scheduler code is a mess, this patch set does some basic house cleaning. The first four should cause no code change, but the last two need more testing. -- Stephen Hemminger <shemminger@osdl.org> "And in the Packet there writ down that doome" - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to
2008 Nov 12
15
[PATCH][RFC][12+2][v3] A expanded CFQ scheduler for cgroups
This patchset expands traditional CFQ scheduler in order to support cgroups, and improves old version. Improvements are as following. * Modularizing our new CFQ scheduler. The expanded CFQ scheduler is registered/unregistered as new I/O elevator scheduler called "cfq-cgroups". By this, the traditional CFQ scheduler, which does not handle cgroups, and our new CFQ
2008 Nov 12
15
[PATCH][RFC][12+2][v3] A expanded CFQ scheduler for cgroups
This patchset expands traditional CFQ scheduler in order to support cgroups, and improves old version. Improvements are as following. * Modularizing our new CFQ scheduler. The expanded CFQ scheduler is registered/unregistered as new I/O elevator scheduler called "cfq-cgroups". By this, the traditional CFQ scheduler, which does not handle cgroups, and our new CFQ
2009 Dec 15
0
[PATCH 1/4] btrfs: fix the bug that __tree_search() returns the wrong result in extent_map.c
...@cn.fujitsu.com> --- fs/btrfs/extent_map.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 46bea0f..16744f4 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -136,20 +136,15 @@ static struct rb_node *__tree_search(struct rb_root *root, u64 offset, if (prev_ret) { orig_prev = prev; - while (prev && offset >= extent_map_end(prev_entry)) { - prev = rb_next(prev); - prev_entry = rb_entry(prev, struct extent_map, rb_node); - } + if (prev && offset < prev_entry-&g...
2017 Jan 20
1
[PATCH] drm/nouveau/client: use rb_entry()
...truct nvkm_object *this = - container_of(*ptr, typeof(*this), node); + rb_entry(*ptr, typeof(*this), node); parent = *ptr; if (object->object < this->object) ptr = &parent->rb_left; @@ -243,7 +243,7 @@ nvkm_client_search(struct nvkm_client *client, u64 handle) struct rb_node *node = client->objroot.rb_node; while (node) { struct nvkm_object *object = - container_of(node, typeof(*object), node); + rb_entry(node, typeof(*object), node); if (handle < object->object) node = node->rb_left; else -- 2.9.3
2016 Dec 20
1
[PATCH] drm/nouveau/dma: use rb_entry()
...ma/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c index f11ebdd..4655d17 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c @@ -34,7 +34,7 @@ nvkm_dma_search(struct nvkm_dma *dma, struct nvkm_client *client, u64 object) struct rb_node *node = client->dmaroot.rb_node; while (node) { struct nvkm_dmaobj *dmaobj = - container_of(node, typeof(*dmaobj), rb); + rb_entry(node, typeof(*dmaobj), rb); if (object < dmaobj->handle) node = node->rb_left; else @@ -67,7 +67,7 @@ nvkm_dma_oclass_new(struct nvkm_dev...
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp in the kernel to make sure the data is still the same. The thing that takes a while is reading the data up from disk, so doing a memcmp of the entire buffer isn''t that big of a deal, not to mention there''s a possiblity for malicious users if there is a problem with the hashing algorithms we
2013 Nov 19
6
[PATCH] Btrfs: fix very slow inode eviction and fs unmount
...p and extent_state structures, + * without the excessive merging and splitting. + */ +static void evict_inode_truncate_pages(struct inode *inode) +{ + struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; + struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; + struct rb_node *node; + + ASSERT(inode->i_state & I_FREEING); + truncate_inode_pages(&inode->i_data, 0); + + write_lock(&map_tree->lock); + while (!RB_EMPTY_ROOT(&map_tree->map)) { + struct extent_map *em; + + node = rb_first(&map_tree->map); + em = rb_entry(node, struct exte...
2012 Aug 01
17
[PATCH] add crtime to the snapshot list
From: Anand <anand.jain@oracle.com> This patch adds creation-time to the snapshot list display, which would help user to better manage the snapshots when number of snapshots grow substantially. This patch is developed and on top of the send/receive btrfs and btrfs-progs repo at git://github.com/ablock84/linux-btrfs.git (send-v2) git://github.com/ablock84/btrfs-progs.git (send-v2)
2010 Apr 06
2
[PATCH] ocfs2/trivial: Code cleanup for allocation reservation.
...ns.c index 6497bcc..32bad4a 100644 --- a/fs/ocfs2/reservations.c +++ b/fs/ocfs2/reservations.c @@ -371,7 +371,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal) struct ocfs2_alloc_reservation *resv = NULL; struct ocfs2_alloc_reservation *prev_resv = NULL; struct rb_node *node = resmap->m_reservations.rb_node; - struct rb_node *prev = NULL; assert_spin_locked(&resv_lock); @@ -392,7 +391,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal) } prev_resv = resv; - prev = node; node = rb_next(node); } -- 1.5.5
2013 Jan 31
1
[PATCH] Btrfs: fix freeing delayed ref head while still holding its mutex V2
...io.c index 12ef591..42f83aa 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3615,11 +3615,11 @@ int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, } while ((node = rb_first(&delayed_refs->root)) != NULL) { - ref = rb_entry(node, struct btrfs_delayed_ref_node, rb_node); + struct btrfs_delayed_ref_head *head = NULL; + ref = rb_entry(node, struct btrfs_delayed_ref_node, rb_node); atomic_set(&ref->refs, 1); if (btrfs_delayed_ref_is_head(ref)) { - struct btrfs_delayed_ref_head *head; head = btrfs_delayed_node_to_head(ref); if (!mutex_try...
2012 Sep 17
0
[PATCH] Btrfs: do not hold the write_lock on the extent tree while logging V2
...map.c b/fs/btrfs/extent_map.c index 8d1364d..b8cbc8d 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -407,7 +407,8 @@ int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em) WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags)); rb_erase(&em->rb_node, &tree->map); - list_del_init(&em->list); + if (!test_bit(EXTENT_FLAG_LOGGING, &em->flags)) + list_del_init(&em->list); em->in_tree = 0; return ret; } diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 8e6294b..6792255 100644 --- a/fs/btrfs/extent_...
2011 Sep 23
0
[PATCH] btrfs/delayed-inode.c: quiet sparse noise
...ease_delayed_item(struct btrfs_delayed_item *item) } } -struct btrfs_delayed_item *__btrfs_first_delayed_insertion_item( - struct btrfs_delayed_node *delayed_node) +static struct btrfs_delayed_item * +__btrfs_first_delayed_insertion_item(struct btrfs_delayed_node *delayed_node) { struct rb_node *p; struct btrfs_delayed_item *item = NULL; @@ -538,8 +538,8 @@ struct btrfs_delayed_item *__btrfs_first_delayed_insertion_item( return item; } -struct btrfs_delayed_item *__btrfs_first_delayed_deletion_item( - struct btrfs_delayed_node *delayed_node) +static struct btrfs_delayed_item *...