Skip to content

Commit 51ceeb1

Browse files
Bill O'Donnellbrauner
authored andcommitted
efs: fix the efs new mount api implementation
Commit 39a6c66 (efs: convert efs to use the new mount api) did not include anything from v2 and v3 that were also submitted. Fix this by bringing in those changes that were proposed in v2 and v3. Fixes: 39a6c66 efs: convert efs to use the new mount api. Signed-off-by: Bill O'Donnell <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent c1a6b0f commit 51ceeb1

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

fs/efs/super.c

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/vfs.h>
1616
#include <linux/blkdev.h>
1717
#include <linux/fs_context.h>
18-
#include <linux/fs_parser.h>
1918
#include "efs.h"
2019
#include <linux/efs_vh.h>
2120
#include <linux/efs_fs_sb.h>
@@ -49,15 +48,6 @@ static struct pt_types sgi_pt_types[] = {
4948
{0, NULL}
5049
};
5150

52-
enum {
53-
Opt_explicit_open,
54-
};
55-
56-
static const struct fs_parameter_spec efs_param_spec[] = {
57-
fsparam_flag ("explicit-open", Opt_explicit_open),
58-
{}
59-
};
60-
6151
/*
6252
* File system definition and registration.
6353
*/
@@ -67,7 +57,6 @@ static struct file_system_type efs_fs_type = {
6757
.kill_sb = efs_kill_sb,
6858
.fs_flags = FS_REQUIRES_DEV,
6959
.init_fs_context = efs_init_fs_context,
70-
.parameters = efs_param_spec,
7160
};
7261
MODULE_ALIAS_FS("efs");
7362

@@ -265,7 +254,8 @@ static int efs_fill_super(struct super_block *s, struct fs_context *fc)
265254
if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) {
266255
pr_err("device does not support %d byte blocks\n",
267256
EFS_BLOCKSIZE);
268-
return -EINVAL;
257+
return invalf(fc, "device does not support %d byte blocks\n",
258+
EFS_BLOCKSIZE);
269259
}
270260

271261
/* read the vh (volume header) block */
@@ -327,56 +317,29 @@ static int efs_fill_super(struct super_block *s, struct fs_context *fc)
327317
return 0;
328318
}
329319

330-
static void efs_free_fc(struct fs_context *fc)
331-
{
332-
kfree(fc->fs_private);
333-
}
334-
335320
static int efs_get_tree(struct fs_context *fc)
336321
{
337322
return get_tree_bdev(fc, efs_fill_super);
338323
}
339324

340-
static int efs_parse_param(struct fs_context *fc, struct fs_parameter *param)
341-
{
342-
int token;
343-
struct fs_parse_result result;
344-
345-
token = fs_parse(fc, efs_param_spec, param, &result);
346-
if (token < 0)
347-
return token;
348-
return 0;
349-
}
350-
351325
static int efs_reconfigure(struct fs_context *fc)
352326
{
353327
sync_filesystem(fc->root->d_sb);
328+
fc->sb_flags |= SB_RDONLY;
354329

355330
return 0;
356331
}
357332

358-
struct efs_context {
359-
unsigned long s_mount_opts;
360-
};
361-
362333
static const struct fs_context_operations efs_context_opts = {
363-
.parse_param = efs_parse_param,
364334
.get_tree = efs_get_tree,
365335
.reconfigure = efs_reconfigure,
366-
.free = efs_free_fc,
367336
};
368337

369338
/*
370339
* Set up the filesystem mount context.
371340
*/
372341
static int efs_init_fs_context(struct fs_context *fc)
373342
{
374-
struct efs_context *ctx;
375-
376-
ctx = kzalloc(sizeof(struct efs_context), GFP_KERNEL);
377-
if (!ctx)
378-
return -ENOMEM;
379-
fc->fs_private = ctx;
380343
fc->ops = &efs_context_opts;
381344

382345
return 0;

0 commit comments

Comments
 (0)