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
aa49b4cf
Commit
aa49b4cf
authored
Apr 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Reduce stack footprint of nfs_readdir()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
011fff72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
fs/nfs/dir.c
fs/nfs/dir.c
+10
-7
fs/nfs/nfs3proc.c
fs/nfs/nfs3proc.c
+8
-5
No files found.
fs/nfs/dir.c
View file @
aa49b4cf
...
...
@@ -530,9 +530,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
nfs_readdir_descriptor_t
my_desc
,
*
desc
=
&
my_desc
;
struct
nfs_entry
my_entry
;
struct
nfs_fh
fh
;
struct
nfs_fattr
fattr
;
long
res
;
int
res
=
-
ENOMEM
;
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) starting at cookie %llu
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
...
...
@@ -554,9 +552,11 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
my_entry
.
cookie
=
my_entry
.
prev_cookie
=
0
;
my_entry
.
eof
=
0
;
my_entry
.
fh
=
&
fh
;
my_entry
.
fattr
=
&
fattr
;
nfs_fattr_init
(
&
fattr
);
my_entry
.
fh
=
nfs_alloc_fhandle
();
my_entry
.
fattr
=
nfs_alloc_fattr
();
if
(
my_entry
.
fh
==
NULL
||
my_entry
.
fattr
==
NULL
)
goto
out_alloc_failed
;
desc
->
entry
=
&
my_entry
;
nfs_block_sillyrename
(
dentry
);
...
...
@@ -598,7 +598,10 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
nfs_unblock_sillyrename
(
dentry
);
if
(
res
>
0
)
res
=
0
;
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) returns %ld
\n
"
,
out_alloc_failed:
nfs_free_fattr
(
my_entry
.
fattr
);
nfs_free_fhandle
(
my_entry
.
fh
);
dfprintk
(
FILE
,
"NFS: readdir(%s/%s) returns %d
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
res
);
return
res
;
...
...
fs/nfs/nfs3proc.c
View file @
aa49b4cf
...
...
@@ -597,7 +597,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
u64
cookie
,
struct
page
*
page
,
unsigned
int
count
,
int
plus
)
{
struct
inode
*
dir
=
dentry
->
d_inode
;
struct
nfs_fattr
dir_attr
;
__be32
*
verf
=
NFS_COOKIEVERF
(
dir
);
struct
nfs3_readdirargs
arg
=
{
.
fh
=
NFS_FH
(
dir
),
...
...
@@ -608,7 +607,6 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
.
pages
=
&
page
};
struct
nfs3_readdirres
res
=
{
.
dir_attr
=
&
dir_attr
,
.
verf
=
verf
,
.
plus
=
plus
};
...
...
@@ -618,7 +616,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
.
rpc_resp
=
&
res
,
.
rpc_cred
=
cred
};
int
status
;
int
status
=
-
ENOMEM
;
if
(
plus
)
msg
.
rpc_proc
=
&
nfs3_procedures
[
NFS3PROC_READDIRPLUS
];
...
...
@@ -626,12 +624,17 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
dprintk
(
"NFS call readdir%s %d
\n
"
,
plus
?
"plus"
:
""
,
(
unsigned
int
)
cookie
);
nfs_fattr_init
(
&
dir_attr
);
res
.
dir_attr
=
nfs_alloc_fattr
();
if
(
res
.
dir_attr
==
NULL
)
goto
out
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
nfs_invalidate_atime
(
dir
);
nfs_refresh_inode
(
dir
,
res
.
dir_attr
);
nfs_refresh_inode
(
dir
,
&
dir_attr
);
nfs_free_fattr
(
res
.
dir_attr
);
out:
dprintk
(
"NFS reply readdir: %d
\n
"
,
status
);
return
status
;
}
...
...
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