diff options
author | npiggin@suse.de <npiggin@suse.de> | 2010-05-26 11:05:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-05-27 22:15:42 -0400 |
commit | 15c6fd9786dfaab43547bf60df6fa63170fb64fc (patch) | |
tree | afd997b3402761e28b6c39f414fbd93c69fdcdce /fs/ocfs2 | |
parent | 7bb46a6734a7e1ad4beaecc11cae7ed3ff81d30f (diff) |
kill spurious reference to vmtruncate
Lots of filesystems calls vmtruncate despite not implementing the old
->truncate method. Switch them to use simple_setsize and add some
comments about the truncate code where it seems fitting.
Signed-off-by: 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/ocfs2')
-rw-r--r-- | fs/ocfs2/file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 1c6220a8e072..6a13ea64c447 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1052,7 +1052,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | /* | 1054 | /* |
1055 | * This will intentionally not wind up calling vmtruncate(), | 1055 | * This will intentionally not wind up calling simple_setsize(), |
1056 | * since all the work for a size change has been done above. | 1056 | * since all the work for a size change has been done above. |
1057 | * Otherwise, we could get into problems with truncate as | 1057 | * Otherwise, we could get into problems with truncate as |
1058 | * ip_alloc_sem is used there to protect against i_size | 1058 | * ip_alloc_sem is used there to protect against i_size |
@@ -2118,9 +2118,13 @@ relock: | |||
2118 | * direct write may have instantiated a few | 2118 | * direct write may have instantiated a few |
2119 | * blocks outside i_size. Trim these off again. | 2119 | * blocks outside i_size. Trim these off again. |
2120 | * Don't need i_size_read because we hold i_mutex. | 2120 | * Don't need i_size_read because we hold i_mutex. |
2121 | * | ||
2122 | * XXX(hch): this looks buggy because ocfs2 did not | ||
2123 | * actually implement ->truncate. Take a look at | ||
2124 | * the new truncate sequence and update this accordingly | ||
2121 | */ | 2125 | */ |
2122 | if (*ppos + count > inode->i_size) | 2126 | if (*ppos + count > inode->i_size) |
2123 | vmtruncate(inode, inode->i_size); | 2127 | simple_setsize(inode, inode->i_size); |
2124 | ret = written; | 2128 | ret = written; |
2125 | goto out_dio; | 2129 | goto out_dio; |
2126 | } | 2130 | } |