Skip to content

Commit 384f5c9

Browse files
committed
fat: use new setup() for ->dir_ops too
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
1 parent a6360dd commit 384f5c9

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎fs/fat/fat.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ extern struct inode *fat_build_inode(struct super_block *sb,
319319
struct msdos_dir_entry *de, loff_t i_pos);
320320
extern int fat_sync_inode(struct inode *inode);
321321
extern int fat_fill_super(struct super_block *sb, void *data, int silent,
322-
const struct inode_operations *fs_dir_inode_ops,
323-
int isvfat, void (*setup)(struct super_block *));
322+
int isvfat, void (*setup)(struct super_block *));
324323

325324
extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
326325
struct inode *i2);

‎fs/fat/inode.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,7 @@ static int fat_read_root(struct inode *inode)
12381238
/*
12391239
* Read the super block of an MS-DOS FS.
12401240
*/
1241-
int fat_fill_super(struct super_block *sb, void *data, int silent,
1242-
const struct inode_operations *fs_dir_inode_ops, int isvfat,
1241+
int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
12431242
void (*setup)(struct super_block *))
12441243
{
12451244
struct inode *root_inode = NULL, *fat_inode = NULL;
@@ -1268,7 +1267,6 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
12681267
sb->s_magic = MSDOS_SUPER_MAGIC;
12691268
sb->s_op = &fat_sops;
12701269
sb->s_export_op = &fat_export_ops;
1271-
sbi->dir_ops = fs_dir_inode_ops;
12721270
ratelimit_state_init(&sbi->ratelimit, DEFAULT_RATELIMIT_INTERVAL,
12731271
DEFAULT_RATELIMIT_BURST);
12741272

‎fs/fat/namei_msdos.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@ static const struct inode_operations msdos_dir_inode_operations = {
659659

660660
static void setup(struct super_block *sb)
661661
{
662+
MSDOS_SB(sb)->dir_ops = &msdos_dir_inode_operations;
662663
sb->s_d_op = &msdos_dentry_operations;
663664
sb->s_flags |= MS_NOATIME;
664665
}
665666

666667
static int msdos_fill_super(struct super_block *sb, void *data, int silent)
667668
{
668-
return fat_fill_super(sb, data, silent, &msdos_dir_inode_operations,
669-
0, setup);
669+
return fat_fill_super(sb, data, silent, 0, setup);
670670
}
671671

672672
static struct dentry *msdos_mount(struct file_system_type *fs_type,

‎fs/fat/namei_vfat.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ static const struct inode_operations vfat_dir_inode_operations = {
10651065

10661066
static void setup(struct super_block *sb)
10671067
{
1068+
MSDOS_SB(sb)->dir_ops = &vfat_dir_inode_operations;
10681069
if (MSDOS_SB(sb)->options.name_check != 's')
10691070
sb->s_d_op = &vfat_ci_dentry_ops;
10701071
else
@@ -1073,8 +1074,7 @@ static void setup(struct super_block *sb)
10731074

10741075
static int vfat_fill_super(struct super_block *sb, void *data, int silent)
10751076
{
1076-
return fat_fill_super(sb, data, silent, &vfat_dir_inode_operations,
1077-
1, setup);
1077+
return fat_fill_super(sb, data, silent, 1, setup);
10781078
}
10791079

10801080
static struct dentry *vfat_mount(struct file_system_type *fs_type,

0 commit comments

Comments
 (0)