aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-08 15:19:57 -0500
commit972b2c719990f91eb3b2310d44ef8a2d38955a14 (patch)
treeb25a250ec5bec4b7b6355d214642d8b57c5cab32 /block
parent02550d61f49266930e674286379d3601006b2893 (diff)
parentc3aa077648e147783a7a53b409578234647db853 (diff)
Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits) reiserfs: Properly display mount options in /proc/mounts vfs: prevent remount read-only if pending removes vfs: count unlinked inodes vfs: protect remounting superblock read-only vfs: keep list of mounts for each superblock vfs: switch ->show_options() to struct dentry * vfs: switch ->show_path() to struct dentry * vfs: switch ->show_devname() to struct dentry * vfs: switch ->show_stats to struct dentry * switch security_path_chmod() to struct path * vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb vfs: trim includes a bit switch mnt_namespace ->root to struct mount vfs: take /proc/*/mounts and friends to fs/proc_namespace.c vfs: opencode mntget() mnt_set_mountpoint() vfs: spread struct mount - remaining argument of next_mnt() vfs: move fsnotify junk to struct mount vfs: move mnt_devname vfs: move mnt_list to struct mount vfs: switch pnode.h macros to struct mount * ...
Diffstat (limited to 'block')
-rw-r--r--block/Kconfig6
-rw-r--r--block/Makefile3
-rw-r--r--block/bsg.c2
-rw-r--r--block/genhd.c5
-rw-r--r--block/ioctl.c2
-rw-r--r--block/partition-generic.c537
-rw-r--r--block/partitions/Kconfig251
-rw-r--r--block/partitions/Makefile20
-rw-r--r--block/partitions/acorn.c556
-rw-r--r--block/partitions/acorn.h14
-rw-r--r--block/partitions/amiga.c139
-rw-r--r--block/partitions/amiga.h6
-rw-r--r--block/partitions/atari.c149
-rw-r--r--block/partitions/atari.h34
-rw-r--r--block/partitions/check.c166
-rw-r--r--block/partitions/check.h52
-rw-r--r--block/partitions/efi.c675
-rw-r--r--block/partitions/efi.h134
-rw-r--r--block/partitions/ibm.c275
-rw-r--r--block/partitions/ibm.h1
-rw-r--r--block/partitions/karma.c57
-rw-r--r--block/partitions/karma.h8
-rw-r--r--block/partitions/ldm.c1570
-rw-r--r--block/partitions/ldm.h215
-rw-r--r--block/partitions/mac.c134
-rw-r--r--block/partitions/mac.h44
-rw-r--r--block/partitions/msdos.c552
-rw-r--r--block/partitions/msdos.h8
-rw-r--r--block/partitions/osf.c86
-rw-r--r--block/partitions/osf.h7
-rw-r--r--block/partitions/sgi.c82
-rw-r--r--block/partitions/sgi.h8
-rw-r--r--block/partitions/sun.c122
-rw-r--r--block/partitions/sun.h8
-rw-r--r--block/partitions/sysv68.c95
-rw-r--r--block/partitions/sysv68.h1
-rw-r--r--block/partitions/ultrix.c48
-rw-r--r--block/partitions/ultrix.h5
38 files changed, 6071 insertions, 6 deletions
diff --git a/block/Kconfig b/block/Kconfig
index e97934eececa..09acf1b39905 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -99,6 +99,12 @@ config BLK_DEV_THROTTLING
99 99
100 See Documentation/cgroups/blkio-controller.txt for more information. 100 See Documentation/cgroups/blkio-controller.txt for more information.
101 101
102menu "Partition Types"
103
104source "block/partitions/Kconfig"
105
106endmenu
107
102endif # BLOCK 108endif # BLOCK
103 109
104config BLOCK_COMPAT 110config BLOCK_COMPAT
diff --git a/block/Makefile b/block/Makefile
index 514c6e4f427a..39b76ba66ffd 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -5,7 +5,8 @@
5obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ 5obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
6 blk-flush.o blk-settings.o blk-ioc.o blk-map.o \ 6 blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ 7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
8 blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o 8 blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o \
9 partition-generic.o partitions/
9 10
10obj-$(CONFIG_BLK_DEV_BSG) += bsg.o 11obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
11obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o 12obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
diff --git a/block/bsg.c b/block/bsg.c
index 702f1316bb8f..9651ec7b87c2 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -1070,7 +1070,7 @@ EXPORT_SYMBOL_GPL(bsg_register_queue);
1070 1070
1071static struct cdev bsg_cdev; 1071static struct cdev bsg_cdev;
1072 1072
1073static char *bsg_devnode(struct device *dev, mode_t *mode) 1073static char *bsg_devnode(struct device *dev, umode_t *mode)
1074{ 1074{
1075 return kasprintf(GFP_KERNEL, "bsg/%s", dev_name(dev)); 1075 return kasprintf(GFP_KERNEL, "bsg/%s", dev_name(dev));
1076} 1076}
diff --git a/block/genhd.c b/block/genhd.c
index 02e9fca80825..83e7c04015e1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -15,7 +15,6 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/kmod.h> 16#include <linux/kmod.h>
17#include <linux/kobj_map.h> 17#include <linux/kobj_map.h>
18#include <linux/buffer_head.h>
19#include <linux/mutex.h> 18#include <linux/mutex.h>
20#include <linux/idr.h> 19#include <linux/idr.h>
21#include <linux/log2.h> 20#include <linux/log2.h>
@@ -507,7 +506,7 @@ static int exact_lock(dev_t devt, void *data)
507 return 0; 506 return 0;
508} 507}
509 508
510void register_disk(struct gendisk *disk) 509static void register_disk(struct gendisk *disk)
511{ 510{
512 struct device *ddev = disk_to_dev(disk); 511 struct device *ddev = disk_to_dev(disk);
513 struct block_device *bdev; 512 struct block_device *bdev;
@@ -1109,7 +1108,7 @@ struct class block_class = {
1109 .name = "block", 1108 .name = "block",
1110}; 1109};
1111 1110
1112static char *block_devnode(struct device *dev, mode_t *mode) 1111static char *block_devnode(struct device *dev, umode_t *mode)
1113{ 1112{
1114 struct gendisk *disk = dev_to_disk(dev); 1113 struct gendisk *disk = dev_to_disk(dev);
1115 1114
diff --git a/block/ioctl.c b/block/ioctl.c
index d510c2a4eff8..4828fa349813 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -5,7 +5,7 @@
5#include <linux/blkpg.h> 5#include <linux/blkpg.h>
6#include <linux/hdreg.h> 6#include <linux/hdreg.h>
7#include <linux/backing-dev.h> 7#include <linux/backing-dev.h>
8#include <linux/buffer_head.h> 8#include <linux/fs.h>
9#include <linux/blktrace_api.h> 9#include <linux/blktrace_api.h>
10#include <asm/uaccess.h> 10#include <asm/uaccess.h>
11 11
diff --git a/block/partition-generic.c b/block/partition-generic.c
new file mode 100644
index 000000000000..d06ec1c829c2
--- /dev/null
+++ b/block/partition-generic.c
@@ -0,0 +1,537 @@
1/*
2 * Code extracted from drivers/block/genhd.c
3 * Copyright (C) 1991-1998 Linus Torvalds
4 * Re-organised Feb 1998 Russell King
5 *
6 * We now have independent partition support from the
7 * block drivers, which allows all the partition code to
8 * be grouped in one location, and it to be mostly self
9 * contained.
10 */
11
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/fs.h>
15#include <linux/slab.h>
16#include <linux/kmod.h>
17#include <linux/ctype.h>
18#include <linux/genhd.h>
19#include <linux/blktrace_api.h>
20
21#include "partitions/check.h"
22
23#ifdef CONFIG_BLK_DEV_MD
24extern void md_autodetect_dev(dev_t dev);
25#endif
26
27/*
28 * disk_name() is used by partition check code and the genhd driver.
29 * It formats the devicename of the indicated disk into
30 * the supplied buffer (of size at least 32), and returns
31 * a pointer to that same buffer (for convenience).
32 */
33
34char *disk_name(struct gendisk *hd, int partno, char *buf)
35{
36 if (!partno)
37 snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
38 else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
39 snprintf(buf, BDEVNAME_SIZE, "%sp%d", hd->disk_name, partno);
40 else
41 snprintf(buf, BDEVNAME_SIZE, "%s%d", hd->disk_name, partno);
42
43 return buf;
44}
45
46const char *bdevname(struct block_device *bdev, char *buf)