summaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-11 07:57:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-05 16:17:12 +0200
commitd0d073f12aaf09e856dc779cdf36410e3c8c68ea (patch)
tree762a131236160f88ff573da91f4058cbe75b112f /fs/squashfs
parentb31478f0ba4dcb4f9cc3e1c3c404c106702b4ccf (diff)
downloadbarebox-d0d073f12aaf09e856dc779cdf36410e3c8c68ea.tar.gz
barebox-d0d073f12aaf09e856dc779cdf36410e3c8c68ea.tar.xz
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/squashfs')
-rw-r--r--fs/squashfs/squashfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c
index 38aff6d5b8..69451f7b84 100644
--- a/fs/squashfs/squashfs.c
+++ b/fs/squashfs/squashfs.c
@@ -76,8 +76,16 @@ static struct inode *squashfs_alloc_inode(struct super_block *sb)
return &node->vfs_inode;
}
+static void squashfs_destroy_inode(struct inode *inode)
+{
+ struct squashfs_inode_info *node = squashfs_i(inode);
+
+ free(node);
+}
+
static const struct super_operations squashfs_super_ops = {
- .alloc_inode = squashfs_alloc_inode,
+ .alloc_inode = squashfs_alloc_inode,
+ .destroy_inode = squashfs_destroy_inode,
};
static int squashfs_probe(struct device_d *dev)