summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2019-07-01 19:04:45 +0200
committerManuel Bentele2019-08-21 21:43:30 +0200
commitcaeca80a5655f79a923f055f3a2fed740106fdd3 (patch)
tree0592c617e850577767faf2db79cdb8c94b9193ad
parentblock: loop: extend kernel module interface for file format support (diff)
downloadkernel-qcow2-linux-caeca80a5655f79a923f055f3a2fed740106fdd3.tar.gz
kernel-qcow2-linux-caeca80a5655f79a923f055f3a2fed740106fdd3.tar.xz
kernel-qcow2-linux-caeca80a5655f79a923f055f3a2fed740106fdd3.zip
block: loop: rename and move files for file format support integration
The existing loop device kernel module source files are renamed and moved into its own subfolder to prepare the source for the extension of the file format support for loop devices. Also, it cleans up the block device drivers directory. Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
-rw-r--r--drivers/block/Kconfig73
-rw-r--r--drivers/block/Makefile4
-rw-r--r--drivers/block/loop/Kconfig78
-rw-r--r--drivers/block/loop/Makefile6
-rw-r--r--drivers/block/loop/cryptoloop.c (renamed from drivers/block/cryptoloop.c)2
-rw-r--r--drivers/block/loop/loop_main.c (renamed from drivers/block/loop.c)2
-rw-r--r--drivers/block/loop/loop_main.h (renamed from drivers/block/loop.h)0
7 files changed, 89 insertions, 76 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index d4913516823f..2e2f04462260 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -183,78 +183,7 @@ config BLK_DEV_COW_COMMON
bool
default BLK_DEV_UBD
-config BLK_DEV_LOOP
- tristate "Loopback device support"
- ---help---
- Saying Y here will allow you to use a regular file as a block
- device; you can then create a file system on that block device and
- mount it just as you would mount other block devices such as hard
- drive partitions, CD-ROM drives or floppy drives. The loop devices
- are block special device files with major number 7 and typically
- called /dev/loop0, /dev/loop1 etc.
-
- This is useful if you want to check an ISO 9660 file system before
- burning the CD, or if you want to use floppy images without first
- writing them to floppy. Furthermore, some Linux distributions avoid
- the need for a dedicated Linux partition by keeping their complete
- root file system inside a DOS FAT file using this loop device
- driver.
-
- To use the loop device, you need the losetup utility, found in the
- util-linux package, see
- <https://www.kernel.org/pub/linux/utils/util-linux/>.
-
- The loop device driver can also be used to "hide" a file system in
- a disk partition, floppy, or regular file, either using encryption
- (scrambling the data) or steganography (hiding the data in the low
- bits of, say, a sound file). This is also safe if the file resides
- on a remote file server.
-
- There are several ways of encrypting disks. Some of these require
- kernel patches. The vanilla kernel offers the cryptoloop option
- and a Device Mapper target (which is superior, as it supports all
- file systems). If you want to use the cryptoloop, say Y to both
- LOOP and CRYPTOLOOP, and make sure you have a recent (version 2.12
- or later) version of util-linux. Additionally, be aware that
- the cryptoloop is not safe for storing journaled filesystems.
-
- Note that this loop device has nothing to do with the loopback
- device used for network connections from the machine to itself.
-
- To compile this driver as a module, choose M here: the
- module will be called loop.
-
- Most users will answer N here.
-
-config BLK_DEV_LOOP_MIN_COUNT
- int "Number of loop devices to pre-create at init time"
- depends on BLK_DEV_LOOP
- default 8
- help
- Static number of loop devices to be unconditionally pre-created
- at init time.
-
- This default value can be overwritten on the kernel command
- line or with module-parameter loop.max_loop.
-
- The historic default is 8. If a late 2011 version of losetup(8)
- is used, it can be set to 0, since needed loop devices can be
- dynamically allocated with the /dev/loop-control interface.
-
-config BLK_DEV_CRYPTOLOOP
- tristate "Cryptoloop Support"
- select CRYPTO
- select CRYPTO_CBC
- depends on BLK_DEV_LOOP
- ---help---
- Say Y here if you want to be able to use the ciphers that are
- provided by the CryptoAPI as loop transformation. This might be
- used as hard disk encryption.
-
- WARNING: This device is not safe for journaled file systems like
- ext3 or Reiserfs. Please use the Device Mapper crypto module
- instead, which can be configured to be on-disk compatible with the
- cryptoloop device.
+source "drivers/block/loop/Kconfig"
source "drivers/block/drbd/Kconfig"
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 8566b188368b..62ac3ae019b7 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_PS3_VRAM) += ps3vram.o
obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
obj-$(CONFIG_BLK_DEV_RAM) += brd.o
-obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
+obj-$(CONFIG_BLK_DEV_LOOP) += loop/
obj-$(CONFIG_BLK_DEV_DAC960) += DAC960.o
obj-$(CONFIG_XILINX_SYSACE) += xsysace.o
obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
@@ -24,7 +24,7 @@ obj-$(CONFIG_BLK_DEV_SKD) += skd.o
obj-$(CONFIG_BLK_DEV_UMEM) += umem.o
obj-$(CONFIG_BLK_DEV_NBD) += nbd.o
-obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
+obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += loop/
obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
diff --git a/drivers/block/loop/Kconfig b/drivers/block/loop/Kconfig
new file mode 100644
index 000000000000..a595e6a9f20f
--- /dev/null
+++ b/drivers/block/loop/Kconfig
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Loop device driver configuration
+#
+
+config BLK_DEV_LOOP
+ tristate "Loopback device support"
+ ---help---
+ Saying Y here will allow you to use a regular file as a block
+ device; you can then create a file system on that block device and
+ mount it just as you would mount other block devices such as hard
+ drive partitions, CD-ROM drives or floppy drives. The loop devices
+ are block special device files with major number 7 and typically
+ called /dev/loop0, /dev/loop1 etc.
+
+ This is useful if you want to check an ISO 9660 file system before
+ burning the CD, or if you want to use floppy images without first
+ writing them to floppy. Furthermore, some Linux distributions avoid
+ the need for a dedicated Linux partition by keeping their complete
+ root file system inside a DOS FAT file using this loop device
+ driver.
+
+ To use the loop device, you need the losetup utility, found in the
+ util-linux package, see
+ <https://www.kernel.org/pub/linux/utils/util-linux/>.
+
+ The loop device driver can also be used to "hide" a file system in
+ a disk partition, floppy, or regular file, either using encryption
+ (scrambling the data) or steganography (hiding the data in the low
+ bits of, say, a sound file). This is also safe if the file resides
+ on a remote file server.
+
+ There are several ways of encrypting disks. Some of these require
+ kernel patches. The vanilla kernel offers the cryptoloop option
+ and a Device Mapper target (which is superior, as it supports all
+ file systems). If you want to use the cryptoloop, say Y to both
+ LOOP and CRYPTOLOOP, and make sure you have a recent (version 2.12
+ or later) version of util-linux. Additionally, be aware that
+ the cryptoloop is not safe for storing journaled filesystems.
+
+ Note that this loop device has nothing to do with the loopback
+ device used for network connections from the machine to itself.
+
+ To compile this driver as a module, choose M here: the
+ module will be called loop.
+
+ Most users will answer N here.
+
+config BLK_DEV_LOOP_MIN_COUNT
+ int "Number of loop devices to pre-create at init time"
+ depends on BLK_DEV_LOOP
+ default 8
+ help
+ Static number of loop devices to be unconditionally pre-created
+ at init time.
+
+ This default value can be overwritten on the kernel command
+ line or with module-parameter loop.max_loop.
+
+ The historic default is 8. If a late 2011 version of losetup(8)
+ is used, it can be set to 0, since needed loop devices can be
+ dynamically allocated with the /dev/loop-control interface.
+
+config BLK_DEV_CRYPTOLOOP
+ tristate "Cryptoloop Support"
+ select CRYPTO
+ select CRYPTO_CBC
+ depends on BLK_DEV_LOOP
+ ---help---
+ Say Y here if you want to be able to use the ciphers that are
+ provided by the CryptoAPI as loop transformation. This might be
+ used as hard disk encryption.
+
+ WARNING: This device is not safe for journaled file systems like
+ ext3 or Reiserfs. Please use the Device Mapper crypto module
+ instead, which can be configured to be on-disk compatible with the
+ cryptoloop device.
+ \ No newline at end of file
diff --git a/drivers/block/loop/Makefile b/drivers/block/loop/Makefile
new file mode 100644
index 000000000000..5dffb318797e
--- /dev/null
+++ b/drivers/block/loop/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+
+loop-y += loop_main.o
+obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
+
+obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
diff --git a/drivers/block/cryptoloop.c b/drivers/block/loop/cryptoloop.c
index 7033a4beda66..4d78436f922e 100644
--- a/drivers/block/cryptoloop.c
+++ b/drivers/block/loop/cryptoloop.c
@@ -27,7 +27,7 @@
#include <linux/blkdev.h>
#include <linux/scatterlist.h>
#include <linux/uaccess.h>
-#include "loop.h"
+#include "loop_main.h"
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("loop blockdevice transferfunction adaptor / CryptoAPI");
diff --git a/drivers/block/loop.c b/drivers/block/loop/loop_main.c
index d94332851ef7..6f851c13c13a 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop/loop_main.c
@@ -78,7 +78,7 @@
#include <linux/uio.h>
#include <linux/ioprio.h>
-#include "loop.h"
+#include "loop_main.h"
#include <linux/uaccess.h>
diff --git a/drivers/block/loop.h b/drivers/block/loop/loop_main.h
index 62616f48e754..62616f48e754 100644
--- a/drivers/block/loop.h
+++ b/drivers/block/loop/loop_main.h