aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 05:29:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:34 -0400
commitd39aae9ec447dda84d9a2850743a78a535a71c90 (patch)
treee362c3367f093b79482f3034e82b18cd2dc8931a /fs
parent155130a4f7848b1aac439cab6bda1a175507c71c (diff)
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 <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/hfsplus/inode.c12
-rw-r--r--fs/minix/file.c12
-rw-r--r--fs/omfs/file.c12
-rw-r--r--fs/sysv/file.c12
-rw-r--r--fs/udf/file.c12
5 files changed, 60 insertions, 0 deletions
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)
290 return 0; 290 return 0;
291} 291}
292 292
293static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
294{
295 struct inode *inode = dentry->d_inode;
296 int error;
297
298 error = inode_change_ok(inode, attr);
299 if (error)
300 return error;
301 return inode_setattr(inode, attr);
302}
303
293static const struct inode_operations hfsplus_file_inode_operations = { 304static const struct inode_operations hfsplus_file_inode_operations = {
294 .lookup = hfsplus_file_lookup, 305 .lookup = hfsplus_file_lookup,
295 .truncate = hfsplus_file_truncate, 306 .truncate = hfsplus_file_truncate,
307 .setattr = hfsplus_setattr,
296 .setxattr = hfsplus_setxattr, 308 .setxattr = hfsplus_setxattr,
297 .getxattr = hfsplus_getxattr, 309 .getxattr = hfsplus_getxattr,
298 .listxattr = hfsplus_listxattr, 310 .listxattr = hfsplus_listxattr,
diff --git a/fs/minix/file.c b/fs/minix/file.c
index d5320ff23faf..7a45dd1fe2e5 100644
--- a/fs/minix/file.c
+++ b/fs/minix/file.c
@@ -23,7 +23,19 @@ const struct file_operations minix_file_operations = {
23 .splice_read = generic_file_splice_read, 23 .splice_read = generic_file_splice_read,
24}; 24};
25 25
26static int minix_setattr(struct dentry *dentry, struct iattr *attr)
27{
28 struct inode *inode = dentry->d_inode;
29 int error;
30
31 error = inode_change_ok(inode, attr);
32 if (error)
33 return error;
34 return inode_setattr(inode, attr);
35}
36
26const struct inode_operations minix_file_inode_operations = { 37const struct inode_operations minix_file_inode_operations = {
27 .truncate = minix_truncate, 38 .truncate = minix_truncate,
39 .setattr = minix_setattr,
28 .getattr = minix_getattr, 40 .getattr = minix_getattr,
29}; 41};
diff --git a/fs/omfs/file.c b/fs/omfs/file.c
index 810cff346468..78c9f0c1a2f3 100644
--- a/fs/omfs/file.c
+++ b/fs/omfs/file.c
@@ -341,7 +341,19 @@ const struct file_operations omfs_file_operations = {
341 .splice_read = generic_file_splice_read, 341 .splice_read = generic_file_splice_read,
342}; 342};
343 343
344static int omfs_setattr(struct dentry *dentry, struct iattr *attr)
345{
346 struct inode *inode = dentry->d_inode;
347 int error;
348
349 error = inode_change_ok(inode, attr);
350 if (error)
351 return error;
352 return inode_setattr(inode, attr);
353}
354
344const struct inode_operations omfs_file_inops = { 355const struct inode_operations omfs_file_inops = {
356 .setattr = omfs_setattr,
345 .truncate = omfs_truncate 357 .truncate = omfs_truncate
346}; 358};
347 359
diff --git a/fs/sysv/file.c b/fs/sysv/file.c
index 750cc22349bd..94f6319292a1 100644
--- a/fs/sysv/file.c
+++ b/fs/sysv/file.c
@@ -30,7 +30,19 @@ const struct file_operations sysv_file_operations = {
30 .splice_read = generic_file_splice_read, 30 .splice_read = generic_file_splice_read,
31}; 31};
32 32
33static int sysv_setattr(struct dentry *dentry, struct iattr *attr)
34{
35 struct inode *inode = dentry->d_inode;
36 int error;
37
38 error = inode_change_ok(inode, attr);
39 if (error)
40 return error;
41 return inode_setattr(inode, attr);
42}
43
33const struct inode_operations sysv_file_inode_operations = { 44const struct inode_operations sysv_file_inode_operations = {
34 .truncate = sysv_truncate, 45 .truncate = sysv_truncate,
46 .setattr = sysv_setattr,
35 .getattr = sysv_getattr, 47 .getattr = sysv_getattr,
36}; 48};
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 94e06d6bddbd..7376032c89ce 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -228,6 +228,18 @@ const struct file_operations udf_file_operations = {
228 .llseek = generic_file_llseek, 228 .llseek = generic_file_llseek,
229}; 229};
230 230
231static int udf_setattr(struct dentry *dentry, struct iattr *attr)
232{
233 struct inode *inode = dentry->d_inode;
234 int error;
235
236 error = inode_change_ok(inode, attr);
237 if (error)
238 return error;
239 return inode_setattr(inode, attr);
240}
241
231const struct inode_operations udf_file_inode_operations = { 242const struct inode_operations udf_file_inode_operations = {
243 .setattr = udf_setattr,
232 .truncate = udf_truncate, 244 .truncate = udf_truncate,
233}; 245};