Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
41d28bca
Commit
41d28bca
authored
Oct 12, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch d_materialise_unique() users to d_splice_alias()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b5ae6b15
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
19 additions
and
29 deletions
+19
-29
Documentation/filesystems/nfs/Exporting
Documentation/filesystems/nfs/Exporting
+5
-18
Documentation/filesystems/porting
Documentation/filesystems/porting
+4
-0
fs/9p/vfs_inode.c
fs/9p/vfs_inode.c
+1
-1
fs/btrfs/inode.c
fs/btrfs/inode.c
+1
-1
fs/ceph/inode.c
fs/ceph/inode.c
+1
-1
fs/cifs/readdir.c
fs/cifs/readdir.c
+1
-1
fs/fuse/dir.c
fs/fuse/dir.c
+2
-2
fs/kernfs/dir.c
fs/kernfs/dir.c
+1
-1
fs/nfs/dir.c
fs/nfs/dir.c
+2
-2
fs/nfs/getroot.c
fs/nfs/getroot.c
+1
-1
include/linux/dcache.h
include/linux/dcache.h
+0
-1
No files found.
Documentation/filesystems/nfs/Exporting
View file @
41d28bca
...
@@ -72,24 +72,11 @@ c/ Helper routines to allocate anonymous dentries, and to help attach
...
@@ -72,24 +72,11 @@ c/ Helper routines to allocate anonymous dentries, and to help attach
DCACHE_DISCONNECTED) dentry is allocated and attached.
DCACHE_DISCONNECTED) dentry is allocated and attached.
In the case of a directory, care is taken that only one dentry
In the case of a directory, care is taken that only one dentry
can ever be attached.
can ever be attached.
d_splice_alias(inode, dentry) or d_materialise_unique(dentry, inode)
d_splice_alias(inode, dentry) will introduce a new dentry into the tree;
will introduce a new dentry into the tree; either the passed-in
either the passed-in dentry or a preexisting alias for the given inode
dentry or a preexisting alias for the given inode (such as an
(such as an anonymous one created by d_obtain_alias), if appropriate.
anonymous one created by d_obtain_alias), if appropriate. The two
It returns NULL when the passed-in dentry is used, following the calling
functions differ in their handling of directories with preexisting
convention of ->lookup.
aliases:
d_splice_alias will use any existing IS_ROOT dentry, but it will
return -EIO rather than try to move a dentry with a different
parent. This is appropriate for local filesystems, which
should never see such an alias unless the filesystem is
corrupted somehow (for example, if two on-disk directory
entries refer to the same directory.)
d_materialise_unique will attempt to move any dentry. This is
appropriate for distributed filesystems, where finding a
directory other than where we last cached it may be a normal
consequence of concurrent operations on other hosts.
Both functions return NULL when the passed-in dentry is used,
following the calling convention of ->lookup.
Filesystem Issues
Filesystem Issues
...
...
Documentation/filesystems/porting
View file @
41d28bca
...
@@ -463,3 +463,7 @@ in your dentry operations instead.
...
@@ -463,3 +463,7 @@ in your dentry operations instead.
of the in-tree instances did). inode_hash_lock is still held,
of the in-tree instances did). inode_hash_lock is still held,
of course, so they are still serialized wrt removal from inode hash,
of course, so they are still serialized wrt removal from inode hash,
as well as wrt set() callback of iget5_locked().
as well as wrt set() callback of iget5_locked().
--
[mandatory]
d_materialise_unique() is gone; d_splice_alias() does everything you
need now. Remember that they have opposite orders of arguments ;-/
fs/9p/vfs_inode.c
View file @
41d28bca
...
@@ -832,7 +832,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
...
@@ -832,7 +832,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
* moved b under k and client parallely did a lookup for
* moved b under k and client parallely did a lookup for
* k/b.
* k/b.
*/
*/
res
=
d_
materialise_unique
(
dentry
,
inode
);
res
=
d_
splice_alias
(
inode
,
dentry
);
if
(
!
res
)
if
(
!
res
)
v9fs_fid_add
(
dentry
,
fid
);
v9fs_fid_add
(
dentry
,
fid
);
else
if
(
!
IS_ERR
(
res
))
else
if
(
!
IS_ERR
(
res
))
...
...
fs/btrfs/inode.c
View file @
41d28bca
...
@@ -5303,7 +5303,7 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
...
@@ -5303,7 +5303,7 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
return
ERR_CAST
(
inode
);
return
ERR_CAST
(
inode
);
}
}
return
d_
materialise_unique
(
dentry
,
inode
);
return
d_
splice_alias
(
inode
,
dentry
);
}
}
unsigned
char
btrfs_filetype_table
[]
=
{
unsigned
char
btrfs_filetype_table
[]
=
{
...
...
fs/ceph/inode.c
View file @
41d28bca
...
@@ -967,7 +967,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in,
...
@@ -967,7 +967,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in,
/* dn must be unhashed */
/* dn must be unhashed */
if
(
!
d_unhashed
(
dn
))
if
(
!
d_unhashed
(
dn
))
d_drop
(
dn
);
d_drop
(
dn
);
realdn
=
d_
materialise_unique
(
dn
,
i
n
);
realdn
=
d_
splice_alias
(
in
,
d
n
);
if
(
IS_ERR
(
realdn
))
{
if
(
IS_ERR
(
realdn
))
{
pr_err
(
"splice_dentry error %ld %p inode %p ino %llx.%llx
\n
"
,
pr_err
(
"splice_dentry error %ld %p inode %p ino %llx.%llx
\n
"
,
PTR_ERR
(
realdn
),
dn
,
in
,
ceph_vinop
(
in
));
PTR_ERR
(
realdn
),
dn
,
in
,
ceph_vinop
(
in
));
...
...
fs/cifs/readdir.c
View file @
41d28bca
...
@@ -123,7 +123,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
...
@@ -123,7 +123,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
if
(
!
inode
)
if
(
!
inode
)
goto
out
;
goto
out
;
alias
=
d_
materialise_unique
(
dentry
,
inode
);
alias
=
d_
splice_alias
(
inode
,
dentry
);
if
(
alias
&&
!
IS_ERR
(
alias
))
if
(
alias
&&
!
IS_ERR
(
alias
))
dput
(
alias
);
dput
(
alias
);
out:
out:
...
...
fs/fuse/dir.c
View file @
41d28bca
...
@@ -372,7 +372,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
...
@@ -372,7 +372,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
if
(
inode
&&
get_node_id
(
inode
)
==
FUSE_ROOT_ID
)
if
(
inode
&&
get_node_id
(
inode
)
==
FUSE_ROOT_ID
)
goto
out_iput
;
goto
out_iput
;
newent
=
d_
materialise_unique
(
entry
,
inode
);
newent
=
d_
splice_alias
(
inode
,
entry
);
err
=
PTR_ERR
(
newent
);
err
=
PTR_ERR
(
newent
);
if
(
IS_ERR
(
newent
))
if
(
IS_ERR
(
newent
))
goto
out_err
;
goto
out_err
;
...
@@ -1320,7 +1320,7 @@ static int fuse_direntplus_link(struct file *file,
...
@@ -1320,7 +1320,7 @@ static int fuse_direntplus_link(struct file *file,
if
(
!
inode
)
if
(
!
inode
)
goto
out
;
goto
out
;
alias
=
d_
materialise_unique
(
dentry
,
inode
);
alias
=
d_
splice_alias
(
inode
,
dentry
);
err
=
PTR_ERR
(
alias
);
err
=
PTR_ERR
(
alias
);
if
(
IS_ERR
(
alias
))
if
(
IS_ERR
(
alias
))
goto
out
;
goto
out
;
...
...
fs/kernfs/dir.c
View file @
41d28bca
...
@@ -807,7 +807,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
...
@@ -807,7 +807,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
}
}
/* instantiate and hash dentry */
/* instantiate and hash dentry */
ret
=
d_
materialise_unique
(
dentry
,
inode
);
ret
=
d_
splice_alias
(
inode
,
dentry
);
out_unlock:
out_unlock:
mutex_unlock
(
&
kernfs_mutex
);
mutex_unlock
(
&
kernfs_mutex
);
return
ret
;
return
ret
;
...
...
fs/nfs/dir.c
View file @
41d28bca
...
@@ -499,7 +499,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
...
@@ -499,7 +499,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
if
(
IS_ERR
(
inode
))
if
(
IS_ERR
(
inode
))
goto
out
;
goto
out
;
alias
=
d_
materialise_unique
(
dentry
,
inode
);
alias
=
d_
splice_alias
(
inode
,
dentry
);
if
(
IS_ERR
(
alias
))
if
(
IS_ERR
(
alias
))
goto
out
;
goto
out
;
else
if
(
alias
)
{
else
if
(
alias
)
{
...
@@ -1393,7 +1393,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
...
@@ -1393,7 +1393,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
nfs_advise_use_readdirplus
(
dir
);
nfs_advise_use_readdirplus
(
dir
);
no_entry:
no_entry:
res
=
d_
materialise_unique
(
dentry
,
inode
);
res
=
d_
splice_alias
(
inode
,
dentry
);
if
(
res
!=
NULL
)
{
if
(
res
!=
NULL
)
{
if
(
IS_ERR
(
res
))
if
(
IS_ERR
(
res
))
goto
out_unblock_sillyrename
;
goto
out_unblock_sillyrename
;
...
...
fs/nfs/getroot.c
View file @
41d28bca
...
@@ -51,7 +51,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
...
@@ -51,7 +51,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
/*
/*
* Ensure that this dentry is invisible to d_find_alias().
* Ensure that this dentry is invisible to d_find_alias().
* Otherwise, it may be spliced into the tree by
* Otherwise, it may be spliced into the tree by
* d_
materialise_unique
if a parent directory from the same
* d_
splice_alias
if a parent directory from the same
* filesystem gets mounted at a later time.
* filesystem gets mounted at a later time.
* This again causes shrink_dcache_for_umount_subtree() to
* This again causes shrink_dcache_for_umount_subtree() to
* Oops, since the test for IS_ROOT() will fail.
* Oops, since the test for IS_ROOT() will fail.
...
...
include/linux/dcache.h
View file @
41d28bca
...
@@ -230,7 +230,6 @@ extern seqlock_t rename_lock;
...
@@ -230,7 +230,6 @@ extern seqlock_t rename_lock;
*/
*/
extern
void
d_instantiate
(
struct
dentry
*
,
struct
inode
*
);
extern
void
d_instantiate
(
struct
dentry
*
,
struct
inode
*
);
extern
struct
dentry
*
d_instantiate_unique
(
struct
dentry
*
,
struct
inode
*
);
extern
struct
dentry
*
d_instantiate_unique
(
struct
dentry
*
,
struct
inode
*
);
#define d_materialise_unique(d, i) d_splice_alias(i, d)
extern
int
d_instantiate_no_diralias
(
struct
dentry
*
,
struct
inode
*
);
extern
int
d_instantiate_no_diralias
(
struct
dentry
*
,
struct
inode
*
);
extern
void
__d_drop
(
struct
dentry
*
dentry
);
extern
void
__d_drop
(
struct
dentry
*
dentry
);
extern
void
d_drop
(
struct
dentry
*
dentry
);
extern
void
d_drop
(
struct
dentry
*
dentry
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment