Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311668
b: refs/heads/master
c: 24eee62
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jul 5, 2012
1 parent 488aaee commit 8611e53
Show file tree
Hide file tree
Showing 22 changed files with 295 additions and 213 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb31fbeb647ed1910290712c13f11f1db09e5506
refs/heads/master: 24eee627eb7b05ac3cbca240f36b615969e65775
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Required properties:
- compatible : "fsl,mma8450".
- reg: the I2C address of MMA8450

Example:

Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/devicetree/bindings/mfd/mc13xxx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Examples:

ecspi@70010000 { /* ECSPI1 */
fsl,spi-num-chipselects = <2>;
cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
<&gpio3 25 0>; /* GPIO4_25 */
cs-gpios = <&gpio4 24 0>, /* GPIO4_24 */
<&gpio4 25 0>; /* GPIO4_25 */
status = "okay";

pmic: mc13892@0 {
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ esdhc@70008000 {
compatible = "fsl,imx51-esdhc";
reg = <0x70008000 0x4000>;
interrupts = <2>;
cd-gpios = <&gpio0 6 0>; /* GPIO1_6 */
wp-gpios = <&gpio0 5 0>; /* GPIO1_5 */
cd-gpios = <&gpio1 6 0>; /* GPIO1_6 */
wp-gpios = <&gpio1 5 0>; /* GPIO1_5 */
};
2 changes: 1 addition & 1 deletion trunk/Documentation/devicetree/bindings/net/fsl-fec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ ethernet@83fec000 {
reg = <0x83fec000 0x4000>;
interrupts = <87>;
phy-mode = "mii";
phy-reset-gpios = <&gpio1 14 0>; /* GPIO2_14 */
phy-reset-gpios = <&gpio2 14 0>; /* GPIO2_14 */
local-mac-address = [00 04 9F 01 1B B9];
};
4 changes: 2 additions & 2 deletions trunk/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ ecspi@70010000 {
reg = <0x70010000 0x4000>;
interrupts = <36>;
fsl,spi-num-chipselects = <2>;
cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
<&gpio3 25 0>; /* GPIO4_25 */
cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */
<&gpio3 25 0>; /* GPIO3_25 */
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Device tree binding vendor prefix registry. Keep list in alphabetical order.
This isn't an exhaustive list, but you should add new prefixes to it before
using them to avoid name-space collisions.

ad Avionic Design GmbH
adi Analog Devices, Inc.
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
apm Applied Micro Circuits Corporation (APM)
Expand Down
30 changes: 26 additions & 4 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,22 @@ struct device_node *of_find_node_with_property(struct device_node *from,
}
EXPORT_SYMBOL(of_find_node_with_property);

static const struct of_device_id *of_match_compat(const struct of_device_id *matches,
const char *compat)
{
while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
const char *cp = matches->compatible;
int len = strlen(cp);

if (len > 0 && of_compat_cmp(compat, cp, len) == 0)
return matches;

matches++;
}

return NULL;
}

/**
* of_match_node - Tell if an device_node has a matching of_match structure
* @matches: array of of device match structures to search in
Expand All @@ -521,9 +537,18 @@ EXPORT_SYMBOL(of_find_node_with_property);
const struct of_device_id *of_match_node(const struct of_device_id *matches,
const struct device_node *node)
{
struct property *prop;
const char *cp;

if (!matches)
return NULL;

of_property_for_each_string(node, "compatible", prop, cp) {
const struct of_device_id *match = of_match_compat(matches, cp);
if (match)
return match;
}

while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
int match = 1;
if (matches->name[0])
Expand All @@ -532,10 +557,7 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
if (matches->type[0])
match &= node->type
&& !strcmp(matches->type, node->type);
if (matches->compatible[0])
match &= of_device_is_compatible(node,
matches->compatible);
if (match)
if (match && !matches->compatible[0])
return matches;
matches++;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,5 @@ int of_platform_populate(struct device_node *root,
of_node_put(root);
return rc;
}
EXPORT_SYMBOL_GPL(of_platform_populate);
#endif /* CONFIG_OF_ADDRESS */
15 changes: 9 additions & 6 deletions trunk/fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,14 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
goto out;

eb = path->nodes[level];
if (!eb) {
WARN_ON(1);
ret = 1;
goto out;
while (!eb) {
if (!level) {
WARN_ON(1);
ret = 1;
goto out;
}
level--;
eb = path->nodes[level];
}

ret = add_all_parents(root, path, parents, level, &ref->key_for_search,
Expand Down Expand Up @@ -835,6 +839,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
}
ret = __add_delayed_refs(head, delayed_ref_seq,
&prefs_delayed);
mutex_unlock(&head->mutex);
if (ret) {
spin_unlock(&delayed_refs->lock);
goto out;
Expand Down Expand Up @@ -928,8 +933,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
}

out:
if (head)
mutex_unlock(&head->mutex);
btrfs_free_path(path);
while (!list_empty(&prefs)) {
ref = list_first_entry(&prefs, struct __prelim_ref, list);
Expand Down
60 changes: 35 additions & 25 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,18 @@ __tree_mod_log_oldest_root(struct btrfs_fs_info *fs_info,
if (!looped && !tm)
return 0;
/*
* we must have key remove operations in the log before the
* replace operation.
* if there are no tree operation for the oldest root, we simply
* return it. this should only happen if that (old) root is at
* level 0.
*/
BUG_ON(!tm);
if (!tm)
break;

/*
* if there's an operation that's not a root replacement, we
* found the oldest version of our root. normally, we'll find a
* MOD_LOG_KEY_REMOVE_WHILE_FREEING operation here.
*/
if (tm->op != MOD_LOG_ROOT_REPLACE)
break;

Expand Down Expand Up @@ -1087,11 +1094,7 @@ __tree_mod_log_rewind(struct extent_buffer *eb, u64 time_seq,
tm->generation);
break;
case MOD_LOG_KEY_ADD:
if (tm->slot != n - 1) {
o_dst = btrfs_node_key_ptr_offset(tm->slot);
o_src = btrfs_node_key_ptr_offset(tm->slot + 1);
memmove_extent_buffer(eb, o_dst, o_src, p_size);
}
/* if a move operation is needed it's in the log */
n--;
break;
case MOD_LOG_MOVE_KEYS:
Expand Down Expand Up @@ -1192,16 +1195,8 @@ get_old_root(struct btrfs_root *root, u64 time_seq)
}

tm = tree_mod_log_search(root->fs_info, logical, time_seq);
/*
* there was an item in the log when __tree_mod_log_oldest_root
* returned. this one must not go away, because the time_seq passed to
* us must be blocking its removal.
*/
BUG_ON(!tm);

if (old_root)
eb = alloc_dummy_extent_buffer(tm->index << PAGE_CACHE_SHIFT,
root->nodesize);
eb = alloc_dummy_extent_buffer(logical, root->nodesize);
else
eb = btrfs_clone_extent_buffer(root->node);
btrfs_tree_read_unlock(root->node);
Expand All @@ -1216,7 +1211,10 @@ get_old_root(struct btrfs_root *root, u64 time_seq)
btrfs_set_header_level(eb, old_root->level);
btrfs_set_header_generation(eb, old_generation);
}
__tree_mod_log_rewind(eb, time_seq, tm);
if (tm)
__tree_mod_log_rewind(eb, time_seq, tm);
else
WARN_ON(btrfs_header_level(eb) != 0);
extent_buffer_get(eb);

return eb;
Expand Down Expand Up @@ -2995,7 +2993,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
static void insert_ptr(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_path *path,
struct btrfs_disk_key *key, u64 bytenr,
int slot, int level, int tree_mod_log)
int slot, int level)
{
struct extent_buffer *lower;
int nritems;
Expand All @@ -3008,15 +3006,15 @@ static void insert_ptr(struct btrfs_trans_handle *trans,
BUG_ON(slot > nritems);
BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(root));
if (slot != nritems) {
if (tree_mod_log && level)
if (level)
tree_mod_log_eb_move(root->fs_info, lower, slot + 1,
slot, nritems - slot);
memmove_extent_buffer(lower,
btrfs_node_key_ptr_offset(slot + 1),
btrfs_node_key_ptr_offset(slot),
(nritems - slot) * sizeof(struct btrfs_key_ptr));
}
if (tree_mod_log && level) {
if (level) {
ret = tree_mod_log_insert_key(root->fs_info, lower, slot,
MOD_LOG_KEY_ADD);
BUG_ON(ret < 0);
Expand Down Expand Up @@ -3104,7 +3102,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(split);

insert_ptr(trans, root, path, &disk_key, split->start,
path->slots[level + 1] + 1, level + 1, 1);
path->slots[level + 1] + 1, level + 1);

if (path->slots[level] >= mid) {
path->slots[level] -= mid;
Expand Down Expand Up @@ -3641,7 +3639,7 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans,
btrfs_set_header_nritems(l, mid);
btrfs_item_key(right, &disk_key, 0);
insert_ptr(trans, root, path, &disk_key, right->start,
path->slots[1] + 1, 1, 0);
path->slots[1] + 1, 1);

btrfs_mark_buffer_dirty(right);
btrfs_mark_buffer_dirty(l);
Expand Down Expand Up @@ -3848,7 +3846,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
if (mid <= slot) {
btrfs_set_header_nritems(right, 0);
insert_ptr(trans, root, path, &disk_key, right->start,
path->slots[1] + 1, 1, 0);
path->slots[1] + 1, 1);
btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]);
path->nodes[0] = right;
Expand All @@ -3857,7 +3855,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
} else {
btrfs_set_header_nritems(right, 0);
insert_ptr(trans, root, path, &disk_key, right->start,
path->slots[1], 1, 0);
path->slots[1], 1);
btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]);
path->nodes[0] = right;
Expand Down Expand Up @@ -5121,6 +5119,18 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,

