diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:22:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:27 -0400 |
commit | 987f8dfc9862f2c7b59594089793dedeebf0cf5e (patch) | |
tree | 2aa0d3687898edcf26b81770e356a90a3358f9df /fs | |
parent | 0ab64e0e147e45c07e33d344401cf898a6c181c0 (diff) |
NFS: Reduce stack footprint of nfs_setattr()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/inode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e64867eec895..2fe6657a5048 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -393,8 +393,8 @@ int | |||
393 | nfs_setattr(struct dentry *dentry, struct iattr *attr) | 393 | nfs_setattr(struct dentry *dentry, struct iattr *attr) |
394 | { | 394 | { |
395 | struct inode *inode = dentry->d_inode; | 395 | struct inode *inode = dentry->d_inode; |
396 | struct nfs_fattr fattr; | 396 | struct nfs_fattr *fattr; |
397 | int error; | 397 | int error = -ENOMEM; |
398 | 398 | ||
399 | nfs_inc_stats(inode, NFSIOS_VFSSETATTR); | 399 | nfs_inc_stats(inode, NFSIOS_VFSSETATTR); |
400 | 400 | ||
@@ -417,14 +417,20 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
417 | filemap_write_and_wait(inode->i_mapping); | 417 | filemap_write_and_wait(inode->i_mapping); |
418 | nfs_wb_all(inode); | 418 | nfs_wb_all(inode); |
419 | } | 419 | } |
420 | |||
421 | fattr = nfs_alloc_fattr(); | ||
422 | if (fattr == NULL) | ||
423 | goto out; | ||
420 | /* | 424 | /* |
421 | * Return any delegations if we're going to change ACLs | 425 | * Return any delegations if we're going to change ACLs |
422 | */ | 426 | */ |
423 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) | 427 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) |
424 | nfs_inode_return_delegation(inode); | 428 | nfs_inode_return_delegation(inode); |
425 | error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr); | 429 | error = NFS_PROTO(inode)->setattr(dentry, fattr, attr); |
426 | if (error == 0) | 430 | if (error == 0) |
427 | nfs_refresh_inode(inode, &fattr); | 431 | nfs_refresh_inode(inode, fattr); |
432 | nfs_free_fattr(fattr); | ||
433 | out: | ||
428 | return error; | 434 | return error; |
429 | } | 435 | } |
430 | 436 | ||