]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
new helper: simple_done_creating()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 19 Sep 2025 21:46:01 +0000 (17:46 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Nov 2025 06:35:01 +0000 (01:35 -0500)
should be paired with simple_start_creating() - unlocks parent and
drops dentry reference.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/libfs.c
include/linux/fs.h

index d029aff41f666a13759f9576fabdf967dffff832..a033f35493d0c0906e404d265251acddb1e61404 100644 (file)
@@ -2326,3 +2326,11 @@ struct dentry *simple_start_creating(struct dentry *parent, const char *name)
        return dentry;
 }
 EXPORT_SYMBOL(simple_start_creating);
+
+/* parent must have been held exclusive since simple_start_creating() */
+void simple_done_creating(struct dentry *child)
+{
+       inode_unlock(child->d_parent->d_inode);
+       dput(child);
+}
+EXPORT_SYMBOL(simple_done_creating);
index 28bd4e8d38925ca883688710c3babc3feb8fa614..f5037c556f6171c3e441c1b07c74a63ce2d7fb11 100644 (file)
@@ -3662,6 +3662,7 @@ extern int simple_fill_super(struct super_block *, unsigned long,
 extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
 extern void simple_release_fs(struct vfsmount **mount, int *count);
 struct dentry *simple_start_creating(struct dentry *, const char *);
+void simple_done_creating(struct dentry *);
 
 extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
                        loff_t *ppos, const void *from, size_t available);