Lines Matching refs:fc
26 static int mtd_test_super(struct super_block *sb, struct fs_context *fc) in mtd_test_super() argument
28 struct mtd_info *mtd = fc->sget_key; in mtd_test_super()
30 if (sb->s_mtd == fc->sget_key) { in mtd_test_super()
46 static int mtd_set_super(struct super_block *sb, struct fs_context *fc) in mtd_set_super() argument
48 sb->s_mtd = fc->sget_key; in mtd_set_super()
57 static int mtd_get_sb(struct fs_context *fc, in mtd_get_sb() argument
65 fc->sget_key = mtd; in mtd_get_sb()
66 sb = sget_fc(fc, mtd_test_super, mtd_set_super); in mtd_get_sb()
80 ret = fill_super(sb, fc); in mtd_get_sb()
87 BUG_ON(fc->root); in mtd_get_sb()
88 fc->root = dget(sb->s_root); in mtd_get_sb()
99 static int mtd_get_sb_by_nr(struct fs_context *fc, int mtdnr, in mtd_get_sb_by_nr() argument
107 errorf(fc, "MTDSB: Device #%u doesn't appear to exist\n", mtdnr); in mtd_get_sb_by_nr()
111 return mtd_get_sb(fc, mtd, fill_super); in mtd_get_sb_by_nr()
119 int get_tree_mtd(struct fs_context *fc, in get_tree_mtd() argument
121 struct fs_context *fc)) in get_tree_mtd()
129 if (!fc->source) in get_tree_mtd()
130 return invalf(fc, "No source specified"); in get_tree_mtd()
132 pr_debug("MTDSB: dev_name \"%s\"\n", fc->source); in get_tree_mtd()
139 if (fc->source[0] == 'm' && in get_tree_mtd()
140 fc->source[1] == 't' && in get_tree_mtd()
141 fc->source[2] == 'd') { in get_tree_mtd()
142 if (fc->source[3] == ':') { in get_tree_mtd()
147 fc->source + 4); in get_tree_mtd()
149 mtd = get_mtd_device_nm(fc->source + 4); in get_tree_mtd()
151 return mtd_get_sb(fc, mtd, fill_super); in get_tree_mtd()
153 errorf(fc, "MTD: MTD device with name \"%s\" not found", in get_tree_mtd()
154 fc->source + 4); in get_tree_mtd()
156 } else if (isdigit(fc->source[3])) { in get_tree_mtd()
160 mtdnr = simple_strtoul(fc->source + 3, &endptr, 0); in get_tree_mtd()
164 return mtd_get_sb_by_nr(fc, mtdnr, fill_super); in get_tree_mtd()
173 ret = lookup_bdev(fc->source, &dev); in get_tree_mtd()
175 errorf(fc, "MTD: Couldn't look up '%s': %d", fc->source, ret); in get_tree_mtd()
181 return mtd_get_sb_by_nr(fc, MINOR(dev), fill_super); in get_tree_mtd()
185 if (!(fc->sb_flags & SB_SILENT)) in get_tree_mtd()
186 errorf(fc, "MTD: Attempt to mount non-MTD device \"%s\"", in get_tree_mtd()
187 fc->source); in get_tree_mtd()