History

loop: support 4k physical blocksize

When generating bootable VM images certain systems (most notably s390x) require devices with 4k blocksize. This patch implements a new flag 'LO_FLAGS_BLOCKSIZE' which will set the physical blocksize to that of the underlying device, and allow to change the logical blocksize for up to the physical blocksize.

Hannes Reinecke committed 9 years ago

Commit f2c6df71 parent 51001b73 files · +41 −6Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/loop.h+3−0
@@ -22,6 +22,7 @@ enum { · 21 unmodified lines
2222 LO_FLAGS_AUTOCLEAR = 4,
2323 LO_FLAGS_PARTSCAN = 8,
2424 LO_FLAGS_DIRECT_IO = 16,
25+ LO_FLAGS_BLOCKSIZE = 32,
2526 };
2627
2728 #include <asm/posix_types.h> /* for __kernel_old_dev_t */
@@ -59,6 +60,8 @@ struct loop_info64 { · 31 unmodified lines
5960 __u64 lo_init[2];
6061 };
6162
63+#define LO_INFO_BLOCKSIZE(l) (l)->lo_init[0]
64+
6265 /*
6366 * Loop filter types
6467 */