mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
btrfs: use list_for_each_entry_safe in free-space-cache.c
Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b69f2bef48
commit
7ae1681e12
1 changed files with 4 additions and 10 deletions
|
@ -1086,14 +1086,11 @@ write_pinned_extent_entries(struct btrfs_root *root,
|
||||||
static noinline_for_stack int
|
static noinline_for_stack int
|
||||||
write_bitmap_entries(struct btrfs_io_ctl *io_ctl, struct list_head *bitmap_list)
|
write_bitmap_entries(struct btrfs_io_ctl *io_ctl, struct list_head *bitmap_list)
|
||||||
{
|
{
|
||||||
struct list_head *pos, *n;
|
struct btrfs_free_space *entry, *next;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Write out the bitmaps */
|
/* Write out the bitmaps */
|
||||||
list_for_each_safe(pos, n, bitmap_list) {
|
list_for_each_entry_safe(entry, next, bitmap_list, list) {
|
||||||
struct btrfs_free_space *entry =
|
|
||||||
list_entry(pos, struct btrfs_free_space, list);
|
|
||||||
|
|
||||||
ret = io_ctl_add_bitmap(io_ctl, entry->bitmap);
|
ret = io_ctl_add_bitmap(io_ctl, entry->bitmap);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
@ -1119,13 +1116,10 @@ static int flush_dirty_cache(struct inode *inode)
|
||||||
static void noinline_for_stack
|
static void noinline_for_stack
|
||||||
cleanup_bitmap_list(struct list_head *bitmap_list)
|
cleanup_bitmap_list(struct list_head *bitmap_list)
|
||||||
{
|
{
|
||||||
struct list_head *pos, *n;
|
struct btrfs_free_space *entry, *next;
|
||||||
|
|
||||||
list_for_each_safe(pos, n, bitmap_list) {
|
list_for_each_entry_safe(entry, next, bitmap_list, list)
|
||||||
struct btrfs_free_space *entry =
|
|
||||||
list_entry(pos, struct btrfs_free_space, list);
|
|
||||||
list_del_init(&entry->list);
|
list_del_init(&entry->list);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void noinline_for_stack
|
static void noinline_for_stack
|
||||||
|
|
Loading…
Reference in a new issue