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
364d015e
Commit
364d015e
authored
Apr 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Reduce the stack footprint of try_location()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
fbca779a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
fs/nfs/nfs4namespace.c
fs/nfs/nfs4namespace.c
+7
-3
No files found.
fs/nfs/nfs4namespace.c
View file @
364d015e
...
@@ -115,6 +115,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
...
@@ -115,6 +115,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
char
*
page
,
char
*
page2
,
char
*
page
,
char
*
page2
,
const
struct
nfs4_fs_location
*
location
)
const
struct
nfs4_fs_location
*
location
)
{
{
const
size_t
addr_bufsize
=
sizeof
(
struct
sockaddr_storage
);
struct
vfsmount
*
mnt
=
ERR_PTR
(
-
ENOENT
);
struct
vfsmount
*
mnt
=
ERR_PTR
(
-
ENOENT
);
char
*
mnt_path
;
char
*
mnt_path
;
unsigned
int
maxbuflen
;
unsigned
int
maxbuflen
;
...
@@ -126,9 +127,12 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
...
@@ -126,9 +127,12 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
mountdata
->
mnt_path
=
mnt_path
;
mountdata
->
mnt_path
=
mnt_path
;
maxbuflen
=
mnt_path
-
1
-
page2
;
maxbuflen
=
mnt_path
-
1
-
page2
;
mountdata
->
addr
=
kmalloc
(
addr_bufsize
,
GFP_KERNEL
);
if
(
mountdata
->
addr
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
for
(
s
=
0
;
s
<
location
->
nservers
;
s
++
)
{
for
(
s
=
0
;
s
<
location
->
nservers
;
s
++
)
{
const
struct
nfs4_string
*
buf
=
&
location
->
servers
[
s
];
const
struct
nfs4_string
*
buf
=
&
location
->
servers
[
s
];
struct
sockaddr_storage
addr
;
if
(
buf
->
len
<=
0
||
buf
->
len
>=
maxbuflen
)
if
(
buf
->
len
<=
0
||
buf
->
len
>=
maxbuflen
)
continue
;
continue
;
...
@@ -137,11 +141,10 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
...
@@ -137,11 +141,10 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
continue
;
continue
;
mountdata
->
addrlen
=
nfs_parse_server_name
(
buf
->
data
,
buf
->
len
,
mountdata
->
addrlen
=
nfs_parse_server_name
(
buf
->
data
,
buf
->
len
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
)
);
mountdata
->
addr
,
addr_bufsize
);
if
(
mountdata
->
addrlen
==
0
)
if
(
mountdata
->
addrlen
==
0
)
continue
;
continue
;
mountdata
->
addr
=
(
struct
sockaddr
*
)
&
addr
;
rpc_set_port
(
mountdata
->
addr
,
NFS_PORT
);
rpc_set_port
(
mountdata
->
addr
,
NFS_PORT
);
memcpy
(
page2
,
buf
->
data
,
buf
->
len
);
memcpy
(
page2
,
buf
->
data
,
buf
->
len
);
...
@@ -156,6 +159,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
...
@@ -156,6 +159,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
if
(
!
IS_ERR
(
mnt
))
if
(
!
IS_ERR
(
mnt
))
break
;
break
;
}
}
kfree
(
mountdata
->
addr
);
return
mnt
;
return
mnt
;
}
}
...
...
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