mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
NFS: Reduce stack footprint of nfs_setattr()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
0ab64e0e14
commit
987f8dfc98
1 changed files with 10 additions and 4 deletions
|
@ -393,8 +393,8 @@ int
|
||||||
nfs_setattr(struct dentry *dentry, struct iattr *attr)
|
nfs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||||
{
|
{
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
struct nfs_fattr fattr;
|
struct nfs_fattr *fattr;
|
||||||
int error;
|
int error = -ENOMEM;
|
||||||
|
|
||||||
nfs_inc_stats(inode, NFSIOS_VFSSETATTR);
|
nfs_inc_stats(inode, NFSIOS_VFSSETATTR);
|
||||||
|
|
||||||
|
@ -417,14 +417,20 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||||
filemap_write_and_wait(inode->i_mapping);
|
filemap_write_and_wait(inode->i_mapping);
|
||||||
nfs_wb_all(inode);
|
nfs_wb_all(inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fattr = nfs_alloc_fattr();
|
||||||
|
if (fattr == NULL)
|
||||||
|
goto out;
|
||||||
/*
|
/*
|
||||||
* Return any delegations if we're going to change ACLs
|
* Return any delegations if we're going to change ACLs
|
||||||
*/
|
*/
|
||||||
if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
|
if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
|
||||||
nfs_inode_return_delegation(inode);
|
nfs_inode_return_delegation(inode);
|
||||||
error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr);
|
error = NFS_PROTO(inode)->setattr(dentry, fattr, attr);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
nfs_refresh_inode(inode, &fattr);
|
nfs_refresh_inode(inode, fattr);
|
||||||
|
nfs_free_fattr(fattr);
|
||||||
|
out:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue