Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155932
b: refs/heads/master
c: 1b54ab4
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Jul 28, 2009
1 parent 42511b4 commit b5ea992
Show file tree
Hide file tree
Showing 18 changed files with 473 additions and 1,369 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: ddb1d4ede9c8acd2e20ac99bf2b68146ae9f3553
refs/heads/master: 1b54ab450b180eaeeb0eee6f0f64349246a22c14
11 changes: 11 additions & 0 deletions trunk/drivers/hwmon/smsc47m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ superio_exit(void)
#define SUPERIO_REG_ACT 0x30
#define SUPERIO_REG_BASE 0x60
#define SUPERIO_REG_DEVID 0x20
#define SUPERIO_REG_DEVREV 0x21

/* Logical device registers */

Expand Down Expand Up @@ -429,6 +430,9 @@ static int __init smsc47m1_find(unsigned short *addr,
* The LPC47M292 (device id 0x6B) is somewhat compatible, but it
* supports a 3rd fan, and the pin configuration registers are
* unfortunately different.
* The LPC47M233 has the same device id (0x6B) but is not compatible.
* We check the high bit of the device revision register to
* differentiate them.
*/
switch (val) {
case 0x51:
Expand All @@ -448,6 +452,13 @@ static int __init smsc47m1_find(unsigned short *addr,
sio_data->type = smsc47m1;
break;
case 0x6B:
if (superio_inb(SUPERIO_REG_DEVREV) & 0x80) {
pr_debug(DRVNAME ": "
"Found SMSC LPC47M233, unsupported\n");
superio_exit();
return -ENODEV;
}

pr_info(DRVNAME ": Found SMSC LPC47M292\n");
sio_data->type = smsc47m2;
break;
Expand Down
17 changes: 7 additions & 10 deletions trunk/drivers/i2c/chips/tsl2550.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <linux/delay.h>

#define TSL2550_DRV_NAME "tsl2550"
#define DRIVER_VERSION "1.1.2"
#define DRIVER_VERSION "1.1.1"

/*
* Defines
Expand Down Expand Up @@ -189,16 +189,13 @@ static int tsl2550_calculate_lux(u8 ch0, u8 ch1)
u8 r = 128;

/* Avoid division by 0 and count 1 cannot be greater than count 0 */
if (c1 <= c0)
if (c0) {
r = c1 * 128 / c0;

/* Calculate LUX */
lux = ((c0 - c1) * ratio_lut[r]) / 256;
} else
lux = 0;
if (c0 && (c1 <= c0))
r = c1 * 128 / c0;
else
return -EAGAIN;
return -1;

/* Calculate LUX */
lux = ((c0 - c1) * ratio_lut[r]) / 256;

/* LUX range check */
return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/mISDN/l1oip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,10 @@ l1oip_socket_thread(void *data)
while (!signal_pending(current)) {
struct kvec iov = {
.iov_base = recvbuf,
.iov_len = recvbuf_size,
.iov_len = sizeof(recvbuf),
};
recvlen = kernel_recvmsg(socket, &msg, &iov, 1,
recvbuf_size, 0);
sizeof(recvbuf), 0);
if (recvlen > 0) {
l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
} else {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,11 @@ int btrfs_requeue_work(struct btrfs_work *work)
* list
*/
if (worker->idle) {
spin_lock(&worker->workers->lock);
spin_lock_irqsave(&worker->workers->lock, flags);
worker->idle = 0;
list_move_tail(&worker->worker_list,
&worker->workers->worker_list);
spin_unlock(&worker->workers->lock);
spin_unlock_irqrestore(&worker->workers->lock, flags);
}
if (!worker->working) {
wake = 1;
Expand Down
121 changes: 53 additions & 68 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,19 @@ static int comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)

btrfs_disk_key_to_cpu(&k1, disk);

return btrfs_comp_cpu_keys(&k1, k2);
if (k1.objectid > k2->objectid)
return 1;
if (k1.objectid < k2->objectid)
return -1;
if (k1.type > k2->type)
return 1;
if (k1.type < k2->type)
return -1;
if (k1.offset > k2->offset)
return 1;
if (k1.offset < k2->offset)
return -1;
return 0;
}

/*
Expand Down Expand Up @@ -1040,6 +1052,9 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
BTRFS_NODEPTRS_PER_BLOCK(root) / 4)
return 0;

if (btrfs_header_nritems(mid) > 2)
return 0;

if (btrfs_header_nritems(mid) < 2)
err_on_enospc = 1;

Expand Down Expand Up @@ -1686,7 +1701,6 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
struct extent_buffer *b;
int slot;
int ret;
int err;
int level;
int lowest_unlock = 1;
u8 lowest_level = 0;
Expand Down Expand Up @@ -1723,6 +1737,8 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
p->locks[level] = 1;

if (cow) {
int wret;

/*
* if we don't really need to cow this block
* then we don't want to set the path blocking,
Expand All @@ -1733,12 +1749,12 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root

btrfs_set_path_blocking(p);

err = btrfs_cow_block(trans, root, b,
p->nodes[level + 1],
p->slots[level + 1], &b);
if (err) {
wret = btrfs_cow_block(trans, root, b,
p->nodes[level + 1],
p->slots[level + 1], &b);
if (wret) {
free_extent_buffer(b);
ret = err;
ret = wret;
goto done;
}
}
Expand Down Expand Up @@ -1777,45 +1793,41 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
ret = bin_search(b, key, level, &slot);

if (level != 0) {
int dec = 0;
if (ret && slot > 0) {
dec = 1;
if (ret && slot > 0)
slot -= 1;
}
p->slots[level] = slot;
err = setup_nodes_for_search(trans, root, p, b, level,
ret = setup_nodes_for_search(trans, root, p, b, level,
ins_len);
if (err == -EAGAIN)
if (ret == -EAGAIN)
goto again;
if (err) {
ret = err;
else if (ret)
goto done;
}
b = p->nodes[level];
slot = p->slots[level];

unlock_up(p, level, lowest_unlock);

/* this is only true while dropping a snapshot */
if (level == lowest_level) {
if (dec)
p->slots[level]++;
ret = 0;
goto done;
}

err = read_block_for_search(trans, root, p,
ret = read_block_for_search(trans, root, p,
&b, level, slot, key);
if (err == -EAGAIN)
if (ret == -EAGAIN)
goto again;
if (err) {
ret = err;

if (ret == -EIO)
goto done;
}

if (!p->skip_locking) {
int lret;

btrfs_clear_path_blocking(p, NULL);
err = btrfs_try_spin_lock(b);
lret = btrfs_try_spin_lock(b);

if (!err) {
if (!lret) {
btrfs_set_path_blocking(p);
btrfs_tree_lock(b);
btrfs_clear_path_blocking(p, b);
Expand All @@ -1825,14 +1837,16 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
p->slots[level] = slot;
if (ins_len > 0 &&
btrfs_leaf_free_space(root, b) < ins_len) {
int sret;

btrfs_set_path_blocking(p);
err = split_leaf(trans, root, key,
p, ins_len, ret == 0);
sret = split_leaf(trans, root, key,
p, ins_len, ret == 0);
btrfs_clear_path_blocking(p, NULL);

BUG_ON(err > 0);
if (err) {
ret = err;
BUG_ON(sret > 0);
if (sret) {
ret = sret;
goto done;
}
}
Expand Down Expand Up @@ -3793,7 +3807,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
}

/* delete the leaf if it is mostly empty */
if (used < BTRFS_LEAF_DATA_SIZE(root) / 3) {
if (used < BTRFS_LEAF_DATA_SIZE(root) / 2) {
/* push_leaf_left fixes the path.
* make sure the path still points to our leaf
* for possible call to del_ptr below
Expand Down Expand Up @@ -4028,9 +4042,10 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
* calling this function.
*/
int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
struct btrfs_key *key, int level,
struct btrfs_key *key, int lowest_level,
int cache_only, u64 min_trans)
{
int level = lowest_level;
int slot;
struct extent_buffer *c;

Expand All @@ -4043,40 +4058,11 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
c = path->nodes[level];
next:
if (slot >= btrfs_header_nritems(c)) {
int ret;
int orig_lowest;
struct btrfs_key cur_key;
if (level + 1 >= BTRFS_MAX_LEVEL ||
!path->nodes[level + 1])
level++;
if (level == BTRFS_MAX_LEVEL)
return 1;

if (path->locks[level + 1]) {
level++;
continue;
}

slot = btrfs_header_nritems(c) - 1;
if (level == 0)
btrfs_item_key_to_cpu(c, &cur_key, slot);
else
btrfs_node_key_to_cpu(c, &cur_key, slot);

orig_lowest = path->lowest_level;
btrfs_release_path(root, path);
path->lowest_level = level;
ret = btrfs_search_slot(NULL, root, &cur_key, path,
0, 0);
path->lowest_level = orig_lowest;
if (ret < 0)
return ret;

c = path->nodes[level];
slot = path->slots[level];
if (ret == 0)
slot++;
goto next;
continue;
}

if (level == 0)
btrfs_item_key_to_cpu(c, key, slot);
else {
Expand Down Expand Up @@ -4160,8 +4146,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
* advance the path if there are now more items available.
*/
if (nritems > 0 && path->slots[0] < nritems - 1) {
if (ret == 0)
path->slots[0]++;
path->slots[0]++;
ret = 0;
goto done;
}
Expand Down Expand Up @@ -4293,10 +4278,10 @@ int btrfs_previous_item(struct btrfs_root *root,
path->slots[0]--;

btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
if (found_key.objectid < min_objectid)
break;
if (found_key.type == type)
return 0;
if (found_key.objectid < min_objectid)
break;
if (found_key.objectid == min_objectid &&
found_key.type < type)
break;
Expand Down
Loading

0 comments on commit b5ea992

Please sign in to comment.