diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-03 09:08:57 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-03 09:08:57 -0400 |
commit | 76467874b83835129dc454e3a7a8e5d1186101b0 (patch) | |
tree | 162129f0c36c35be4aa323cf00626db0e804c3fc /block | |
parent | 8628de0583504138551a05ad44ca388467f0f552 (diff) | |
parent | 6246b6128bbe34d0752f119cf7c5111c85fe481d (diff) |
Merge branch 'master'
Diffstat (limited to 'block')
-rw-r--r-- | block/Kconfig | 8 | ||||
-rw-r--r-- | block/elevator.c | 2 | ||||
-rw-r--r-- | block/genhd.c | 103 | ||||
-rw-r--r-- | block/ll_rw_blk.c | 2 |
4 files changed, 17 insertions, 98 deletions
diff --git a/block/Kconfig b/block/Kconfig index 5536839886..b6f5f0a796 100644 --- a/block/Kconfig +++ b/block/Kconfig | |||
@@ -27,10 +27,10 @@ config BLK_DEV_IO_TRACE | |||
27 | config LSF | 27 | config LSF |
28 | bool "Support for Large Single Files" | 28 | bool "Support for Large Single Files" |
29 | depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML | 29 | depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML |
30 | default n | ||
31 | help | 30 | help |
32 | When CONFIG_LBD is disabled, say Y here if you want to | 31 | Say Y here if you want to be able to handle very large files (bigger |
33 | handle large file(bigger than 2TB), otherwise say N. | 32 | than 2TB), otherwise say N. |
34 | When CONFIG_LBD is enabled, Y is set automatically. | 33 | |
34 | If unsure, say Y. | ||
35 | 35 | ||
36 | source block/Kconfig.iosched | 36 | source block/Kconfig.iosched |
diff --git a/block/elevator.c b/block/elevator.c index 56c2ed06a9..0d6be03d92 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -145,7 +145,7 @@ static int __init elevator_setup(char *str) | |||
145 | strcpy(chosen_elevator, "anticipatory"); | 145 | strcpy(chosen_elevator, "anticipatory"); |
146 | else | 146 | else |
147 | strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); | 147 | strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); |
148 | return 0; | 148 | return 1; |
149 | } | 149 | } |
150 | 150 | ||
151 | __setup("elevator=", elevator_setup); | 151 | __setup("elevator=", elevator_setup); |
diff --git a/block/genhd.c b/block/genhd.c index db4c60c802..5a8d3bf02f 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -17,8 +17,6 @@ | |||
17 | #include <linux/buffer_head.h> | 17 | #include <linux/buffer_head.h> |
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | 19 | ||
20 | #define MAX_PROBE_HASH 255 /* random */ | ||
21 | |||
22 | static struct subsystem block_subsys; | 20 | static struct subsystem block_subsys; |
23 | 21 | ||
24 | static DEFINE_MUTEX(block_subsys_lock); | 22 | static DEFINE_MUTEX(block_subsys_lock); |
@@ -31,108 +29,29 @@ static struct blk_major_name { | |||
31 | struct blk_major_name *next; | 29 | struct blk_major_name *next; |
32 | int major; | 30 | int major; |
33 | char name[16]; | 31 | char name[16]; |
34 | } *major_names[MAX_PROBE_HASH]; | 32 | } *major_names[BLKDEV_MAJOR_HASH_SIZE]; |
35 | 33 | ||
36 | /* index in the above - for now: assume no multimajor ranges */ | 34 | /* index in the above - for now: assume no multimajor ranges */ |
37 | static inline int major_to_index(int major) | 35 | static inline int major_to_index(int major) |
38 | { | 36 | { |
39 | return major % MAX_PROBE_HASH; | 37 | return major % BLKDEV_MAJOR_HASH_SIZE; |
40 | } | ||
41 | |||
42 | struct blkdev_info { | ||
43 | int index; | ||
44 | struct blk_major_name *bd; | ||
45 | }; | ||
46 | |||
47 | /* | ||
48 | * iterate over a list of blkdev_info structures. allows | ||
49 | * the major_names array to be iterated over from outside this file | ||
50 | * must be called with the block_subsys_lock held | ||
51 | */ | ||
52 | void *get_next_blkdev(void *dev) | ||
53 | { | ||
54 | struct blkdev_info *info; | ||
55 | |||
56 | if (dev == NULL) { | ||
57 | info = kmalloc(sizeof(*info), GFP_KERNEL); | ||
58 | if (!info) | ||
59 | goto out; | ||
60 | info->index=0; | ||
61 | info->bd = major_names[info->index]; | ||
62 | if (info->bd) | ||
63 | goto out; | ||
64 | } else { | ||
65 | info = dev; | ||
66 | } | ||
67 | |||
68 | while (info->index < ARRAY_SIZE(major_names)) { | ||
69 | if (info->bd) | ||
70 | info->bd = info->bd->next; | ||
71 | if (info->bd) | ||
72 | goto out; | ||
73 | /* | ||
74 | * No devices on this chain, move to the next | ||
75 | */ | ||
76 | info->index++; | ||
77 | info->bd = (info->index < ARRAY_SIZE(major_names)) ? | ||
78 | major_names[info->index] : NULL; | ||
79 | if (info->bd) | ||
80 | goto out; | ||
81 | } | ||
82 | |||
83 | out: | ||
84 | return info; | ||
85 | } | ||
86 | |||
87 | void *acquire_blkdev_list(void) | ||
88 | { | ||
89 | mutex_lock(&block_subsys_lock); | ||
90 | return get_next_blkdev(NULL); | ||
91 | } | ||
92 | |||
93 | void release_blkdev_list(void *dev) | ||
94 | { | ||
95 | mutex_unlock(&block_subsys_lock); | ||
96 | kfree(dev); | ||
97 | } | 38 | } |
98 | 39 | ||
40 | #ifdef CONFIG_PROC_FS | ||
99 | 41 | ||
100 | /* | 42 | void blkdev_show(struct seq_file *f, off_t offset) |
101 | * Count the number of records in the blkdev_list. | ||
102 | * must be called with the block_subsys_lock held | ||
103 | */ | ||
104 | int count_blkdev_list(void) | ||
105 | { | 43 | { |
106 | struct blk_major_name *n; | 44 | struct blk_major_name *dp; |
107 | int i, count; | ||
108 | 45 | ||
109 | count = 0; | 46 | if (offset < BLKDEV_MAJOR_HASH_SIZE) { |
110 | 47 | mutex_lock(&block_subsys_lock); | |
111 | for (i = 0; i < ARRAY_SIZE(major_names); i++) { | 48 | for (dp = major_names[offset]; dp; dp = dp->next) |
112 | for (n = major_names[i]; n; n = n->next) | 49 | seq_printf(f, "%3d %s\n", dp->major, dp->name); |
113 | count++; | 50 | mutex_unlock(&block_subsys_lock); |
114 | } | 51 | } |
115 | |||
116 | return count; | ||
117 | } | ||
118 | |||
119 | /* | ||
120 | * extract the major and name values from a blkdev_info struct | ||
121 | * passed in as a void to *dev. Must be called with | ||
122 | * block_subsys_lock held | ||
123 | */ | ||
124 | int get_blkdev_info(void *dev, int *major, char **name) | ||
125 | { | ||
126 | struct blkdev_info *info = dev; | ||
127 | |||
128 | if (info->bd == NULL) | ||
129 | return 1; | ||
130 | |||
131 | *major = info->bd->major; | ||
132 | *name = info->bd->name; | ||
133 | return 0; | ||
134 | } | 52 | } |
135 | 53 | ||
54 | #endif /* CONFIG_PROC_FS */ | ||
136 | 55 | ||
137 | int register_blkdev(unsigned int major, const char *name) | 56 | int register_blkdev(unsigned int major, const char *name) |
138 | { | 57 | { |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 5b26af8597..e112d1a5da 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1740,7 +1740,7 @@ EXPORT_SYMBOL(blk_run_queue); | |||
1740 | 1740 | ||
1741 | /** | 1741 | /** |
1742 | * blk_cleanup_queue: - release a &request_queue_t when it is no longer needed | 1742 | * blk_cleanup_queue: - release a &request_queue_t when it is no longer needed |
1743 | * @q: the request queue to be released | 1743 | * @kobj: the kobj belonging of the request queue to be released |
1744 | * | 1744 | * |
1745 | * Description: | 1745 | * Description: |
1746 | * blk_cleanup_queue is the pair to blk_init_queue() or | 1746 | * blk_cleanup_queue is the pair to blk_init_queue() or |