Hi Christoph,
W dniu 03.04.2020 o 08:39, Christoph Hellwig pisze:
On Thu, Apr 02, 2020 at 07:06:03PM +0200, Andrzej Pietrasiewicz wrote:
From: Evan Green <evgreen@xxxxxxxxxxxx>
<snip>
+ struct request_queue *backingq;
+
+ /*
+ * If the backing device is a block device, mirror its zeroing
+ * capability. Set the discard sectors to the block device's zeroing
+ * capabilities because loop discards result in blkdev_issue_zeroout(),
+ * not blkdev_issue_discard(). This maintains consistent behavior with
+ * file-backed loop devices: discarded regions read back as zero.
+ */
+ if (S_ISBLK(inode->i_mode) && !lo->lo_encrypt_key_size) {
+ backingq = bdev_get_queue(inode->i_bdev);
The backingq could move into this local scope.
+ } else if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
No need for the inner braces.
But the actual functionality looks good to me.
Would you A-b or R-b if I corrected the two small issues which you found?
Andrzej