search for: list_add

Displaying 20 results from an estimated 790 matches for "list_add".

2006 Aug 17
3
What''s the best way to stop repeating this line in my controller?
...he "DRY" principle and came across a problem. I am working on a small ajax task manager, and right now in the index page which renders the list, I have (for example, in the Lists controller): def index @lists = List.find(:all) end Now within the controller there''s also a list_add action which is called via ajax.. def list_add if List.create(params[:list]) @lists = List.find(:all) render(:partial => "listform") end end I need to put the @lists = List.find(:all) in it again so it gets the new updated list to render via AJAX like I did in the index action,...
2020 May 06
0
[PATCH] iommu/virtio: reverse arguments to list_add
On Tue, May 05, 2020 at 08:47:47PM +0200, Julia Lawall wrote: > Elsewhere in the file, there is a list_for_each_entry with > &vdev->resv_regions as the second argument, suggesting that > &vdev->resv_regions is the list head. So exchange the > arguments on the list_add call to put the list head in the > second argument. > > Fixes: 2a5a31487445 ("iommu/virtio: Add probe request") > Signed-off-by: Julia Lawall <Julia.Lawall at inria.fr> Thanks for the fix. The reason this hasn't blown up so far is iommu_alloc_resv_region() initiali...
2017 Aug 01
0
list_add corruption problem
Howdy, I've got a CentOS 7 VM that occasionally becomes unresponsive. There's a "list_add corruption" entry in /var/log/messages, included below. This is on VMware. We have lots of other VMs which are running just fine. Only a few are CentOS 7 VMs, though, so I can't rule out some kind of environment issue. It's up-to-date on OS patches, and running kernel 3.10.0-514.26...
2020 May 08
0
[PATCH] iommu/virtio: reverse arguments to list_add
On Tue, May 05, 2020 at 08:47:47PM +0200, Julia Lawall wrote: > Elsewhere in the file, there is a list_for_each_entry with > &vdev->resv_regions as the second argument, suggesting that > &vdev->resv_regions is the list head. So exchange the > arguments on the list_add call to put the list head in the > second argument. > > Fixes: 2a5a31487445 ("iommu/virtio: Add probe request") > Signed-off-by: Julia Lawall <Julia.Lawall at inria.fr> Applied for v5.7, thanks.
2014 Jan 30
2
CentOS 6.5: NFS server crashes with list_add corruption errors
...I'm running CentOS 6.5 as NFS server (v3 and v4) and exporting Ext4 and XFS filesystem. After many months that all works fine today the server crash: Jan 30 09:46:13 qb-storage kernel: ------------[ cut here ]------------ Jan 30 09:46:13 qb-storage kernel: WARNING: at lib/list_debug.c:26 __list_add+0x6d/0xa0() (Not tainted) Jan 30 09:46:13 qb-storage kernel: Hardware name: PowerEdge Jan 30 09:46:13 qb-storage kernel: list_add corruption. next->prev should be prev (ffff8804366c5df0), but was ffff8803f611fa68. (next=ffff8803f611fa68). Jan 30 09:46:13 qb-storage kernel: Modules linked in: n...
2013 Sep 16
1
[PATCH 2/2] com32: Fix a bug on history of commands.
...char *input, int top /*, int width */ , printf("\033[?7h"); - /* Add the command to the history */ - comm_counter = malloc(sizeof(struct cli_command)); - comm_counter->command = malloc(sizeof(char) * (strlen(ret) + 1)); - strcpy(comm_counter->command, ret); - list_add(&(comm_counter->list), &cli_history_head); + /* Add the command to the history if its length is larger than 0 */ + len = strlen(ret); + if (len > 0) { + comm_counter = malloc(sizeof(struct cli_command)); + comm_counter->command = malloc(sizeof(char) * (len + 1)); + strcpy(...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...&out, &in, NULL, NULL); > - if (head < 0) { > + ret = vhost_get_avail_buf(vq, &buf, > + vq->iov, ARRAY_SIZE(vq->iov), > + &out, &in, NULL, NULL); > + if (ret < 0) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vsock->send_pkt_list); > spin_unlock_bh(&vsock->send_pkt_list_lock); > break; > } > > - if (head == vq->num) { > + if (!ret) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vs...
2020 Jun 08
2
[PATCH RFC v5 12/13] vhost/vsock: switch to the buf API
...&out, &in, NULL, NULL); > - if (head < 0) { > + ret = vhost_get_avail_buf(vq, &buf, > + vq->iov, ARRAY_SIZE(vq->iov), > + &out, &in, NULL, NULL); > + if (ret < 0) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vsock->send_pkt_list); > spin_unlock_bh(&vsock->send_pkt_list_lock); > break; > } > > - if (head == vq->num) { > + if (!ret) { > spin_lock_bh(&vsock->send_pkt_list_lock); > list_add(&pkt->list, &vs...
2017 Mar 01
2
[PATCH] drm: virtio: use kmem_cache
...gt;vbufs = kmem_cache_create("virtio-gpu-vbufs", + VBUFFER_SIZE, + __alignof__(struct virtio_gpu_vbuffer), + 0, NULL); if (!vgdev->vbufs) return -ENOMEM; - - for (i = 0, ptr = vgdev->vbufs; - i < count; - i++, ptr += VBUFFER_SIZE) { - vbuf = ptr; - list_add(&vbuf->list, &vgdev->free_vbufs); - } return 0; } void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) { - struct virtio_gpu_vbuffer *vbuf; - int i, count = 0; - - count += virtqueue_get_vring_size(vgdev->ctrlq.vq); - count += virtqueue_get_vring_size(vgdev->cursor...
2017 Mar 01
2
[PATCH] drm: virtio: use kmem_cache
...gt;vbufs = kmem_cache_create("virtio-gpu-vbufs", + VBUFFER_SIZE, + __alignof__(struct virtio_gpu_vbuffer), + 0, NULL); if (!vgdev->vbufs) return -ENOMEM; - - for (i = 0, ptr = vgdev->vbufs; - i < count; - i++, ptr += VBUFFER_SIZE) { - vbuf = ptr; - list_add(&vbuf->list, &vgdev->free_vbufs); - } return 0; } void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) { - struct virtio_gpu_vbuffer *vbuf; - int i, count = 0; - - count += virtqueue_get_vring_size(vgdev->ctrlq.vq); - count += virtqueue_get_vring_size(vgdev->cursor...
2011 Sep 21
3
[PATCH] Btrfs: fix orphan cleanup regression
...ULL); - if (IS_ERR(inode)) { - ret = PTR_ERR(inode); + ret = PTR_RET(inode); + if (ret && ret != -ESTALE) goto out; - } - - /* - * add this inode to the orphan list so btrfs_orphan_del does - * the proper thing when we hit it - */ - spin_lock(&root->orphan_lock); - list_add(&BTRFS_I(inode)->i_orphan, &root->orphan_list); - spin_unlock(&root->orphan_lock); /* - * if this is a bad inode, means we actually succeeded in - * removing the inode, but not the orphan record, which means - * we need to manually delete the orphan since iput will...
2019 Sep 25
2
[PATCH v2 03/27] drm/dp_mst: Destroy MSTBs asynchronously
...(&mstb->mgr->tx_waitq); > - > - drm_dp_mst_put_mstb_malloc(mstb); > + /* > + * This can get called under mgr->mutex, so we need to perform the > + * actual destruction of the mstb in another worker > + */ > + mutex_lock(&mgr->delayed_destroy_lock); > + list_add(&mstb->destroy_next, &mgr->destroy_branch_device_list); > + mutex_unlock(&mgr->delayed_destroy_lock); > + schedule_work(&mgr->delayed_destroy_work); > } > > /** > @@ -1255,10 +1238,10 @@ static void drm_dp_destroy_port(struct kref *kref) > *...
2019 May 17
2
[PATCH v4 0/4] vmw_balloon: Compaction and shrinker support
...ing inflations. >> >> Patches 1-2: Support for compaction >> Patch 3: Support for memory shrinker - disabled by default >> Patch 4: Split refused pages to improve performance >> >> v3->v4: >> * "get around to" comment [Michael] >> * Put list_add under page lock [Michael] >> >> v2->v3: >> * Fixing wrong argument type (int->size_t) [Michael] >> * Fixing a comment (it) [Michael] >> * Reinstating the BUG_ON() when page is locked [Michael] >> >> v1->v2: >> * Return number of pages in l...
2019 May 17
2
[PATCH v4 0/4] vmw_balloon: Compaction and shrinker support
...ing inflations. >> >> Patches 1-2: Support for compaction >> Patch 3: Support for memory shrinker - disabled by default >> Patch 4: Split refused pages to improve performance >> >> v3->v4: >> * "get around to" comment [Michael] >> * Put list_add under page lock [Michael] >> >> v2->v3: >> * Fixing wrong argument type (int->size_t) [Michael] >> * Fixing a comment (it) [Michael] >> * Reinstating the BUG_ON() when page is locked [Michael] >> >> v1->v2: >> * Return number of pages in l...
2016 May 25
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
> > > > > > > > Hi MST, > > > > > > > > I have measured the performance when using a 32K page bitmap, > > > > > > Just to make sure. Do you mean a 32Kbyte bitmap? > > > Covering 1Gbyte of memory? > > Yes. > > > > > > > > > and inflate the balloon to 3GB > > > > of an idle guest
2016 May 25
2
[PATCH RFC kernel] balloon: speed up inflating/deflating process
> > > > > > > > Hi MST, > > > > > > > > I have measured the performance when using a 32K page bitmap, > > > > > > Just to make sure. Do you mean a 32Kbyte bitmap? > > > Covering 1Gbyte of memory? > > Yes. > > > > > > > > > and inflate the balloon to 3GB > > > > of an idle guest
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...ck_get(u32 guest_cid) list_del_init(&pkt->list); spin_unlock_bh(&vsock->send_pkt_list_lock); - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - &out, &in, NULL, NULL); - if (head < 0) { - spin_lock_bh(&vsock->send_pkt_list_lock); - list_add(&pkt->list, &vsock->send_pkt_list); - spin_unlock_bh(&vsock->send_pkt_list_lock); - break; - } - - if (head == vq->num) { + headcount = get_rx_bufs(vq, vq->heads, vsock_hlen + pkt->len, + &in, likely(mergeable) ? UIO_MAXIOV : 1); + if (headcount <= 0)...
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...ck_get(u32 guest_cid) list_del_init(&pkt->list); spin_unlock_bh(&vsock->send_pkt_list_lock); - head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - &out, &in, NULL, NULL); - if (head < 0) { - spin_lock_bh(&vsock->send_pkt_list_lock); - list_add(&pkt->list, &vsock->send_pkt_list); - spin_unlock_bh(&vsock->send_pkt_list_lock); - break; - } - - if (head == vq->num) { + headcount = get_rx_bufs(vq, vq->heads, vsock_hlen + pkt->len, + &in, likely(mergeable) ? UIO_MAXIOV : 1); + if (headcount <= 0)...
2018 Jan 16
1
[RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
...MSI: > + region = iommu_alloc_resv_region(addr, size, prot, > + IOMMU_RESV_MSI); > + break; > + case VIRTIO_IOMMU_RESV_MEM_T_RESERVED: > + default: > + region = iommu_alloc_resv_region(addr, size, 0, > + IOMMU_RESV_RESERVED); > + break; > + } > + > + list_add(&vdev->resv_regions, &region->list); > + > + if (mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_RESERVED && > + mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_MSI) { > + /* Please update your driver. */ > + pr_warn("unknown resv mem subtype 0x%x\n", mem-...
2016 Mar 12
1
[PATCH v1 13/19] zsmalloc: factor page chain functionality out
...SetPagePrivate(page); > + set_page_private(page, 0); > + first_page = page; > + } > + > + if (i == 1) > + set_page_private(first_page, (unsigned long)page); > + if (i >= 1) > + set_page_private(page, (unsigned long)first_page); > + if (i >= 2) > + list_add(&page->lru, &prev_page->lru); > + if (i == nr_pages - 1) > + SetPagePrivate2(page); > + > + prev_page = page; > + } > +} > + > /* > * Allocate a zspage for the given size class > */ > static struct page *alloc_zspage(struct size_class *cl...