diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-08-23 20:12:04 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-08-23 20:12:04 +0200 |
commit | e03c8dd14915fabc101aa495828d58598dc5af98 (patch) | |
tree | 8aba1d519848c3f7684ac5673c95f56aa6ff1d57 /include/linux/loop.h | |
parent | e8b177cedc39b092e423b8cbc687dbf096a1de47 (diff) | |
download | op-kernel-dev-e03c8dd14915fabc101aa495828d58598dc5af98.zip op-kernel-dev-e03c8dd14915fabc101aa495828d58598dc5af98.tar.gz |
loop: always allow userspace partitions and optionally support automatic scanning
Automatic partition scanning can be requested individually per loop
device during its setup by setting LO_FLAGS_PARTSCAN. By default, no
partition tables are scanned.
Userspace can now always add and remove partitions from all loop
devices, regardless if the in-kernel partition scanner is enabled or
not.
The needed partition minor numbers are allocated from the extended
minors space, the main loop device numbers will continue to match the
loop minors, regardless of the number of partitions used.
# grep . /sys/class/block/loop1/loop/*
/sys/block/loop1/loop/autoclear:0
/sys/block/loop1/loop/backing_file:/home/kay/data/stuff/part.img
/sys/block/loop1/loop/offset:0
/sys/block/loop1/loop/partscan:1
/sys/block/loop1/loop/sizelimit:0
# ls -l /dev/loop*
brw-rw---- 1 root disk 7, 0 Aug 14 20:22 /dev/loop0
brw-rw---- 1 root disk 7, 1 Aug 14 20:23 /dev/loop1
brw-rw---- 1 root disk 259, 0 Aug 14 20:23 /dev/loop1p1
brw-rw---- 1 root disk 259, 1 Aug 14 20:23 /dev/loop1p2
brw-rw---- 1 root disk 7, 99 Aug 14 20:23 /dev/loop99
brw-rw---- 1 root disk 259, 2 Aug 14 20:23 /dev/loop99p1
brw-rw---- 1 root disk 259, 3 Aug 14 20:23 /dev/loop99p2
crw------T 1 root root 10, 237 Aug 14 20:22 /dev/loop-control
Cc: Karel Zak <kzak@redhat.com>
Cc: Davidlohr Bueso <dave@gnu.org>
Acked-By: Tejun Heo <tj@kernel.org>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include/linux/loop.h')
-rw-r--r-- | include/linux/loop.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/loop.h b/include/linux/loop.h index 66c194e..4367fc5 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h @@ -76,6 +76,7 @@ enum { LO_FLAGS_READ_ONLY = 1, LO_FLAGS_USE_AOPS = 2, LO_FLAGS_AUTOCLEAR = 4, + LO_FLAGS_PARTSCAN = 8, }; #include <asm/posix_types.h> /* for __kernel_old_dev_t */ |