summaryrefslogtreecommitdiff
path: root/fs/configfs/mount.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-09-11 09:00:01 +0200
committerChristoph Hellwig <hch@lst.de>2019-09-11 12:46:14 +0200
commite9c03af21cc7e5723d4f1e90fe45d2cdccb70dc7 (patch)
treea6daaac424c8aa5a827de19a2b21ea9a8636de04 /fs/configfs/mount.c
parent2743c515a1239bb96028bddafef87c0a486f4361 (diff)
configfs: calculate the symlink target only once
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/configfs/mount.c')
-rw-r--r--fs/configfs/mount.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index 55438dd58189..0c6e8cf61953 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -28,9 +28,18 @@ static struct vfsmount *configfs_mount = NULL;
struct kmem_cache *configfs_dir_cachep;
static int configfs_mnt_count = 0;
+
+static void configfs_free_inode(struct inode *inode)
+{
+ if (S_ISLNK(inode->i_mode))
+ kfree(inode->i_link);
+ free_inode_nonrcu(inode);
+}
+
static const struct super_operations configfs_ops = {
.statfs = simple_statfs,
.drop_inode = generic_delete_inode,
+ .free_inode = configfs_free_inode,
};
static struct config_group configfs_root_group = {