git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Btrfs: Don't use kmap_atomic(..., KM_IRQ0) during checksum verifies
[safe/jmp/linux-2.6]
/
fs
/
btrfs
/
tree-defrag.c
diff --git
a/fs/btrfs/tree-defrag.c
b/fs/btrfs/tree-defrag.c
index
cc2650b
..
3e8358c
100644
(file)
--- a/
fs/btrfs/tree-defrag.c
+++ b/
fs/btrfs/tree-defrag.c
@@
-23,6
+23,11
@@
#include "transaction.h"
#include "locking.h"
#include "transaction.h"
#include "locking.h"
+/* defrag all the leaves in a given btree. If cache_only == 1, don't read
+ * things from disk, otherwise read all the leaves and try to get key order to
+ * better reflect disk order
+ */
+
int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int cache_only)
{
int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int cache_only)
{
@@
-61,9
+66,9
@@
int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
level = btrfs_header_level(root->node);
orig_level = level;
level = btrfs_header_level(root->node);
orig_level = level;
- if (level == 0)
{
+ if (level == 0)
goto out;
goto out;
- }
+
if (root->defrag_progress.objectid == 0) {
struct extent_buffer *root_node;
u32 nritems;
if (root->defrag_progress.objectid == 0) {
struct extent_buffer *root_node;
u32 nritems;
@@
-81,12
+86,12
@@
int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
memcpy(&key, &root->defrag_progress, sizeof(key));
}
memcpy(&key, &root->defrag_progress, sizeof(key));
}
- path->lowest_level = 1;
path->keep_locks = 1;
if (cache_only)
min_trans = root->defrag_trans_start;
path->keep_locks = 1;
if (cache_only)
min_trans = root->defrag_trans_start;
- ret = btrfs_search_forward(root, &key, path, cache_only, min_trans);
+ ret = btrfs_search_forward(root, &key, NULL, path,
+ cache_only, min_trans);
if (ret < 0)
goto out;
if (ret > 0) {
if (ret < 0)
goto out;
if (ret > 0) {
@@
-121,9
+126,6
@@
int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
if (is_extent)
btrfs_extent_post_op(trans, root);
out:
if (is_extent)
btrfs_extent_post_op(trans, root);
out:
- if (is_extent)
- mutex_unlock(&root->fs_info->alloc_mutex);
-
if (path)
btrfs_free_path(path);
if (ret == -EAGAIN) {
if (path)
btrfs_free_path(path);
if (ret == -EAGAIN) {