search for: list_for_each

Displaying 20 results from an estimated 148 matches for "list_for_each".

2009 Jan 16
4
[PATCH] Btrfs: simplify iteration codes
merge list_for_each and list_entry to list_for_each_entry. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b187b53..70f0248 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -104,10 +104,8 @@ static noinline struct btrfs_device *__...
2007 May 17
1
[PATCH] ocfs: use list_for_each_entry where benefical
...5:00:14.000000000 +0200 @@ -261,14 +261,12 @@ out: static void o2net_complete_nodes_nsw(struct o2net_node *nn) { - struct list_head *iter, *tmp; + struct o2net_status_wait *nsw, *tmp; unsigned int num_kills = 0; - struct o2net_status_wait *nsw; assert_spin_locked(&nn->nn_lock); - list_for_each_safe(iter, tmp, &nn->nn_status_list) { - nsw = list_entry(iter, struct o2net_status_wait, ns_node_item); + list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); num_kills++; } @@ -764,13 +762,10 @@ EXPOR...
2011 Feb 14
1
[PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment
...taging/hv/channel_mgmt.c index a9c9d49..6c497e9 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c @@ -580,8 +580,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr) spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); list_for_each(curr, &vmbus_connection.chn_msg_list) { -/* FIXME: this should probably use list_entry() instead */ - msginfo = (struct vmbus_channel_msginfo *)curr; + msginfo = list_entry(curr, struct vmbus_channel_msginfo, + msglistentry); + requestheader = (struct vmbus_channel_message_header *)...
2011 Feb 14
1
[PATCH] Staging: hv: Use list_entry for msg_info and remove associated comment
...taging/hv/channel_mgmt.c index a9c9d49..6c497e9 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c @@ -580,8 +580,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr) spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); list_for_each(curr, &vmbus_connection.chn_msg_list) { -/* FIXME: this should probably use list_entry() instead */ - msginfo = (struct vmbus_channel_msginfo *)curr; + msginfo = list_entry(curr, struct vmbus_channel_msginfo, + msglistentry); + requestheader = (struct vmbus_channel_message_header *)...
2016 Jul 27
4
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/26/2016 06:23 PM, Liang Li wrote: > + for_each_migratetype_order(order, t) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + if (pfn >= start_pfn && pfn <= end_pfn) { > + page_num = 1UL << order; > + if (pfn + page_num > end_pfn) > + page_num = end_pfn - p...
2016 Jul 27
4
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/26/2016 06:23 PM, Liang Li wrote: > + for_each_migratetype_order(order, t) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + if (pfn >= start_pfn && pfn <= end_pfn) { > + page_num = 1UL << order; > + if (pfn + page_num > end_pfn) > + page_num = end_pfn - p...
2016 Jul 27
2
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/27/2016 03:05 PM, Michael S. Tsirkin wrote: > On Wed, Jul 27, 2016 at 09:40:56AM -0700, Dave Hansen wrote: >> On 07/26/2016 06:23 PM, Liang Li wrote: >>> + for_each_migratetype_order(order, t) { >>> + list_for_each(curr, &zone->free_area[order].free_list[t]) { >>> + pfn = page_to_pfn(list_entry(curr, struct page, lru)); >>> + if (pfn >= start_pfn && pfn <= end_pfn) { >>> + page_num = 1UL << order; >>> + if (pfn + page_num > end_pfn) &...
2016 Jul 27
2
[PATCH v2 repost 6/7] mm: add the related functions to get free page info
On 07/27/2016 03:05 PM, Michael S. Tsirkin wrote: > On Wed, Jul 27, 2016 at 09:40:56AM -0700, Dave Hansen wrote: >> On 07/26/2016 06:23 PM, Liang Li wrote: >>> + for_each_migratetype_order(order, t) { >>> + list_for_each(curr, &zone->free_area[order].free_list[t]) { >>> + pfn = page_to_pfn(list_entry(curr, struct page, lru)); >>> + if (pfn >= start_pfn && pfn <= end_pfn) { >>> + page_num = 1UL << order; >>> + if (pfn + page_num > end_pfn) &...
2013 Jun 25
3
[PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices
...vice->writeable = 0; + if (device->name) + kfree(device->name); + kfree(device); +} + int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) { struct btrfs_fs_devices *seed_devices; @@ -161,17 +171,17 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) again: list_for_each(cur, &fs_devices->devices) { device = list_entry(cur, struct btrfs_device, dev_list); - close(device->fd); - device->fd = -1; - device->writeable = 0; + btrfs_close_device(device); } seed_devices = fs_devices->seed; fs_devices->seed = NULL; if (seed_device...
2008 Dec 25
0
[PATCH 1/4] dom0 linux: Expose HID, UID, SEG, BBN of PCI root bridge via sysfs.
...78f5 drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c Thu Dec 18 11:51:36 2008 +0000 +++ b/drivers/acpi/pci_root.c Thu Dec 25 10:37:52 2008 +0900 @@ -151,6 +151,36 @@ return AE_OK; } +ssize_t +acpi_device_seg_show(struct acpi_device *acpi_dev, char *buf) +{ + struct list_head *entry; + + list_for_each(entry, &acpi_pci_roots) { + struct acpi_pci_root *root; + root = list_entry(entry, struct acpi_pci_root, node); + if (root->device == acpi_dev) + return sprintf(buf, "%04x\n", root->id.segment); + } + return 0; +} +ACPI_DEVICE_ATTR(seg, 0444, acpi_device_seg_show, NULL); +...
2016 Mar 04
2
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
...(struct zone *zone, + unsigned long *free_page_bitmap, unsigned long pfn_gap) { + unsigned long pfn, flags, i; + unsigned int order, t; + struct list_head *curr; + + if (zone_is_empty(zone)) + return; + + spin_lock_irqsave(&zone->lock, flags); + + for_each_migratetype_order(order, t) { + list_for_each(curr, &zone->free_area[order].free_list[t]) { + + pfn = page_to_pfn(list_entry(curr, struct page, lru)); + for (i = 0; i < (1UL << order); i++) { + if ((pfn + i) >= PFN_4G) + set_bit_le(pfn + i - pfn_gap, + free_page_bitmap); + else + set_bit_le(pfn + i,...
2016 Mar 04
2
[Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization
...(struct zone *zone, + unsigned long *free_page_bitmap, unsigned long pfn_gap) { + unsigned long pfn, flags, i; + unsigned int order, t; + struct list_head *curr; + + if (zone_is_empty(zone)) + return; + + spin_lock_irqsave(&zone->lock, flags); + + for_each_migratetype_order(order, t) { + list_for_each(curr, &zone->free_area[order].free_list[t]) { + + pfn = page_to_pfn(list_entry(curr, struct page, lru)); + for (i = 0; i < (1UL << order); i++) { + if ((pfn + i) >= PFN_4G) + set_bit_le(pfn + i - pfn_gap, + free_page_bitmap); + else + set_bit_le(pfn + i,...
2008 Dec 25
0
[PATCH 2/4] dom0 linux: Add "guestdev=" boot parameter.
...ot.c --- a/drivers/acpi/pci_root.c Thu Dec 25 10:37:52 2008 +0900 +++ b/drivers/acpi/pci_root.c Thu Dec 25 10:43:34 2008 +0900 @@ -392,3 +392,32 @@ } subsys_initcall(acpi_pci_root_init); + +int acpi_pci_get_root_seg_bbn(char *hid, char *uid, int *seg, int *bbn) +{ + struct list_head *entry; + + list_for_each(entry, &acpi_pci_roots) { + struct acpi_pci_root *root; + root = list_entry(entry, struct acpi_pci_root, node); + if (!root->device->flags.hardware_id) + continue; + + if (strcmp(root->device->pnp.hardware_id, hid)) + continue; + + if (!root->device->flags.unique_id)...
2011 Jan 26
8
[PATCH 1/8] staging: hv: Convert camel cased variables in connection.c to lower cases
...@ static void vmbus_process_offer(struct work_struct *work) INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); /* Make sure this is a new offer */ - spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); + spin_lock_irqsave(&vmbus_connection.channel_lock, flags); - list_for_each_entry(channel, &gVmbusConnection.ChannelList, listentry) { + list_for_each_entry(channel, &vmbus_connection.ChannelList, listentry) { if (!memcmp(&channel->offermsg.offer.InterfaceType, &newchannel->offermsg.offer.InterfaceType, sizeof(struct hv_guid)) &...
2011 Jan 26
8
[PATCH 1/8] staging: hv: Convert camel cased variables in connection.c to lower cases
...@ static void vmbus_process_offer(struct work_struct *work) INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); /* Make sure this is a new offer */ - spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); + spin_lock_irqsave(&vmbus_connection.channel_lock, flags); - list_for_each_entry(channel, &gVmbusConnection.ChannelList, listentry) { + list_for_each_entry(channel, &vmbus_connection.ChannelList, listentry) { if (!memcmp(&channel->offermsg.offer.InterfaceType, &newchannel->offermsg.offer.InterfaceType, sizeof(struct hv_guid)) &...
2017 Mar 16
4
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...ne_is_empty(zone)) > + return 0; > + > + spin_lock_irqsave(&zone->lock, flags); > + > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > + ret = -ENOSPC; > + goto out; > + } > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + chunk = buf + *offset; > + if (*offset + 2 > size) { > + ret = -ENOSPC; > + goto out; > + } > + /* Align to the chunk format used in virtio-bal...
2017 Mar 16
4
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...ne_is_empty(zone)) > + return 0; > + > + spin_lock_irqsave(&zone->lock, flags); > + > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > + ret = -ENOSPC; > + goto out; > + } > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + chunk = buf + *offset; > + if (*offset + 2 > size) { > + ret = -ENOSPC; > + goto out; > + } > + /* Align to the chunk format used in virtio-bal...
2006 Aug 02
10
[PATCH 0/6] htb: cleanup
The HTB scheduler code is a mess, this patch set does some basic house cleaning. The first four should cause no code change, but the last two need more testing. -- Stephen Hemminger <shemminger@osdl.org> "And in the Packet there writ down that doome" - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to
2017 Mar 29
2
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...amp;zone->lock, flags); > > > + > > > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > > > + ret = -ENOSPC; > > > + goto out; > > > + } > > > + for (t = 0; t < MIGRATE_TYPES; t++) { > > > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > > > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > > > + chunk = buf + *offset; > > > + if (*offset + 2 > size) { > > > + ret = -ENOSPC; > > > + goto out; > > > +...
2017 Mar 29
2
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...amp;zone->lock, flags); > > > + > > > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > > > + ret = -ENOSPC; > > > + goto out; > > > + } > > > + for (t = 0; t < MIGRATE_TYPES; t++) { > > > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > > > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > > > + chunk = buf + *offset; > > > + if (*offset + 2 > size) { > > > + ret = -ENOSPC; > > > + goto out; > > > +...