Skip to content

Commit a129880

Browse files
author
Al Viro
committed
switch affs
either d_op instance would work for root, actually... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent d463a0c commit a129880

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎fs/affs/affs.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ extern const struct address_space_operations affs_aops;
201201
extern const struct address_space_operations affs_aops_ofs;
202202

203203
extern const struct dentry_operations affs_dentry_operations;
204+
extern const struct dentry_operations affs_intl_dentry_operations;
204205

205206
static inline void
206207
affs_set_blocksize(struct super_block *sb, int size)

‎fs/affs/namei.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const struct dentry_operations affs_dentry_operations = {
3232
.d_compare = affs_compare_dentry,
3333
};
3434

35-
static const struct dentry_operations affs_intl_dentry_operations = {
35+
const struct dentry_operations affs_intl_dentry_operations = {
3636
.d_hash = affs_intl_hash_dentry,
3737
.d_compare = affs_intl_compare_dentry,
3838
};
@@ -240,7 +240,6 @@ affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
240240
if (IS_ERR(inode))
241241
return ERR_CAST(inode);
242242
}
243-
d_set_d_op(dentry, AFFS_SB(sb)->s_flags & SF_INTL ? &affs_intl_dentry_operations : &affs_dentry_operations);
244243
d_add(dentry, inode);
245244
return NULL;
246245
}

‎fs/affs/super.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,16 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
477477
goto out_error_noinode;
478478
}
479479

480+
if (AFFS_SB(sb)->s_flags & SF_INTL)
481+
sb->s_d_op = &affs_intl_dentry_operations;
482+
else
483+
sb->s_d_op = &affs_dentry_operations;
484+
480485
sb->s_root = d_alloc_root(root_inode);
481486
if (!sb->s_root) {
482487
printk(KERN_ERR "AFFS: Get root inode failed\n");
483488
goto out_error;
484489
}
485-
d_set_d_op(sb->s_root, &affs_dentry_operations);
486490

487491
pr_debug("AFFS: s_flags=%lX\n",sb->s_flags);
488492
return 0;

0 commit comments

Comments
 (0)