diff options
author | Christoph Hellwig <hch@lst.de> | 2010-06-04 05:30:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:37 -0400 |
commit | 1025774ce411f2bd4b059ad7b53f0003569b74fa (patch) | |
tree | 2be221c205cb5579652a6063e8ee27d1c72d1bbd /fs/ncpfs/inode.c | |
parent | eef2380c187890816b73b1a4cb89a09203759469 (diff) |
remove inode_setattr
Replace inode_setattr with opencoded variants of it in all callers. This
moves the remaining call to vmtruncate into the filesystem methods where it
can be replaced with the proper truncate sequence.
In a few cases it was obvious that we would never end up calling vmtruncate
so it was left out in the opencoded variant:
spufs: explicitly checks for ATTR_SIZE earlier
btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
In addition to that ncpfs called inode_setattr with handcrafted iattrs,
which allowed to trim down the opencoded variant.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r-- | fs/ncpfs/inode.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index fa3385154023..b4e8aaae14be 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -924,9 +924,8 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) | |||
924 | tmpattr.ia_valid = ATTR_MODE; | 924 | tmpattr.ia_valid = ATTR_MODE; |
925 | tmpattr.ia_mode = attr->ia_mode; | 925 | tmpattr.ia_mode = attr->ia_mode; |
926 | 926 | ||
927 | result = inode_setattr(inode, &tmpattr); | 927 | setattr_copy(inode, &tmpattr); |
928 | if (result) | 928 | mark_inode_dirty(inode); |
929 | goto out; | ||
930 | } | 929 | } |
931 | } | 930 | } |
932 | #endif | 931 | #endif |
@@ -954,15 +953,12 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) | |||
954 | result = ncp_make_closed(inode); | 953 | result = ncp_make_closed(inode); |
955 | if (result) | 954 | if (result) |
956 | goto out; | 955 | goto out; |
957 | { | 956 | |
958 | struct iattr tmpattr; | 957 | if (attr->ia_size != i_size_read(inode)) { |
959 | 958 | result = vmtruncate(inode, attr->ia_size); | |
960 | tmpattr.ia_valid = ATTR_SIZE; | ||
961 | tmpattr.ia_size = attr->ia_size; | ||
962 | |||
963 | result = inode_setattr(inode, &tmpattr); | ||
964 | if (result) | 959 | if (result) |
965 | goto out; | 960 | goto out; |
961 | mark_inode_dirty(inode); | ||
966 | } | 962 | } |
967 | } | 963 | } |
968 | if ((attr->ia_valid & ATTR_CTIME) != 0) { | 964 | if ((attr->ia_valid & ATTR_CTIME) != 0) { |
@@ -1002,8 +998,12 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) | |||
1002 | NCP_FINFO(inode)->nwattr = info.attributes; | 998 | NCP_FINFO(inode)->nwattr = info.attributes; |
1003 | #endif | 999 | #endif |
1004 | } | 1000 | } |
1005 | if (!result) | 1001 | if (result) |
1006 | result = inode_setattr(inode, attr); | 1002 | goto out; |
1003 | |||
1004 | setattr_copy(inode, attr); | ||
1005 | mark_inode_dirty(inode); | ||
1006 | |||
1007 | out: | 1007 | out: |
1008 | unlock_kernel(); | 1008 | unlock_kernel(); |
1009 | return result; | 1009 | return result; |