Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: factor out d_mark_tmpfile()

New helper for bcachefs - bcachefs doesn't want the
inode_dec_link_count() call that d_tmpfile does, it handles i_nlink on
its own atomically with other btree updates

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christian Brauner <brauner@kernel.org>

authored by

Kent Overstreet and committed by
Kent Overstreet
771eb4fe 2b69987b

+11 -2
+10 -2
fs/dcache.c
··· 3246 3246 d_walk(parent, parent, d_genocide_kill); 3247 3247 } 3248 3248 3249 - void d_tmpfile(struct file *file, struct inode *inode) 3249 + void d_mark_tmpfile(struct file *file, struct inode *inode) 3250 3250 { 3251 3251 struct dentry *dentry = file->f_path.dentry; 3252 3252 3253 - inode_dec_link_count(inode); 3254 3253 BUG_ON(dentry->d_name.name != dentry->d_iname || 3255 3254 !hlist_unhashed(&dentry->d_u.d_alias) || 3256 3255 !d_unlinked(dentry)); ··· 3259 3260 (unsigned long long)inode->i_ino); 3260 3261 spin_unlock(&dentry->d_lock); 3261 3262 spin_unlock(&dentry->d_parent->d_lock); 3263 + } 3264 + EXPORT_SYMBOL(d_mark_tmpfile); 3265 + 3266 + void d_tmpfile(struct file *file, struct inode *inode) 3267 + { 3268 + struct dentry *dentry = file->f_path.dentry; 3269 + 3270 + inode_dec_link_count(inode); 3271 + d_mark_tmpfile(file, inode); 3262 3272 d_instantiate(dentry, inode); 3263 3273 } 3264 3274 EXPORT_SYMBOL(d_tmpfile);
+1
include/linux/dcache.h
··· 251 251 /* <clickety>-<click> the ramfs-type tree */ 252 252 extern void d_genocide(struct dentry *); 253 253 254 + extern void d_mark_tmpfile(struct file *, struct inode *); 254 255 extern void d_tmpfile(struct file *, struct inode *); 255 256 256 257 extern struct dentry *d_find_alias(struct inode *);