Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311667
b: refs/heads/master
c: fb31fbe
h: refs/heads/master
i:
  311665: b3ec36f
  311663: 1d6c950
v: v3
  • Loading branch information
Alexander Holler authored and Bryan Wu committed Jul 4, 2012
1 parent 8d73e0f commit 488aaee
Show file tree
Hide file tree
Showing 23 changed files with 228 additions and 296 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: 5eecb9cc9029aef3c308fc94149c4a3065d40d9a
refs/heads/master: fb31fbeb647ed1910290712c13f11f1db09e5506
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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 = <&gpio4 24 0>, /* GPIO4_24 */
<&gpio4 25 0>; /* GPIO4_25 */
cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
<&gpio3 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 = <&gpio1 6 0>; /* GPIO1_6 */
wp-gpios = <&gpio1 5 0>; /* GPIO1_5 */
cd-gpios = <&gpio0 6 0>; /* GPIO1_6 */
wp-gpios = <&gpio0 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 = <&gpio2 14 0>; /* GPIO2_14 */
phy-reset-gpios = <&gpio1 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>, /* GPIO3_24 */
<&gpio3 25 0>; /* GPIO3_25 */
cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
<&gpio3 25 0>; /* GPIO4_25 */
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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
16 changes: 15 additions & 1 deletion trunk/drivers/leds/ledtrig-heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <linux/reboot.h>
#include "leds.h"

static int panic_heartbeats;

struct heartbeat_trig_data {
unsigned int phase;
unsigned int period;
Expand All @@ -34,6 +36,11 @@ static void led_heartbeat_function(unsigned long data)
unsigned long brightness = LED_OFF;
unsigned long delay = 0;

if (unlikely(panic_heartbeats)) {
led_set_brightness(led_cdev, LED_OFF);
return;
}

/* acts like an actual heart beat -- ie thump-thump-pause... */
switch (heartbeat_data->phase) {
case 0:
Expand Down Expand Up @@ -111,12 +118,19 @@ static int heartbeat_reboot_notifier(struct notifier_block *nb,
return NOTIFY_DONE;
}

static int heartbeat_panic_notifier(struct notifier_block *nb,
unsigned long code, void *unused)
{
panic_heartbeats = 1;
return NOTIFY_DONE;
}

static struct notifier_block heartbeat_reboot_nb = {
.notifier_call = heartbeat_reboot_notifier,
};

static struct notifier_block heartbeat_panic_nb = {
.notifier_call = heartbeat_reboot_notifier,
.notifier_call = heartbeat_panic_notifier,
};

static int __init heartbeat_trig_init(void)
Expand Down
30 changes: 4 additions & 26 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,6 @@ 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 @@ -537,18 +521,9 @@ static const struct of_device_id *of_match_compat(const struct of_device_id *mat
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 @@ -557,7 +532,10 @@ 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 (match && !matches->compatible[0])
if (matches->compatible[0])
match &= of_device_is_compatible(node,
matches->compatible);
if (match)
return matches;
matches++;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,4 @@ 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: 6 additions & 9 deletions trunk/fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,10 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
goto out;

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

ret = add_all_parents(root, path, parents, level, &ref->key_for_search,
Expand Down Expand Up @@ -839,7 +835,6 @@ 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 @@ -933,6 +928,8 @@ 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: 25 additions & 35 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,18 +1024,11 @@ __tree_mod_log_oldest_root(struct btrfs_fs_info *fs_info,
if (!looped && !tm)
return 0;
/*
* 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.
* we must have key remove operations in the log before the
* replace operation.
*/
if (!tm)
break;
BUG_ON(!tm);

/*
* 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 @@ -1094,7 +1087,11 @@ __tree_mod_log_rewind(struct extent_buffer *eb, u64 time_seq,
tm->generation);
break;
case MOD_LOG_KEY_ADD:
/* if a move operation is needed it's in the log */
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);
}
n--;
break;
case MOD_LOG_MOVE_KEYS:
Expand Down Expand Up @@ -1195,8 +1192,16 @@ 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(logical, root->nodesize);
eb = alloc_dummy_extent_buffer(tm->index << PAGE_CACHE_SHIFT,
root->nodesize);
else
eb = btrfs_clone_extent_buffer(root->node);
btrfs_tree_read_unlock(root->node);
Expand All @@ -1211,10 +1216,7 @@ 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);
}
if (tm)
__tree_mod_log_rewind(eb, time_seq, tm);
else
WARN_ON(btrfs_header_level(eb) != 0);
__tree_mod_log_rewind(eb, time_seq, tm);
extent_buffer_get(eb);

return eb;
Expand Down Expand Up @@ -2993,7 +2995,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 slot, int level, int tree_mod_log)
{
struct extent_buffer *lower;
int nritems;
Expand All @@ -3006,15 +3008,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 (level)
if (tree_mod_log && 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 (level) {
if (tree_mod_log && level) {
ret = tree_mod_log_insert_key(root->fs_info, lower, slot,
MOD_LOG_KEY_ADD);
BUG_ON(ret < 0);
Expand Down Expand Up @@ -3102,7 +3104,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);
path->slots[level + 1] + 1, level + 1, 1);

if (path->slots[level] >= mid) {
path->slots[level] -= mid;
Expand Down Expand Up @@ -3639,7 +3641,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);
path->slots[1] + 1, 1, 0);

btrfs_mark_buffer_dirty(right);
btrfs_mark_buffer_dirty(l);
Expand Down Expand Up @@ -3846,7 +3848,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);
path->slots[1] + 1, 1, 0);
btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]);
path->nodes[0] = right;
Expand All @@ -3855,7 +3857,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);
path->slots[1], 1, 0);
btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]);
path->nodes[0] = right;
Expand Down Expand Up @@ -5119,18 +5121,6 @@ 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: 13 additions & 21 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,17 +2354,12 @@ 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 @@ -2490,23 +2485,20 @@ int open_ctree(struct super_block *sb,
goto fail_trans_kthread;
}

if (sb->s_flags & MS_RDONLY)
return 0;

down_read(&fs_info->cleanup_work_sem);
if ((ret = btrfs_orphan_cleanup(fs_info->fs_root)) ||
(ret = btrfs_orphan_cleanup(fs_info->tree_root))) {
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);
close_ctree(tree_root);
return ret;
}
up_read(&fs_info->cleanup_work_sem);

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

if (err) {
close_ctree(tree_root);
return err;
}
}

return 0;
Expand Down
Loading

0 comments on commit 488aaee

Please sign in to comment.