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
136f2627
Commit
136f2627
authored
Apr 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Reduce the stack footprint of nfs_link()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
aa49b4cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
fs/nfs/nfs3proc.c
fs/nfs/nfs3proc.c
+12
-10
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+9
-7
No files found.
fs/nfs/nfs3proc.c
View file @
136f2627
...
...
@@ -468,30 +468,32 @@ nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name,
static
int
nfs3_proc_link
(
struct
inode
*
inode
,
struct
inode
*
dir
,
struct
qstr
*
name
)
{
struct
nfs_fattr
dir_attr
,
fattr
;
struct
nfs3_linkargs
arg
=
{
.
fromfh
=
NFS_FH
(
inode
),
.
tofh
=
NFS_FH
(
dir
),
.
toname
=
name
->
name
,
.
tolen
=
name
->
len
};
struct
nfs3_linkres
res
=
{
.
dir_attr
=
&
dir_attr
,
.
fattr
=
&
fattr
};
struct
nfs3_linkres
res
;
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs3_procedures
[
NFS3PROC_LINK
],
.
rpc_argp
=
&
arg
,
.
rpc_resp
=
&
res
,
};
int
status
;
int
status
=
-
ENOMEM
;
dprintk
(
"NFS call link %s
\n
"
,
name
->
name
);
nfs_fattr_init
(
&
dir_attr
);
nfs_fattr_init
(
&
fattr
);
res
.
fattr
=
nfs_alloc_fattr
();
res
.
dir_attr
=
nfs_alloc_fattr
();
if
(
res
.
fattr
==
NULL
||
res
.
dir_attr
==
NULL
)
goto
out
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
inode
),
&
msg
,
0
);
nfs_post_op_update_inode
(
dir
,
&
dir_attr
);
nfs_post_op_update_inode
(
inode
,
&
fattr
);
nfs_post_op_update_inode
(
dir
,
res
.
dir_attr
);
nfs_post_op_update_inode
(
inode
,
res
.
fattr
);
out:
nfs_free_fattr
(
res
.
dir_attr
);
nfs_free_fattr
(
res
.
fattr
);
dprintk
(
"NFS reply link: %d
\n
"
,
status
);
return
status
;
}
...
...
fs/nfs/nfs4proc.c
View file @
136f2627
...
...
@@ -2707,28 +2707,30 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *
.
name
=
name
,
.
bitmask
=
server
->
attr_bitmask
,
};
struct
nfs_fattr
fattr
,
dir_attr
;
struct
nfs4_link_res
res
=
{
.
server
=
server
,
.
fattr
=
&
fattr
,
.
dir_attr
=
&
dir_attr
,
};
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_LINK
],
.
rpc_argp
=
&
arg
,
.
rpc_resp
=
&
res
,
};
int
status
;
int
status
=
-
ENOMEM
;
res
.
fattr
=
nfs_alloc_fattr
();
res
.
dir_attr
=
nfs_alloc_fattr
();
if
(
res
.
fattr
==
NULL
||
res
.
dir_attr
==
NULL
)
goto
out
;
nfs_fattr_init
(
res
.
fattr
);
nfs_fattr_init
(
res
.
dir_attr
);
status
=
nfs4_call_sync
(
server
,
&
msg
,
&
arg
,
&
res
,
1
);
if
(
!
status
)
{
update_changeattr
(
dir
,
&
res
.
cinfo
);
nfs_post_op_update_inode
(
dir
,
res
.
dir_attr
);
nfs_post_op_update_inode
(
inode
,
res
.
fattr
);
}
out:
nfs_free_fattr
(
res
.
dir_attr
);
nfs_free_fattr
(
res
.
fattr
);
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