if (!path->skip_locking) {
ret = btrfs_try_tree_read_lock(next);
if (!ret && time_seq) {
/*
* If we don't get the lock, we may be racing
* with push_leaf_left, holding that lock while
* itself waiting for the leaf we've currently
* locked. To solve this situation, we give up
* on our lock and cycle.
*/
btrfs_release_path(path);
cond_resched();
goto again;
}
if (!ret) {
btrfs_set_path_blocking(path);
btrfs_tree_read_lock(next);
Expand Down
34 changes: 21 additions & 13 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,12 +2354,17 @@ int open_ctree(struct super_block *sb,
BTRFS_CSUM_TREE_OBJECTID, csum_root);
if (ret)
goto recovery_tree_root;

csum_root->track_dirty = 1;

fs_info->generation = generation;
fs_info->last_trans_committed = generation;

ret = btrfs_recover_balance(fs_info);
if (ret) {
printk(KERN_WARNING "btrfs: failed to recover balance\n");
goto fail_block_groups;
}

ret = btrfs_init_dev_stats(fs_info);
if (ret) {
printk(KERN_ERR "btrfs: failed to init dev_stats: %d\n",
Expand Down Expand Up @@ -2485,20 +2490,23 @@ int open_ctree(struct super_block *sb,
goto fail_trans_kthread;
}

if (!(sb->s_flags & MS_RDONLY)) {
down_read(&fs_info->cleanup_work_sem);
err = btrfs_orphan_cleanup(fs_info->fs_root);
if (!err)
err = btrfs_orphan_cleanup(fs_info->tree_root);
up_read(&fs_info->cleanup_work_sem);
if (sb->s_flags & MS_RDONLY)
return 0;

if (!err)
err = btrfs_recover_balance(fs_info->tree_root);
down_read(&fs_info->cleanup_work_sem);
if ((ret = btrfs_orphan_cleanup(fs_info->fs_root)) ||
(ret = btrfs_orphan_cleanup(fs_info->tree_root))) {
up_read(&fs_info->cleanup_work_sem);
close_ctree(tree_root);
return ret;
}
up_read(&fs_info->cleanup_work_sem);

if (err) {
close_ctree(tree_root);
return err;
}
ret = btrfs_resume_balance_async(fs_info);
if (ret) {
printk(KERN_WARNING "btrfs: failed to resume balance\n");
close_ctree(tree_root);
return ret;
}

return 0;
Expand Down
11 changes: 6 additions & 5 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,12 +2347,10 @@ static noinline int run_clustered_refs(struct btrfs_trans_handle *trans,
return count;
}


static void wait_for_more_refs(struct btrfs_delayed_ref_root *delayed_refs,
unsigned long num_refs)
unsigned long num_refs,
struct list_head *first_seq)
{
struct list_head *first_seq = delayed_refs->seq_head.next;

spin_unlock(&delayed_refs->lock);
pr_debug("waiting for more refs (num %ld, first %p)\n",
num_refs, first_seq);
Expand Down Expand Up @@ -2381,6 +2379,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
struct btrfs_delayed_ref_root *delayed_refs;
struct btrfs_delayed_ref_node *ref;
struct list_head cluster;
struct list_head *first_seq = NULL;
int ret;
u64 delayed_start;
int run_all = count == (unsigned long)-1;
Expand Down Expand Up @@ -2436,8 +2435,10 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
*/
consider_waiting = 1;
num_refs = delayed_refs->num_entries;
first_seq = root->fs_info->tree_mod_seq_list.next;
} else {
wait_for_more_refs(delayed_refs, num_refs);
wait_for_more_refs(delayed_refs,
num_refs, first_seq);
/*
* after waiting, things have changed. we
* dropped the lock and someone else might have
Expand Down
Loading

0 comments on commit 8611e53

Please sign in to comment.