diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-11 07:57:14 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-07-05 16:17:12 +0200 |
commit | d0d073f12aaf09e856dc779cdf36410e3c8c68ea (patch) | |
tree | 762a131236160f88ff573da91f4058cbe75b112f /fs/cramfs | |
parent | b31478f0ba4dcb4f9cc3e1c3c404c106702b4ccf (diff) | |
download | barebox-d0d073f12aaf09e856dc779cdf36410e3c8c68ea.tar.gz |
fs: Add destroy_inode callbacks to filesystems
Several filesystems rely on the default function which frees
the struct inode * rather than the filesystem specific inode
which the inode is embedded in. This works because the inode
is the first element in the filesystem specific inode. Let's
not depend on this behaviour and for clarity add the destroy_inode
callbacks to all filesystems.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/cramfs')
-rw-r--r-- | fs/cramfs/cramfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 99cbdb920c..3ea6bd437e 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -333,6 +333,15 @@ static struct inode *cramfs_alloc_inode(struct super_block *sb) return &info->i_inode; } +static void cramfs_destroy_inode(struct inode *inode) +{ + struct cramfs_inode_info *info; + + info = to_cramfs_inode_info(inode); + + free(info); +} + static int cramfs_iterate(struct file *file, struct dir_context *ctx) { struct dentry *dentry = file->f_path.dentry; @@ -427,6 +436,7 @@ static const struct inode_operations cramfs_symlink_inode_operations = static const struct super_operations cramfs_ops = { .alloc_inode = cramfs_alloc_inode, + .destroy_inode = cramfs_destroy_inode, }; static int cramfs_probe(struct device_d *dev) |