Commit dcfd9b21 authored by Fabian Frederick's avatar Fabian Frederick Committed by Luis de Bethencourt

befs: make export work with cold dcache

based on commit b3b42c0d
("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: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
parent a351e9b9
...@@ -58,6 +58,7 @@ static struct dentry *befs_fh_to_dentry(struct super_block *sb, ...@@ -58,6 +58,7 @@ static struct dentry *befs_fh_to_dentry(struct super_block *sb,
struct fid *fid, int fh_len, int fh_type); struct fid *fid, int fh_len, int fh_type);
static struct dentry *befs_fh_to_parent(struct super_block *sb, static struct dentry *befs_fh_to_parent(struct super_block *sb,
struct fid *fid, int fh_len, int fh_type); struct fid *fid, int fh_len, int fh_type);
static struct dentry *befs_get_parent(struct dentry *child);
static const struct super_operations befs_sops = { static const struct super_operations befs_sops = {
.alloc_inode = befs_alloc_inode, /* allocate a new inode */ .alloc_inode = befs_alloc_inode, /* allocate a new inode */
...@@ -93,6 +94,7 @@ static const struct address_space_operations befs_symlink_aops = { ...@@ -93,6 +94,7 @@ static const struct address_space_operations befs_symlink_aops = {
static const struct export_operations befs_export_operations = { static const struct export_operations befs_export_operations = {
.fh_to_dentry = befs_fh_to_dentry, .fh_to_dentry = befs_fh_to_dentry,
.fh_to_parent = befs_fh_to_parent, .fh_to_parent = befs_fh_to_parent,
.get_parent = befs_get_parent,
}; };
/* /*
...@@ -667,6 +669,19 @@ static struct dentry *befs_fh_to_parent(struct super_block *sb, ...@@ -667,6 +669,19 @@ static struct dentry *befs_fh_to_parent(struct super_block *sb,
befs_nfs_get_inode); befs_nfs_get_inode);
} }
static struct dentry *befs_get_parent(struct dentry *child)
{
struct inode *parent;
struct befs_inode_info *befs_ino = BEFS_I(d_inode(child));
parent = befs_iget(child->d_sb,
(unsigned long)befs_ino->i_parent.start);
if (IS_ERR(parent))
return ERR_CAST(parent);
return d_obtain_alias(parent);
}
enum { enum {
Opt_uid, Opt_gid, Opt_charset, Opt_debug, Opt_err, Opt_uid, Opt_gid, Opt_charset, Opt_debug, Opt_err,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment