diff options
author | Nick Piggin | 2010-05-27 22:42:19 +1000 |
---|---|---|
committer | Al Viro | 2010-05-27 22:15:47 -0400 |
commit | 3322e79a3860fd0d50e3c1879b2e98ac582c0ff6 (patch) | |
tree | 58ebfb1742c996dd9a40593c33c9ea1ff958efe8 /fs/ramfs | |
parent | 15c6fd9786dfaab43547bf60df6fa63170fb64fc (diff) |
fs: convert simple fs to new truncate
Convert simple filesystems: ramfs, configfs, sysfs, block_dev to new truncate
sequence.
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ramfs')
-rw-r--r-- | fs/ramfs/file-mmu.c | 1 | ||||
-rw-r--r-- | fs/ramfs/file-nommu.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 50020501c5eb..4884ac5ae9be 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c @@ -50,5 +50,6 @@ const struct file_operations ramfs_file_operations = { }; const struct inode_operations ramfs_file_inode_operations = { + .setattr = simple_setattr, .getattr = simple_getattr, }; diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 869f2d80183d..d532c20fc179 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -146,7 +146,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) return ret; } - ret = vmtruncate(inode, newsize); + ret = simple_setsize(inode, newsize); return ret; } @@ -169,7 +169,8 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia) /* pick out size-changing events */ if (ia->ia_valid & ATTR_SIZE) { - loff_t size = i_size_read(inode); + loff_t size = inode->i_size; + if (ia->ia_size != size) { ret = ramfs_nommu_resize(inode, ia->ia_size, size); if (ret < 0 || ia->ia_valid == ATTR_SIZE) @@ -182,7 +183,7 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia) } } - ret = inode_setattr(inode, ia); + generic_setattr(inode, ia); out: ia->ia_valid = old_ia_valid; return ret; |