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/nfs.c | |
parent | b31478f0ba4dcb4f9cc3e1c3c404c106702b4ccf (diff) | |
download | barebox-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/nfs.c')
-rw-r--r-- | fs/nfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1202,6 +1202,13 @@ static struct inode *nfs_alloc_inode(struct super_block *sb) return &node->inode; } +static void nfs_destroy_inode(struct inode *inode) +{ + struct nfs_inode *node = nfsi(inode); + + free(node); +} + static const struct inode_operations nfs_file_inode_operations; static const struct file_operations nfs_dir_operations; static const struct inode_operations nfs_dir_inode_operations; @@ -1273,6 +1280,7 @@ static const struct inode_operations nfs_dir_inode_operations = static const struct super_operations nfs_ops = { .alloc_inode = nfs_alloc_inode, + .destroy_inode = nfs_destroy_inode, }; static char *rootnfsopts; |