aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/cmdline-parser.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/block/cmdline-parser.c b/block/cmdline-parser.c
index cc2637f8674e..9dbc67e42a99 100644
--- a/block/cmdline-parser.c
+++ b/block/cmdline-parser.c
@@ -4,8 +4,7 @@
4 * Written by Cai Zhiyong <caizhiyong@huawei.com> 4 * Written by Cai Zhiyong <caizhiyong@huawei.com>
5 * 5 *
6 */ 6 */
7#include <linux/buffer_head.h> 7#include <linux/export.h>
8#include <linux/module.h>
9#include <linux/cmdline-parser.h> 8#include <linux/cmdline-parser.h>
10 9
11static int parse_subpart(struct cmdline_subpart **subpart, char *partdef) 10static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)
@@ -159,6 +158,7 @@ void cmdline_parts_free(struct cmdline_parts **parts)
159 *parts = next_parts; 158 *parts = next_parts;
160 } 159 }
161} 160}
161EXPORT_SYMBOL(cmdline_parts_free);
162 162
163int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline) 163int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline)
164{ 164{
@@ -206,6 +206,7 @@ fail:
206 cmdline_parts_free(parts); 206 cmdline_parts_free(parts);
207 goto done; 207 goto done;
208} 208}
209EXPORT_SYMBOL(cmdline_parts_parse);
209 210
210struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts, 211struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
211 const char *bdev) 212 const char *bdev)
@@ -214,17 +215,17 @@ struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
214 parts = parts->next_parts; 215 parts = parts->next_parts;
215 return parts; 216 return parts;
216} 217}
218EXPORT_SYMBOL(cmdline_parts_find);
217 219
218/* 220/*
219 * add_part() 221 * add_part()
220 * 0 success. 222 * 0 success.
221 * 1 can not add so many partitions. 223 * 1 can not add so many partitions.
222 */ 224 */
223void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size, 225int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
224 int slot, 226 int slot,
225 int (*add_part)(int, struct cmdline_subpart *, void *), 227 int (*add_part)(int, struct cmdline_subpart *, void *),
226 void *param) 228 void *param)
227
228{ 229{
229 sector_t from = 0; 230 sector_t from = 0;
230 struct cmdline_subpart *subpart; 231 struct cmdline_subpart *subpart;
@@ -247,4 +248,7 @@ void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
247 if (add_part(slot, subpart, param)) 248 if (add_part(slot, subpart, param))
248 break; 249 break;
249 } 250 }
251
252 return slot;
250} 253}
254EXPORT_SYMBOL(cmdline_parts_set);