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
821cc307
Commit
821cc307
authored
Sep 25, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncpfs: use list_for_each_entry() for d_subdirs walk
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5e6123f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
17 deletions
+3
-17
fs/ncpfs/dir.c
fs/ncpfs/dir.c
+1
-5
fs/ncpfs/ncplib_kernel.h
fs/ncpfs/ncplib_kernel.h
+2
-12
No files found.
fs/ncpfs/dir.c
View file @
821cc307
...
...
@@ -388,7 +388,6 @@ static struct dentry *
ncp_dget_fpos
(
struct
dentry
*
dentry
,
struct
dentry
*
parent
,
unsigned
long
fpos
)
{
struct
dentry
*
dent
=
dentry
;
struct
list_head
*
next
;
if
(
d_validate
(
dent
,
parent
))
{
if
(
dent
->
d_name
.
len
<=
NCP_MAXPATHLEN
&&
...
...
@@ -404,9 +403,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
/* If a pointer is invalid, we search the dentry. */
spin_lock
(
&
parent
->
d_lock
);
next
=
parent
->
d_subdirs
.
next
;
while
(
next
!=
&
parent
->
d_subdirs
)
{
dent
=
list_entry
(
next
,
struct
dentry
,
d_u
.
d_child
);
list_for_each_entry
(
dent
,
&
parent
->
d_subdirs
,
d_u
.
d_child
)
{
if
((
unsigned
long
)
dent
->
d_fsdata
==
fpos
)
{
if
(
dent
->
d_inode
)
dget
(
dent
);
...
...
@@ -415,7 +412,6 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
spin_unlock
(
&
parent
->
d_lock
);
goto
out
;
}
next
=
next
->
next
;
}
spin_unlock
(
&
parent
->
d_lock
);
return
NULL
;
...
...
fs/ncpfs/ncplib_kernel.h
View file @
821cc307
...
...
@@ -188,20 +188,14 @@ static inline void
ncp_renew_dentries
(
struct
dentry
*
parent
)
{
struct
ncp_server
*
server
=
NCP_SERVER
(
parent
->
d_inode
);
struct
list_head
*
next
;
struct
dentry
*
dentry
;
spin_lock
(
&
parent
->
d_lock
);
next
=
parent
->
d_subdirs
.
next
;
while
(
next
!=
&
parent
->
d_subdirs
)
{
dentry
=
list_entry
(
next
,
struct
dentry
,
d_u
.
d_child
);
list_for_each_entry
(
dentry
,
&
parent
->
d_subdirs
,
d_u
.
d_child
)
{
if
(
dentry
->
d_fsdata
==
NULL
)
ncp_age_dentry
(
server
,
dentry
);
else
ncp_new_dentry
(
dentry
);
next
=
next
->
next
;
}
spin_unlock
(
&
parent
->
d_lock
);
}
...
...
@@ -210,16 +204,12 @@ static inline void
ncp_invalidate_dircache_entries
(
struct
dentry
*
parent
)
{
struct
ncp_server
*
server
=
NCP_SERVER
(
parent
->
d_inode
);
struct
list_head
*
next
;
struct
dentry
*
dentry
;
spin_lock
(
&
parent
->
d_lock
);
next
=
parent
->
d_subdirs
.
next
;
while
(
next
!=
&
parent
->
d_subdirs
)
{
dentry
=
list_entry
(
next
,
struct
dentry
,
d_u
.
d_child
);
list_for_each_entry
(
dentry
,
&
parent
->
d_subdirs
,
d_u
.
d_child
)
{
dentry
->
d_fsdata
=
NULL
;
ncp_age_dentry
(
server
,
dentry
);
next
=
next
->
next
;
}
spin_unlock
(
&
parent
->
d_lock
);
}
...
...
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