mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
block: remove unrelated header files and export symbol
Fix up the following items: - remove unrelated header files. - export interface function. - modify function cmdline_parts_parse return value, this will make it more friendly for the caller. Signed-off-by: CaiZhiyong <caizhiyong@huawei.com> Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> CC: Brian Norris <computersforpeace@gmail.com> Cc: "Wanglin (Albert)" <albert.wanglin@hisilicon.com> Cc: Artem Bityutskiy <dedekind1@gmail.com> Cc: Karel Zak <kzak@redhat.com> Cc: Shmulik Ladkani <shmulik.ladkani@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6753471c0c
commit
bca266b388
2 changed files with 15 additions and 11 deletions
|
@ -4,8 +4,7 @@
|
||||||
* Written by Cai Zhiyong <caizhiyong@huawei.com>
|
* Written by Cai Zhiyong <caizhiyong@huawei.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/buffer_head.h>
|
#include <linux/export.h>
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/cmdline-parser.h>
|
#include <linux/cmdline-parser.h>
|
||||||
|
|
||||||
static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)
|
static int parse_subpart(struct cmdline_subpart **subpart, char *partdef)
|
||||||
|
@ -159,6 +158,7 @@ void cmdline_parts_free(struct cmdline_parts **parts)
|
||||||
*parts = next_parts;
|
*parts = next_parts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cmdline_parts_free);
|
||||||
|
|
||||||
int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline)
|
int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline)
|
||||||
{
|
{
|
||||||
|
@ -206,6 +206,7 @@ fail:
|
||||||
cmdline_parts_free(parts);
|
cmdline_parts_free(parts);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cmdline_parts_parse);
|
||||||
|
|
||||||
struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
||||||
const char *bdev)
|
const char *bdev)
|
||||||
|
@ -214,17 +215,17 @@ struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
||||||
parts = parts->next_parts;
|
parts = parts->next_parts;
|
||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cmdline_parts_find);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* add_part()
|
* add_part()
|
||||||
* 0 success.
|
* 0 success.
|
||||||
* 1 can not add so many partitions.
|
* 1 can not add so many partitions.
|
||||||
*/
|
*/
|
||||||
void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
||||||
int slot,
|
int slot,
|
||||||
int (*add_part)(int, struct cmdline_subpart *, void *),
|
int (*add_part)(int, struct cmdline_subpart *, void *),
|
||||||
void *param)
|
void *param)
|
||||||
|
|
||||||
{
|
{
|
||||||
sector_t from = 0;
|
sector_t from = 0;
|
||||||
struct cmdline_subpart *subpart;
|
struct cmdline_subpart *subpart;
|
||||||
|
@ -247,4 +248,7 @@ void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
||||||
if (add_part(slot, subpart, param))
|
if (add_part(slot, subpart, param))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return slot;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cmdline_parts_set);
|
||||||
|
|
|
@ -37,9 +37,9 @@ int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
|
||||||
struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
||||||
const char *bdev);
|
const char *bdev);
|
||||||
|
|
||||||
void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
||||||
int slot,
|
int slot,
|
||||||
int (*add_part)(int, struct cmdline_subpart *, void *),
|
int (*add_part)(int, struct cmdline_subpart *, void *),
|
||||||
void *param);
|
void *param);
|
||||||
|
|
||||||
#endif /* CMDLINEPARSEH */
|
#endif /* CMDLINEPARSEH */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue