fuse: use d_materialise_unique()
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 5 Sep 2013 09:44:42 +0000 (11:44 +0200)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Tue, 9 Jun 2015 09:31:00 +0000 (11:31 +0200)
commit79f88d525d1bbe57f880b9385058e51adab30046
treeb55ded1974cb7907c7f9301e2e1897015955fa99
parent02e9abde6bcc8fe65705900fb9d6937095203094
fuse: use d_materialise_unique()

Use d_materialise_unique() instead of d_splice_alias().  This allows dentry
subtrees to be moved to a new place if there moved, even if something is
referencing a dentry in the subtree (open fd, cwd, etc..).

This will also allow us to drop a subtree if it is found to be replaced by
something else.  In this case the disconnected subtree can later be
reconnected to its new location.

d_materialise_unique() ensures that a directory entry only ever has one
alias.  We keep fc->inst_mutex around the calls for d_materialise_unique()
on directories to prevent a race with mkdir "stealing" the inode.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/dir.c