summaryrefslogtreecommitdiff
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-03-08 20:44:17 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2016-03-14 07:17:20 +0300
commit668d0cd56ef7bc71be6dd8c081007221e09d9a86 (patch)
treee4e61bdd16fde1ad932861a23978601c2530f32a /include/linux/dcache.h
parente12a4e8a04a9ef84ba645379c56abad1a0ca9dbd (diff)
downloadlinux-668d0cd56ef7bc71be6dd8c081007221e09d9a86.tar.xz
replace d_add_unique() with saner primitive
new primitive: d_exact_alias(dentry, inode). If there is an unhashed dentry with the same name/parent and given inode, rehash, grab and return it. Otherwise, return NULL. The only caller of d_add_unique() switched to d_exact_alias() + d_splice_alias(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index c4b5f4b3f8f8..bda4ec53886b 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -246,6 +246,7 @@ extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
+extern struct dentry * d_exact_alias(struct dentry *, struct inode *);
extern struct dentry *d_find_any_alias(struct inode *inode);
extern struct dentry * d_obtain_alias(struct inode *);
extern struct dentry * d_obtain_root(struct inode *);
@@ -288,23 +289,6 @@ static inline void d_add(struct dentry *entry, struct inode *inode)
d_rehash(entry);
}
-/**
- * d_add_unique - add dentry to hash queues without aliasing
- * @entry: dentry to add
- * @inode: The inode to attach to this dentry
- *
- * This adds the entry to the hash queues and initializes @inode.
- * The entry was actually filled in earlier during d_alloc().
- */
-static inline struct dentry *d_add_unique(struct dentry *entry, struct inode *inode)
-{
- struct dentry *res;
-
- res = d_instantiate_unique(entry, inode);
- d_rehash(res != NULL ? res : entry);
- return res;
-}
-
extern void dentry_update_name_case(struct dentry *, struct qstr *);
/* used for rename() and baskets */