Commit d39aae9e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 155130a4
...@@ -290,9 +290,21 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) ...@@ -290,9 +290,21 @@ static int hfsplus_file_release(struct inode *inode, struct file *file)
return 0; 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 = { static const struct inode_operations hfsplus_file_inode_operations = {
.lookup = hfsplus_file_lookup, .lookup = hfsplus_file_lookup,
.truncate = hfsplus_file_truncate, .truncate = hfsplus_file_truncate,
.setattr = hfsplus_setattr,
.setxattr = hfsplus_setxattr, .setxattr = hfsplus_setxattr,
.getxattr = hfsplus_getxattr, .getxattr = hfsplus_getxattr,
.listxattr = hfsplus_listxattr, .listxattr = hfsplus_listxattr,
......
...@@ -23,7 +23,19 @@ const struct file_operations minix_file_operations = { ...@@ -23,7 +23,19 @@ const struct file_operations minix_file_operations = {
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
}; };
static int minix_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 minix_file_inode_operations = { const struct inode_operations minix_file_inode_operations = {
.truncate = minix_truncate, .truncate = minix_truncate,
.setattr = minix_setattr,
.getattr = minix_getattr, .getattr = minix_getattr,
}; };
...@@ -341,7 +341,19 @@ const struct file_operations omfs_file_operations = { ...@@ -341,7 +341,19 @@ const struct file_operations omfs_file_operations = {
.splice_read = generic_file_splice_read, .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 = { const struct inode_operations omfs_file_inops = {
.setattr = omfs_setattr,
.truncate = omfs_truncate .truncate = omfs_truncate
}; };
......
...@@ -30,7 +30,19 @@ const struct file_operations sysv_file_operations = { ...@@ -30,7 +30,19 @@ const struct file_operations sysv_file_operations = {
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
}; };
static int sysv_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 sysv_file_inode_operations = { const struct inode_operations sysv_file_inode_operations = {
.truncate = sysv_truncate, .truncate = sysv_truncate,
.setattr = sysv_setattr,
.getattr = sysv_getattr, .getattr = sysv_getattr,
}; };
...@@ -228,6 +228,18 @@ const struct file_operations udf_file_operations = { ...@@ -228,6 +228,18 @@ const struct file_operations udf_file_operations = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
}; };
static int udf_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 udf_file_inode_operations = { const struct inode_operations udf_file_inode_operations = {
.setattr = udf_setattr,
.truncate = udf_truncate, .truncate = udf_truncate,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment