17 #include <linux/export.h>
18 #include <linux/ctype.h>
19 #include <linux/slab.h>
25 static int get_sb_mtd_compare(
struct super_block *
sb,
void *_mtd)
29 if (sb->
s_mtd == mtd) {
30 pr_debug(
"MTDSB: Match on device %d (\"%s\")\n",
35 pr_debug(
"MTDSB: No match, device %d (\"%s\"), device %d (\"%s\")\n",
45 static int get_sb_mtd_set(
struct super_block *sb,
void *_mtd)
59 const char *dev_name,
void *
data,
61 int (*fill_super)(
struct super_block *,
void *,
int))
66 sb =
sget(fs_type, get_sb_mtd_compare, get_sb_mtd_set, flags, mtd);
74 pr_debug(
"MTDSB: New superblock for device %d (\"%s\")\n",
77 ret = fill_super(sb, data, flags &
MS_SILENT ? 1 : 0);
89 pr_debug(
"MTDSB: Device %d (\"%s\") is already mounted\n",
103 const char *dev_name,
void *data,
int mtdnr,
104 int (*fill_super)(
struct super_block *,
void *,
int))
110 pr_debug(
"MTDSB: Device #%u doesn't appear to exist\n", mtdnr);
111 return ERR_CAST(mtd);
114 return mount_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super);
121 const char *dev_name,
void *data,
122 int (*fill_super)(
struct super_block *,
void *,
int))
133 pr_debug(
"MTDSB: dev_name \"%s\"\n", dev_name);
139 if (dev_name[0] ==
'm' && dev_name[1] ==
't' && dev_name[2] ==
'd') {
140 if (dev_name[3] ==
':') {
144 pr_debug(
"MTDSB: mtd:%%s, name \"%s\"\n",
149 return mount_mtd_aux(
155 " MTD device with name \"%s\" not found.\n",
158 }
else if (
isdigit(dev_name[3])) {
165 pr_debug(
"MTDSB: mtd%%d, mtdnr %d\n",
167 return mount_mtd_nr(fs_type, flags,
181 pr_debug(
"MTDSB: lookup_bdev() returned %d\n", ret);
184 pr_debug(
"MTDSB: lookup_bdev() returned 0\n");
193 goto not_an_MTD_device;
195 return mount_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super);
202 "MTD: Attempt to mount non-MTD device \"%s\"\n",