summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorLiu Hui <onlyflyer@gmail.com>2008-11-18 11:30:10 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-18 11:30:10 -0500
commitb4eec2ca1167bae46295aeb66abd15fd52387845 (patch)
treebad79258bb437341611116d951f7a8711c4473a0 /fs/btrfs/extent-tree.c
parentea9e8b11bd1252dcbc23afefcf1a52ec6aa3c113 (diff)
Btrfs: Some fixes for batching extent insert.
In insert_extents(), when ret==1 and last is not zero, it should check if the current inserted item is the last item in this batching inserts. If so, it should just break from loop. If not, 'cur = insert_list->next' will make no sense because the list is empty now, and 'op' will point to an unexpectable place. There are also some trivial fixs in this patch including one comment typo error and deleting two redundant lines. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b0f2241274f..1121d518bf8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -798,9 +798,12 @@ static int noinline insert_extents(struct btrfs_trans_handle *trans,
*/
i = last;
last = 0;
- cur = insert_list->next;
- op = list_entry(cur, struct pending_extent_op, list);
total--;
+ if (i < total) {
+ cur = insert_list->next;
+ op = list_entry(cur, struct pending_extent_op,
+ list);
+ }
} else {
i += ret;
}
@@ -2150,6 +2153,7 @@ again:
if (ret) {
if (skipped && all && !num_inserts) {
skipped = 0;
+ search = 0;
continue;
}
mutex_unlock(&info->extent_ins_mutex);
@@ -2189,7 +2193,7 @@ again:
}
/*
- * process teh update list, clear the writeback bit for it, and if
+ * process the update list, clear the writeback bit for it, and if
* somebody marked this thing for deletion then just unlock it and be
* done, the free_extents will handle it
*/