Displaying 20 results from an estimated 84 matches for "rb_next".
Did you mean:
b_next
2009 Dec 15
0
[PATCH 1/4] btrfs: fix the bug that __tree_search() returns the wrong result in extent_map.c
__tree_search() returns the reverse result about the prev node and the next node. And we can
get the prev node and the next node directly by rb_prev() and rb_next(), so it is unnecessary
to use while loop to get them.
This patch fixes this bug of the wrong result.
Signed-off-by: Miao Xie <miaox@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/btr...
2009 Jul 31
1
[PATCH] Btrfs: make sure we find a bitmap entry
..._bytes);
+ BUG_ON(ret < 0 || search_start != *offset);
+
if (*offset > bitmap_info->offset && *offset + *bytes > end) {
bitmap_clear_bits(block_group, bitmap_info, *offset,
end - *offset + 1);
@@ -430,6 +439,7 @@ again:
}
if (*bytes) {
+ struct rb_node *next = rb_next(&bitmap_info->offset_index);
if (!bitmap_info->bytes) {
unlink_free_space(block_group, bitmap_info);
kfree(bitmap_info->bitmap);
@@ -438,16 +448,22 @@ again:
recalculate_thresholds(block_group);
}
- bitmap_info = tree_search_offset(block_group,
- offset_to_bi...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...p;cfqc->sibling_tree);
- while (p) {
- struct cfq_data *__cfqd;
-
- __cfqd = rb_entry(p, struct cfq_data, group_node);
-
- ret += snprintf(page + ret, PAGE_SIZE - ret, " %s %d\n",
- __cfqd->cfqdd->queue->kobj.parent->name,
- __cfqd->ioprio);
-
- p = rb_next(p);
- }
- ret = simple_read_from_buffer(userbuf, nbytes, ppos, page, ret);
-
-out:
- free_page((unsigned long)page);
- return ret;
+#define READ_FUNCTION(__FUNC, __VAR, __DEF_MSG) \
+static ssize_t __FUNC(struct cgroup *cont, struct cftype *cft, \
+ struct file *file, char __user *userbuf,...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...p;cfqc->sibling_tree);
- while (p) {
- struct cfq_data *__cfqd;
-
- __cfqd = rb_entry(p, struct cfq_data, group_node);
-
- ret += snprintf(page + ret, PAGE_SIZE - ret, " %s %d\n",
- __cfqd->cfqdd->queue->kobj.parent->name,
- __cfqd->ioprio);
-
- p = rb_next(p);
- }
- ret = simple_read_from_buffer(userbuf, nbytes, ppos, page, ret);
-
-out:
- free_page((unsigned long)page);
- return ret;
+#define READ_FUNCTION(__FUNC, __VAR, __DEF_MSG) \
+static ssize_t __FUNC(struct cgroup *cont, struct cftype *cft, \
+ struct file *file, char __user *userbuf,...
2012 Dec 03
1
xen-blkback: move free persistent grants code
..._erase(&persistent_gnt->node, root);
234 kfree(persistent_gnt);
^^^^^^^^^^^^^^^^^^^^
kfree();
235 num--;
236
237 if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
238 !rb_next(&persistent_gnt->node)) {
^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside the call to rb_next().
239 ret = gnttab_unmap_refs(unmap, NULL, pages,
240 segs_to_unmap);
regards,
dan carpenter
2012 Dec 03
1
xen-blkback: move free persistent grants code
..._erase(&persistent_gnt->node, root);
234 kfree(persistent_gnt);
^^^^^^^^^^^^^^^^^^^^
kfree();
235 num--;
236
237 if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
238 !rb_next(&persistent_gnt->node)) {
^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside the call to rb_next().
239 ret = gnttab_unmap_refs(unmap, NULL, pages,
240 segs_to_unmap);
regards,
dan carpenter
2012 May 24
2
[PATCH] Btrfs: fix the same inode id problem when doing auto defragment
...> entry->ino)
+ else if (__compare_inode_defrag(&tmp, entry) > 0)
p = parent->rb_right;
else
return entry;
}
if (next) {
- while (parent && ino > entry->ino) {
+ while (parent && __compare_inode_defrag(&tmp, entry) > 0) {
parent = rb_next(parent);
entry = rb_entry(parent, struct inode_defrag, rb_node);
}
@@ -202,6 +222,7 @@ int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info)
struct btrfs_key key;
struct btrfs_ioctl_defrag_range_args range;
u64 first_ino = 0;
+ u64 root_objectid = 0;
int num_defrag;
int defrag...
2011 May 25
0
[PATCH] Btrfs: cache bitmaps when searching for a cluster
...{
struct btrfs_free_space *first = NULL;
@@ -2083,6 +2084,8 @@ static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group,
* extent entry.
*/
while (entry->bitmap) {
+ if (list_empty(&entry->list))
+ list_add_tail(&entry->list, bitmaps);
node = rb_next(&entry->offset_index);
if (!node)
return -ENOSPC;
@@ -2102,8 +2105,12 @@ static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group,
return -ENOSPC;
entry = rb_entry(node, struct btrfs_free_space, offset_index);
- if (entry->bitmap)
+ if (entry->bi...
2009 Jun 03
0
[PATCH] Make sure all dirty blocks are written at commit time
...2009-06-03 10:52:58.000000000 +0800
@@ -2399,13 +2399,29 @@ fail:
}
+static struct btrfs_block_group_cache *
+next_block_group(struct btrfs_root *root,
+ struct btrfs_block_group_cache *cache)
+{
+ struct rb_node *node;
+ spin_lock(&root->fs_info->block_group_cache_lock);
+ node = rb_next(&cache->cache_node);
+ btrfs_put_block_group(cache);
+ if (node) {
+ cache = rb_entry(node, struct btrfs_block_group_cache,
+ cache_node);
+ atomic_inc(&cache->count);
+ } else
+ cache = NULL;
+ spin_unlock(&root->fs_info->block_group_cache_lock);
+ return cache;
+}
+...
2012 Feb 16
3
[PATCH 1/4] Btrfs: be less strict on finding next node in clear_extent_bit
In clear_extent_bit, it is enough that next node is adjacent in tree level.
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
fs/btrfs/extent_io.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index fcf77e1..e941cc4 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -577,8 +577,7 @@ hit_next:
if
2023 Apr 06
3
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...(clen) {
best_len = clen;
best_start = cstart;
+ create_new = 1;
if (best_len == wanted)
- goto out_insert;
+ goto out_create;
}
prev_resv = next_resv;
@@ -557,13 +559,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap,
while (1) {
next = rb_next(prev);
if (next) {
- next_resv = rb_entry(next,
- struct ocfs2_alloc_reservation,
- r_node);
-
- gap_start = ocfs2_resv_end(prev_resv) + 1;
- gap_end = next_resv->r_start - 1;
- gap_len = gap_end - gap_start + 1;
+ gap_start = prev_resv->r_start;
+ gap_end = p...
2023 Apr 29
1
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...if (best_len == wanted)
>> - goto out_insert;
>> + goto out_create;
>> }
>>
>> prev_resv = next_resv;
>> @@ -557,13 +559,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap,
>> while (1) {
>> next = rb_next(prev);
>> if (next) {
>> - next_resv = rb_entry(next,
>> - struct ocfs2_alloc_reservation,
>> - r_node);
>> -
>> - gap_start = ocfs2_resv_end(prev_resv) + 1;
>> - gap_end = next_resv->r_start - 1;
>> - gap_len = gap_en...
2013 Oct 08
3
[PATCH] Btrfs: limit delalloc pages outside of find_delalloc_range
...ns(+), 8 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b48942f..2bf6f46 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1491,10 +1491,8 @@ static noinline u64 find_delalloc_range(struct extent_io_tree *tree,
cur_start = state->end + 1;
node = rb_next(node);
total_bytes += state->end - state->start + 1;
- if (total_bytes >= max_bytes) {
- *end = *start + max_bytes - 1;
+ if (total_bytes >= max_bytes)
break;
- }
if (!node)
break;
}
@@ -1636,10 +1634,9 @@ again:
/*
* make sure to limit the number of pages we...
2023 Apr 21
2
[PATCH] ocfs2: Fix wrong search logic in __ocfs2_resv_find_window
...art;
> + create_new = 1;
> if (best_len == wanted)
> - goto out_insert;
> + goto out_create;
> }
>
> prev_resv = next_resv;
> @@ -557,13 +559,9 @@ static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap,
> while (1) {
> next = rb_next(prev);
> if (next) {
> - next_resv = rb_entry(next,
> - struct ocfs2_alloc_reservation,
> - r_node);
> -
> - gap_start = ocfs2_resv_end(prev_resv) + 1;
> - gap_end = next_resv->r_start - 1;
> - gap_len = gap_end - gap_start + 1;
> + gap_s...
2010 Apr 06
2
[PATCH] ocfs2/trivial: Code cleanup for allocation reservation.
...ev_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
2004 Dec 05
1
BUG in fs/ext3/dir.c
...finished;
+ else
+ goto next_entry;
+ }
if (!info->curr_node)
info->curr_node = rb_first(&info->root);
@@ -492,7 +495,7 @@
info->curr_minor_hash = fname->minor_hash;
if (call_filldir(filp, dirent, filldir, fname))
break;
-
+next_entry:
info->curr_node = rb_next(info->curr_node);
if (!info->curr_node) {
if (info->next_hash == ~0) {
Regards,
Holger
PS: Please CC me since I am not on this list.
-------------- next part --------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#i...
2012 Jan 23
0
[PATCH] Btrfs: use cluster->window_start when allocating from a cluster bitmap
...-2242,7 +2242,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
if (entry->bitmap) {
ret = btrfs_alloc_from_bitmap(block_group,
cluster, entry, bytes,
- min_start);
+ cluster->window_start);
if (ret == 0) {
node = rb_next(&entry->offset_index);
if (!node)
--
1.7.5.2
--
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
2011 Mar 31
4
[PATCH] Btrfs: fix free space cache when there are pinned extents and clusters
...CHE_SIZE);
- while (1) {
+ while (node && !next_page) {
struct btrfs_free_space *e;
e = rb_entry(node, struct btrfs_free_space, offset_index);
@@ -614,12 +651,49 @@ int btrfs_write_out_cache(struct btrfs_root *root,
entry->type = BTRFS_FREE_SPACE_EXTENT;
}
node = rb_next(node);
- if (!node)
- break;
+ if (!node && cluster) {
+ node = rb_first(&cluster->root);
+ cluster = NULL;
+ }
offset += sizeof(struct btrfs_free_space_entry);
if (offset + sizeof(struct btrfs_free_space_entry) >=
PAGE_CACHE_SIZE)
+ next_page = t...
2010 Jul 26
2
[PATCH] btrfs: set task state with schedule_timeout_uninterruptible()
worker_loop() uses schedule_timeout() without setting state to
STATE_(UN)INTERRUPTIBLE. As it is called in cycle without checking of
pending signals, use schedule_timeout_uninterruptible().
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
fs/btrfs/async-thread.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
2008 Jun 02
1
[PATCH 0/2] dm-ioband: I/O bandwidth controller v1.1.0: Introduction
Hi everyone,
This is dm-ioband version 1.1.0 release.
Dm-ioband is an I/O bandwidth controller implemented as a device-mapper
driver, which gives specified bandwidth to each job running on the same
physical device.
- Can be applied to the kernel 2.6.26-rc2-mm1.
- Changes from 1.0.0 (posted on May 19, 2008):
- Measures against high memory pressure.
I/O requests to reclaim pages won't