Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87414
b: refs/heads/master
c: 27ebe30
h: refs/heads/master
v: v3
  • Loading branch information
Anthony Liguori authored and Rusty Russell committed Mar 17, 2008
1 parent d4d80f8 commit b0b6f3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 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: 3d10a15d6919488204bdb264050d156ced20d9aa
refs/heads/master: 27ebe308af7c14aed0711e25817c6a1235bd16ff
15 changes: 9 additions & 6 deletions trunk/drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
struct virtio_pci_device *vp_dev = opaque;
struct virtio_pci_vq_info *info;
irqreturn_t ret = IRQ_NONE;
unsigned long flags;
u8 isr;

/* reading the ISR has the effect of also clearing it so it's very
Expand All @@ -197,12 +198,12 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
drv->config_changed(&vp_dev->vdev);
}

spin_lock(&vp_dev->lock);
spin_lock_irqsave(&vp_dev->lock, flags);
list_for_each_entry(info, &vp_dev->virtqueues, node) {
if (vring_interrupt(irq, info->vq) == IRQ_HANDLED)
ret = IRQ_HANDLED;
}
spin_unlock(&vp_dev->lock);
spin_unlock_irqrestore(&vp_dev->lock, flags);

return ret;
}
Expand All @@ -214,6 +215,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
struct virtio_pci_vq_info *info;
struct virtqueue *vq;
unsigned long flags;
u16 num;
int err;

Expand Down Expand Up @@ -255,9 +257,9 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
vq->priv = info;
info->vq = vq;

spin_lock(&vp_dev->lock);
spin_lock_irqsave(&vp_dev->lock, flags);
list_add(&info->node, &vp_dev->virtqueues);
spin_unlock(&vp_dev->lock);
spin_unlock_irqrestore(&vp_dev->lock, flags);

return vq;

Expand All @@ -274,10 +276,11 @@ static void vp_del_vq(struct virtqueue *vq)
{
struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
struct virtio_pci_vq_info *info = vq->priv;
unsigned long flags;

spin_lock(&vp_dev->lock);
spin_lock_irqsave(&vp_dev->lock, flags);
list_del(&info->node);
spin_unlock(&vp_dev->lock);
spin_unlock_irqrestore(&vp_dev->lock, flags);

vring_del_virtqueue(vq);

Expand Down
18 changes: 3 additions & 15 deletions trunk/fs/hfs/brec.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ int hfs_brec_remove(struct hfs_find_data *fd)
static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
{
struct hfs_btree *tree;
struct hfs_bnode *node, *new_node, *next_node;
struct hfs_bnode *node, *new_node;
struct hfs_bnode_desc node_desc;
int num_recs, new_rec_off, new_off, old_rec_off;
int data_start, data_end, size;
Expand All @@ -248,17 +248,6 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
new_node->type = node->type;
new_node->height = node->height;

if (node->next)
next_node = hfs_bnode_find(tree, node->next);
else
next_node = NULL;

if (IS_ERR(next_node)) {
hfs_bnode_put(node);
hfs_bnode_put(new_node);
return next_node;
}

size = tree->node_size / 2 - node->num_recs * 2 - 14;
old_rec_off = tree->node_size - 4;
num_recs = 1;
Expand All @@ -272,8 +261,6 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
/* panic? */
hfs_bnode_put(node);
hfs_bnode_put(new_node);
if (next_node)
hfs_bnode_put(next_node);
return ERR_PTR(-ENOSPC);
}

Expand Down Expand Up @@ -328,7 +315,8 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
hfs_bnode_write(node, &node_desc, 0, sizeof(node_desc));

/* update next bnode header */
if (next_node) {
if (new_node->next) {
struct hfs_bnode *next_node = hfs_bnode_find(tree, new_node->next);
next_node->prev = new_node->this;
hfs_bnode_read(next_node, &node_desc, 0, sizeof(node_desc));
node_desc.prev = cpu_to_be32(next_node->prev);
Expand Down

0 comments on commit b0b6f3e

Please sign in to comment.