diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-08-11 07:36:51 (GMT) |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-08-11 07:36:51 (GMT) |
commit | 6396fc3b3ff3f6b942992b653a62df11dcef9bea (patch) | |
tree | db3c7cbe833b43c653adc99f70941431c5ff7c4e /fs/hpfs/inode.c | |
parent | 4785879e4d340e24e54f6de2ccfc42728b912808 (diff) | |
parent | 3d30701b58970425e1d45994d6cb82f828924fdd (diff) | |
download | linux-fsl-qoriq-6396fc3b3ff3f6b942992b653a62df11dcef9bea.tar.xz |
Merge branch 'master' into for-next
Conflicts:
fs/exofs/inode.c
Diffstat (limited to 'fs/hpfs/inode.c')
-rw-r--r-- | fs/hpfs/inode.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 1042a9b..56f0da1 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -277,9 +277,15 @@ int hpfs_setattr(struct dentry *dentry, struct iattr *attr) if (error) goto out_unlock; - error = inode_setattr(inode, attr); - if (error) - goto out_unlock; + if ((attr->ia_valid & ATTR_SIZE) && + attr->ia_size != i_size_read(inode)) { + error = vmtruncate(inode, attr->ia_size); + if (error) + return error; + } + + setattr_copy(inode, attr); + mark_inode_dirty(inode); hpfs_write_inode(inode); @@ -296,11 +302,13 @@ void hpfs_write_if_changed(struct inode *inode) hpfs_write_inode(inode); } -void hpfs_delete_inode(struct inode *inode) +void hpfs_evict_inode(struct inode *inode) { truncate_inode_pages(&inode->i_data, 0); - lock_kernel(); - hpfs_remove_fnode(inode->i_sb, inode->i_ino); - unlock_kernel(); - clear_inode(inode); + end_writeback(inode); + if (!inode->i_nlink) { + lock_kernel(); + hpfs_remove_fnode(inode->i_sb, inode->i_ino); + unlock_kernel(); + } } |