From 87dc800be2499128efb3a6f059d75dc8e1e6d503 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 16 Sep 2013 10:30:04 -0400 Subject: new helper: kfree_put_link() duplicated to hell and back... Signed-off-by: Al Viro --- fs/libfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fs/libfs.c') diff --git a/fs/libfs.c b/fs/libfs.c index 828622a31d30..8c5018493154 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include /* sync_mapping_buffers */ @@ -992,3 +993,12 @@ int noop_fsync(struct file *file, loff_t start, loff_t end, int datasync) return 0; } EXPORT_SYMBOL(noop_fsync); + +void kfree_put_link(struct dentry *dentry, struct nameidata *nd, + void *cookie) +{ + char *s = nd_get_link(nd); + if (!IS_ERR(s)) + kfree(s); +} +EXPORT_SYMBOL(kfree_put_link); -- cgit v1.2.3-55-g7522