Skip to content

Commit 8c9ad1f

Browse files
Merge branch 'QK-eleven' into upstreamed-common
# Conflicts: # drivers/block/virtio_blk.c # drivers/block/zram/zram_drv.c # drivers/nvme/host/core.c # drivers/nvme/host/multipath.c
2 parents b63ebf9 + efaad1e commit 8c9ad1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+738
-911
lines changed

Documentation/blockdev/zram.txt

Lines changed: 166 additions & 96 deletions
Large diffs are not rendered by default.

arch/arm64/configs/vendor/alioth_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ CONFIG_MTD_OOPS=y
333333
CONFIG_MTD_BLOCK2MTD=y
334334
CONFIG_ZRAM=y
335335
CONFIG_ZRAM_SIZE_OVERRIDE=2
336+
CONFIG_ZRAM_WRITEBACK=y
336337
CONFIG_BLK_DEV_LOOP=y
337338
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
338339
CONFIG_BLK_DEV_RAM=y

arch/arm64/configs/vendor/apollo_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ CONFIG_MTD_OOPS=y
337337
CONFIG_MTD_BLOCK2MTD=y
338338
CONFIG_ZRAM=y
339339
CONFIG_ZRAM_SIZE_OVERRIDE=2
340+
CONFIG_ZRAM_WRITEBACK=y
340341
CONFIG_BLK_DEV_LOOP=y
341342
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
342343
CONFIG_BLK_DEV_RAM=y

arch/arm64/configs/vendor/cmi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ CONFIG_MTD_OOPS=y
341341
CONFIG_MTD_BLOCK2MTD=y
342342
CONFIG_ZRAM=y
343343
CONFIG_ZRAM_SIZE_OVERRIDE=2
344+
CONFIG_ZRAM_WRITEBACK=y
344345
CONFIG_BLK_DEV_LOOP=y
345346
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
346347
CONFIG_BLK_DEV_RAM=y

arch/arm64/configs/vendor/lmi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ CONFIG_MTD_OOPS=y
341341
CONFIG_MTD_BLOCK2MTD=y
342342
CONFIG_ZRAM=y
343343
CONFIG_ZRAM_SIZE_OVERRIDE=2
344+
CONFIG_ZRAM_WRITEBACK=y
344345
CONFIG_BLK_DEV_LOOP=y
345346
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
346347
CONFIG_BLK_DEV_RAM=y

arch/arm64/configs/vendor/thyme_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ CONFIG_MTD_OOPS=y
334334
CONFIG_MTD_BLOCK2MTD=y
335335
CONFIG_ZRAM=y
336336
CONFIG_ZRAM_SIZE_OVERRIDE=2
337+
CONFIG_ZRAM_WRITEBACK=y
337338
CONFIG_BLK_DEV_LOOP=y
338339
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
339340
CONFIG_BLK_DEV_RAM=y

arch/arm64/configs/vendor/umi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ CONFIG_MTD_OOPS=y
340340
CONFIG_MTD_BLOCK2MTD=y
341341
CONFIG_ZRAM=y
342342
CONFIG_ZRAM_SIZE_OVERRIDE=2
343+
CONFIG_ZRAM_WRITEBACK=y
343344
CONFIG_BLK_DEV_LOOP=y
344345
CONFIG_BLK_DEV_LOOP_MIN_COUNT=16
345346
CONFIG_BLK_DEV_RAM=y

arch/x86/mm/pat_rbtree.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,23 @@ static u64 get_subtree_max_end(struct rb_node *node)
5454
return ret;
5555
}
5656

57-
#define NODE_END(node) ((node)->end)
57+
static u64 compute_subtree_max_end(struct memtype *data)
58+
{
59+
u64 max_end = data->end, child_max_end;
60+
61+
child_max_end = get_subtree_max_end(data->rb.rb_right);
62+
if (child_max_end > max_end)
63+
max_end = child_max_end;
64+
65+
child_max_end = get_subtree_max_end(data->rb.rb_left);
66+
if (child_max_end > max_end)
67+
max_end = child_max_end;
68+
69+
return max_end;
70+
}
5871

59-
RB_DECLARE_CALLBACKS_MAX(static, memtype_rb_augment_cb,
60-
struct memtype, rb, u64, subtree_max_end, NODE_END)
72+
RB_DECLARE_CALLBACKS(static, memtype_rb_augment_cb, struct memtype, rb,
73+
u64, subtree_max_end, compute_subtree_max_end)
6174

6275
/* Find the first (lowest start addr) overlapping range from rb tree */
6376
static struct memtype *memtype_rb_lowest_match(struct rb_root *root,

drivers/block/brd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ static struct brd_device *brd_alloc(int i)
394394
disk->flags = GENHD_FL_EXT_DEVT;
395395
sprintf(disk->disk_name, "ram%d", i);
396396
set_capacity(disk, rd_size * 2);
397-
brd->brd_queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
398397

399398
/* Tell the block layer that this is not a rotational device */
400399
blk_queue_flag_set(QUEUE_FLAG_NONROT, brd->brd_queue);

drivers/block/drbd/drbd_interval.c

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,33 @@ sector_t interval_end(struct rb_node *node)
1313
return this->end;
1414
}
1515

16-
#define NODE_END(node) ((node)->sector + ((node)->size >> 9))
16+
/**
17+
* compute_subtree_last - compute end of @node
18+
*
19+
* The end of an interval is the highest (start + (size >> 9)) value of this
20+
* node and of its children. Called for @node and its parents whenever the end
21+
* may have changed.
22+
*/
23+
static inline sector_t
24+
compute_subtree_last(struct drbd_interval *node)
25+
{
26+
sector_t max = node->sector + (node->size >> 9);
27+
28+
if (node->rb.rb_left) {
29+
sector_t left = interval_end(node->rb.rb_left);
30+
if (left > max)
31+
max = left;
32+
}
33+
if (node->rb.rb_right) {
34+
sector_t right = interval_end(node->rb.rb_right);
35+
if (right > max)
36+
max = right;
37+
}
38+
return max;
39+
}
1740

18-
RB_DECLARE_CALLBACKS_MAX(static, augment_callbacks,
19-
struct drbd_interval, rb, sector_t, end, NODE_END);
41+
RB_DECLARE_CALLBACKS(static, augment_callbacks, struct drbd_interval, rb,
42+
sector_t, end, compute_subtree_last);
2043

2144
/**
2245
* drbd_insert_interval - insert a new interval into a tree

0 commit comments

Comments
 (0)