Skip to content

Commit

Permalink
generic: refresh patch (coolsnowwolf#3774)
Browse files Browse the repository at this point in the history
* generic-4.19: refresh patch

* generic-4.9: refresh patch

cherry-pick 2515a5e from @1715173329 dalao
  • Loading branch information
aiamadeus authored Mar 13, 2020
1 parent 11feb69 commit 39edfa9
Show file tree
Hide file tree
Showing 17 changed files with 267 additions and 219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Reviewed-by: Bart Van Assche <[email protected]>
+ ret = errno_to_blk_status(cmd->ret);
goto end_io;
}

@@ -1904,7 +1904,10 @@ static void loop_handle_cmd(struct loop_
failed:
/* complete non-aio request */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Reviewed-by: Chaitanya Kulkarni <[email protected]>
struct file *file = lo->lo_backing_file;
+ struct request_queue *q = lo->lo_queue;
int ret;

mode |= FALLOC_FL_KEEP_SIZE;

- if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
+ if (!blk_queue_discard(q)) {
ret = -EOPNOTSUPP;
Expand All @@ -61,7 +61,7 @@ Reviewed-by: Chaitanya Kulkarni <[email protected]>
+
+ blk_queue_max_write_zeroes_sectors(q,
+ backingq->limits.max_write_zeroes_sectors);

/*
* We use punch hole to reclaim the free space used by the
@@ -870,22 +886,24 @@ static void loop_config_discard(struct l
Expand All @@ -78,13 +78,13 @@ Reviewed-by: Chaitanya Kulkarni <[email protected]>
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- return;
- }

- q->limits.discard_granularity = inode->i_sb->s_blocksize;
- q->limits.discard_alignment = 0;
+ } else {
+ q->limits.discard_granularity = inode->i_sb->s_blocksize;
+ q->limits.discard_alignment = 0;

- blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
- blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
Expand All @@ -97,5 +97,5 @@ Reviewed-by: Chaitanya Kulkarni <[email protected]>
+ else
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
}

static void loop_unprepare_queue(struct loop_device *lo)

This file was deleted.

Loading

0 comments on commit 39edfa9

Please sign in to comment.