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
a4d7f168
Commit
a4d7f168
authored
Apr 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Reduce the stack footprint of nfs_follow_mountpoint()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
815409d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
fs/nfs/namespace.c
fs/nfs/namespace.c
+14
-6
No files found.
fs/nfs/namespace.c
View file @
a4d7f168
...
@@ -105,8 +105,8 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
...
@@ -105,8 +105,8 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
struct
vfsmount
*
mnt
;
struct
vfsmount
*
mnt
;
struct
nfs_server
*
server
=
NFS_SERVER
(
dentry
->
d_inode
);
struct
nfs_server
*
server
=
NFS_SERVER
(
dentry
->
d_inode
);
struct
dentry
*
parent
;
struct
dentry
*
parent
;
struct
nfs_fh
fh
;
struct
nfs_fh
*
fh
=
NULL
;
struct
nfs_fattr
fattr
;
struct
nfs_fattr
*
fattr
=
NULL
;
int
err
;
int
err
;
dprintk
(
"--> nfs_follow_mountpoint()
\n
"
);
dprintk
(
"--> nfs_follow_mountpoint()
\n
"
);
...
@@ -115,6 +115,12 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
...
@@ -115,6 +115,12 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
if
(
IS_ROOT
(
dentry
))
if
(
IS_ROOT
(
dentry
))
goto
out_err
;
goto
out_err
;
err
=
-
ENOMEM
;
fh
=
nfs_alloc_fhandle
();
fattr
=
nfs_alloc_fattr
();
if
(
fh
==
NULL
||
fattr
==
NULL
)
goto
out_err
;
dprintk
(
"%s: enter
\n
"
,
__func__
);
dprintk
(
"%s: enter
\n
"
,
__func__
);
dput
(
nd
->
path
.
dentry
);
dput
(
nd
->
path
.
dentry
);
nd
->
path
.
dentry
=
dget
(
dentry
);
nd
->
path
.
dentry
=
dget
(
dentry
);
...
@@ -123,16 +129,16 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
...
@@ -123,16 +129,16 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
parent
=
dget_parent
(
nd
->
path
.
dentry
);
parent
=
dget_parent
(
nd
->
path
.
dentry
);
err
=
server
->
nfs_client
->
rpc_ops
->
lookup
(
parent
->
d_inode
,
err
=
server
->
nfs_client
->
rpc_ops
->
lookup
(
parent
->
d_inode
,
&
nd
->
path
.
dentry
->
d_name
,
&
nd
->
path
.
dentry
->
d_name
,
&
fh
,
&
fattr
);
fh
,
fattr
);
dput
(
parent
);
dput
(
parent
);
if
(
err
!=
0
)
if
(
err
!=
0
)
goto
out_err
;
goto
out_err
;
if
(
fattr
.
valid
&
NFS_ATTR_FATTR_V4_REFERRAL
)
if
(
fattr
->
valid
&
NFS_ATTR_FATTR_V4_REFERRAL
)
mnt
=
nfs_do_refmount
(
nd
->
path
.
mnt
,
nd
->
path
.
dentry
);
mnt
=
nfs_do_refmount
(
nd
->
path
.
mnt
,
nd
->
path
.
dentry
);
else
else
mnt
=
nfs_do_submount
(
nd
->
path
.
mnt
,
nd
->
path
.
dentry
,
&
fh
,
mnt
=
nfs_do_submount
(
nd
->
path
.
mnt
,
nd
->
path
.
dentry
,
fh
,
&
fattr
);
fattr
);
err
=
PTR_ERR
(
mnt
);
err
=
PTR_ERR
(
mnt
);
if
(
IS_ERR
(
mnt
))
if
(
IS_ERR
(
mnt
))
goto
out_err
;
goto
out_err
;
...
@@ -151,6 +157,8 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
...
@@ -151,6 +157,8 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
nd
->
path
.
dentry
=
dget
(
mnt
->
mnt_root
);
nd
->
path
.
dentry
=
dget
(
mnt
->
mnt_root
);
schedule_delayed_work
(
&
nfs_automount_task
,
nfs_mountpoint_expiry_timeout
);
schedule_delayed_work
(
&
nfs_automount_task
,
nfs_mountpoint_expiry_timeout
);
out:
out:
nfs_free_fattr
(
fattr
);
nfs_free_fhandle
(
fh
);
dprintk
(
"%s: done, returned %d
\n
"
,
__func__
,
err
);
dprintk
(
"%s: done, returned %d
\n
"
,
__func__
,
err
);
dprintk
(
"<-- nfs_follow_mountpoint() = %d
\n
"
,
err
);
dprintk
(
"<-- nfs_follow_mountpoint() = %d
\n
"
,
err
);
...
...
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