aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-07 01:20:27 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:10 -0400
commit60545d0d4610b02e55f65d141c95b18ccf855b6e (patch)
tree252111eed41e5f54a7bd13b054420f750cb5e069 /fs/dcache.c
parentf9652e10c12b43d9bb957269745cf2fa5682fa92 (diff)
[O_TMPFILE] it's still short a few helpers, but infrastructure should be OK now...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index f09b9085f7d8..b7f049c31526 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2968,6 +2968,22 @@ rename_retry:
2968 goto again; 2968 goto again;
2969} 2969}
2970 2970
2971void d_tmpfile(struct dentry *dentry, struct inode *inode)
2972{
2973 inode_dec_link_count(inode);
2974 BUG_ON(dentry->d_name.name != dentry->d_iname ||
2975 !hlist_unhashed(&dentry->d_alias) ||
2976 !d_unlinked(dentry));
2977 spin_lock(&dentry->d_parent->d_lock);
2978 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
2979 dentry->d_name.len = sprintf(dentry->d_iname, "#%llu",
2980 (unsigned long long)inode->i_ino);
2981 spin_unlock(&dentry->d_lock);
2982 spin_unlock(&dentry->d_parent->d_lock);
2983 d_instantiate(dentry, inode);
2984}
2985EXPORT_SYMBOL(d_tmpfile);
2986
2971/** 2987/**
2972 * find_inode_number - check for dentry with name 2988 * find_inode_number - check for dentry with name
2973 * @dir: directory to check 2989 * @dir: directory to check