add missing setattr methods

For the new truncate sequence every filesystem that wants to truncate on-disk
state needs a seattr method.  Convert the remaining filesystems that implement
the truncate inode operation to have its own setattr method.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Christoph Hellwig 2010-06-04 11:29:59 +02:00 • committed by Al Viro
commit d39aae9ec4
5 changed files with 60 additions and 0 deletions

View file

@ -341,7 +341,19 @@ const struct file_operations omfs_file_operations = {
.splice_read = generic_file_splice_read,
};
static int omfs_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
int error;
error = inode_change_ok(inode, attr);
if (error)
return error;
return inode_setattr(inode, attr);
}
const struct inode_operations omfs_file_inops = {
.setattr = omfs_setattr,
.truncate = omfs_truncate
};