Skip to content

Commit dcfd9b2

Browse files
Fabian Frederickluisbg
authored andcommitted
befs: make export work with cold dcache
based on commit b3b42c0 ("fs/affs: make export work with cold dcache") This adds get_parent function so that nfs client can still work after cache drop (Tested on NFS v4 with echo 3 > /proc/sys/vm/drop_caches) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
1 parent a351e9b commit dcfd9b2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎fs/befs/linuxvfs.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static struct dentry *befs_fh_to_dentry(struct super_block *sb,
5858
struct fid *fid, int fh_len, int fh_type);
5959
static struct dentry *befs_fh_to_parent(struct super_block *sb,
6060
struct fid *fid, int fh_len, int fh_type);
61+
static struct dentry *befs_get_parent(struct dentry *child);
6162

6263
static const struct super_operations befs_sops = {
6364
.alloc_inode = befs_alloc_inode, /* allocate a new inode */
@@ -93,6 +94,7 @@ static const struct address_space_operations befs_symlink_aops = {
9394
static const struct export_operations befs_export_operations = {
9495
.fh_to_dentry = befs_fh_to_dentry,
9596
.fh_to_parent = befs_fh_to_parent,
97+
.get_parent = befs_get_parent,
9698
};
9799

98100
/*
@@ -667,6 +669,19 @@ static struct dentry *befs_fh_to_parent(struct super_block *sb,
667669
befs_nfs_get_inode);
668670
}
669671

672+
static struct dentry *befs_get_parent(struct dentry *child)
673+
{
674+
struct inode *parent;
675+
struct befs_inode_info *befs_ino = BEFS_I(d_inode(child));
676+
677+
parent = befs_iget(child->d_sb,
678+
(unsigned long)befs_ino->i_parent.start);
679+
if (IS_ERR(parent))
680+
return ERR_CAST(parent);
681+
682+
return d_obtain_alias(parent);
683+
}
684+
670685
enum {
671686
Opt_uid, Opt_gid, Opt_charset, Opt_debug, Opt_err,
672687
};

0 commit comments

Comments
 (0)