diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a4ad37fd65fb..65c00e9cd7a4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3272,8 +3272,8 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent) if (test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags)) { /* Logic error */ - ASSERT(list_empty(&ordered_extent->list)); - if (unlikely(!list_empty(&ordered_extent->list))) { + ASSERT(list_empty(&ordered_extent->csum_list)); + if (unlikely(!list_empty(&ordered_extent->csum_list))) { ret = -EINVAL; btrfs_abort_transaction(trans, ret); goto out; @@ -3322,7 +3322,7 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent) goto out; } - ret = add_pending_csums(trans, &ordered_extent->list); + ret = add_pending_csums(trans, &ordered_extent->csum_list); if (unlikely(ret)) { btrfs_abort_transaction(trans, ret); goto out; diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 5df02c707aee..a17f18673bed 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -197,7 +197,7 @@ static struct btrfs_ordered_extent *alloc_ordered_extent( entry->flags = flags; refcount_set(&entry->refs, 1); init_waitqueue_head(&entry->wait); - INIT_LIST_HEAD(&entry->list); + INIT_LIST_HEAD(&entry->csum_list); INIT_LIST_HEAD(&entry->log_list); INIT_LIST_HEAD(&entry->root_extent_list); INIT_LIST_HEAD(&entry->work_list); @@ -329,7 +329,7 @@ void btrfs_add_ordered_sum(struct btrfs_ordered_extent *entry, struct btrfs_inode *inode = entry->inode; spin_lock(&inode->ordered_tree_lock); - list_add_tail(&sum->list, &entry->list); + list_add_tail(&sum->list, &entry->csum_list); spin_unlock(&inode->ordered_tree_lock); } @@ -628,7 +628,7 @@ void btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry) ASSERT(list_empty(&entry->log_list)); ASSERT(RB_EMPTY_NODE(&entry->rb_node)); btrfs_add_delayed_iput(entry->inode); - list_for_each_entry_safe(sum, tmp, &entry->list, list) + list_for_each_entry_safe(sum, tmp, &entry->csum_list, list) kvfree(sum); kmem_cache_free(btrfs_ordered_extent_cache, entry); } @@ -1323,10 +1323,10 @@ struct btrfs_ordered_extent *btrfs_split_ordered_extent( } } - list_for_each_entry_safe(sum, tmpsum, &ordered->list, list) { + list_for_each_entry_safe(sum, tmpsum, &ordered->csum_list, list) { if (offset == len) break; - list_move_tail(&sum->list, &new->list); + list_move_tail(&sum->list, &new->csum_list); offset += sum->len; } diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 1e6b0b182b29..e178d4a489af 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h @@ -134,7 +134,7 @@ struct btrfs_ordered_extent { struct btrfs_inode *inode; /* list of checksums for insertion when the extent io is done */ - struct list_head list; + struct list_head csum_list; /* used for fast fsyncs */ struct list_head log_list; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 304a4325e2e0..84ca9837fb66 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5088,7 +5088,7 @@ static int log_extent_csums(struct btrfs_trans_handle *trans, if (test_and_set_bit(BTRFS_ORDERED_LOGGED_CSUM, &ordered->flags)) continue; - list_for_each_entry(sums, &ordered->list, list) { + list_for_each_entry(sums, &ordered->csum_list, list) { ret = log_csums(trans, inode, log_root, sums); if (ret) return ret; diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 3f3233c6221b..11f4bdd617bb 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -2123,9 +2123,8 @@ void btrfs_finish_ordered_zoned(struct btrfs_ordered_extent *ordered) if (test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags)) return; - ASSERT(!list_empty(&ordered->list)); - /* The ordered->list can be empty in the above pre-alloc case. */ - sum = list_first_entry(&ordered->list, struct btrfs_ordered_sum, list); + ASSERT(!list_empty(&ordered->csum_list)); + sum = list_first_entry(&ordered->csum_list, struct btrfs_ordered_sum, list); logical = sum->logical; len = sum->len; @@ -2156,7 +2155,7 @@ void btrfs_finish_ordered_zoned(struct btrfs_ordered_extent *ordered) */ if ((inode->flags & BTRFS_INODE_NODATASUM) || test_bit(BTRFS_FS_STATE_NO_DATA_CSUMS, &fs_info->fs_state)) { - while ((sum = list_first_entry_or_null(&ordered->list, + while ((sum = list_first_entry_or_null(&ordered->csum_list, typeof(*sum), list))) { list_del(&sum->list); kfree(sum);