From d39aae9ec447dda84d9a2850743a78a535a71c90 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 4 Jun 2010 11:29:59 +0200 Subject: 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 Signed-off-by: Al Viro --- fs/hfsplus/inode.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'fs/hfsplus/inode.c') diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 88bf1b562641..d6ebe53fbdbf 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -290,9 +290,21 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) return 0; } +static int hfsplus_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); +} + static const struct inode_operations hfsplus_file_inode_operations = { .lookup = hfsplus_file_lookup, .truncate = hfsplus_file_truncate, + .setattr = hfsplus_setattr, .setxattr = hfsplus_setxattr, .getxattr = hfsplus_getxattr, .listxattr = hfsplus_listxattr, -- cgit v1.2.3