mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
loop-util: explain why we propagate discard_max_bytes from backing block device to loopback block device
Follow-up for: 29ee9c6fb7
This commit is contained in:
committed by
Luca Boccassi
parent
20332d7caf
commit
342084b035
@@ -611,6 +611,10 @@ static int loop_device_make_internal(
|
||||
}
|
||||
|
||||
if (S_ISBLK(st.st_mode)) {
|
||||
/* Propagate backing device's discard byte limit to our loopback block device. We do this in
|
||||
* order to avoid that (supposedly quick) discard requests on the loopback device get turned
|
||||
* into (likely slow) zero-out requests on backing devices that do not support discarding
|
||||
* natively, but do support zero-out. */
|
||||
uint64_t discard_max_bytes;
|
||||
|
||||
r = fd_get_max_discard(fd, &discard_max_bytes);
|
||||
|
||||
Reference in New Issue
Block a user