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
nexedi
linux
Commits
1c5fedbb
Commit
1c5fedbb
authored
May 13, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncp_lookup(): use d_splice_alias()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
293542d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
drivers/staging/ncpfs/dir.c
drivers/staging/ncpfs/dir.c
+15
-27
No files found.
drivers/staging/ncpfs/dir.c
View file @
1c5fedbb
...
...
@@ -823,12 +823,11 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
struct
ncp_server
*
server
=
NCP_SERVER
(
dir
);
struct
inode
*
inode
=
NULL
;
struct
ncp_entry_info
finfo
;
int
error
,
res
,
len
;
int
res
,
len
;
__u8
__name
[
NCP_MAXPATHLEN
+
1
];
error
=
-
EIO
;
if
(
!
ncp_conn_valid
(
server
))
goto
finished
;
return
ERR_PTR
(
-
EIO
)
;
ncp_vdbg
(
"server lookup for %pd2
\n
"
,
dentry
);
...
...
@@ -847,31 +846,20 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
res
=
ncp_obtain_info
(
server
,
dir
,
__name
,
&
(
finfo
.
i
));
}
ncp_vdbg
(
"looked for %pd2, res=%d
\n
"
,
dentry
,
res
);
/*
* If we didn't find an entry, make a negative dentry.
*/
if
(
res
)
goto
add_entry
;
/*
* Create an inode for the entry.
*/
finfo
.
opened
=
0
;
finfo
.
ino
=
iunique
(
dir
->
i_sb
,
2
);
finfo
.
volume
=
finfo
.
i
.
volNumber
;
error
=
-
EACCES
;
inode
=
ncp_iget
(
dir
->
i_sb
,
&
finfo
);
if
(
inode
)
{
ncp_new_dentry
(
dentry
);
add_entry:
d_add
(
dentry
,
inode
);
error
=
0
;
if
(
!
res
)
{
/*
* Entry found; create an inode for it.
*/
finfo
.
opened
=
0
;
finfo
.
ino
=
iunique
(
dir
->
i_sb
,
2
);
finfo
.
volume
=
finfo
.
i
.
volNumber
;
inode
=
ncp_iget
(
dir
->
i_sb
,
&
finfo
);
if
(
unlikely
(
!
inode
))
inode
=
ERR_PTR
(
-
EACCES
);
else
ncp_new_dentry
(
dentry
);
}
finished:
ncp_vdbg
(
"result=%d
\n
"
,
error
);
return
ERR_PTR
(
error
);
return
d_splice_alias
(
inode
,
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