aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/file.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-12-03 07:39:28 -0500
committerJan Kara <jack@suse.cz>2009-12-14 15:40:04 -0500
commit2c948b3f86e5f0327e2e57858600af6e6f0ae29a (patch)
treea40d5fd7a5757d26fc41829e5620b4685bac44e2 /fs/udf/file.c
parente971b0b9e0dd50d9ceecb67a6a6ab80a80906033 (diff)
udf: Avoid IO in udf_clear_inode
It is not very good to do IO in udf_clear_inode. First, VFS does not really expect inode to become dirty there and thus we have to write it ourselves, second, memory reclaim gets blocked waiting for IO when it does not really expect it, third, the IO pattern (e.g. on umount) resulting from writes in udf_clear_inode is bad and it slows down writing a lot. The reason why UDF needed to do IO in udf_clear_inode is that UDF standard mandates extent length to exactly match inode size. But when we allocate extents to a file or directory, we don't really know what exactly the final file size will be and thus temporarily set it to block boundary and later truncate it to exact length in udf_clear_inode. Now, this is changed to truncate to final file size in udf_release_file for regular files. For directories and symlinks, we do the truncation at the moment when learn what the final file size will be. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r--fs/udf/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index b80cbd78833c..f311d509b6a3 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -196,6 +196,7 @@ static int udf_release_file(struct inode *inode, struct file *filp)
196 mutex_lock(&inode->i_mutex); 196 mutex_lock(&inode->i_mutex);
197 lock_kernel(); 197 lock_kernel();
198 udf_discard_prealloc(inode); 198 udf_discard_prealloc(inode);
199 udf_truncate_tail_extent(inode);
199 unlock_kernel(); 200 unlock_kernel();
200 mutex_unlock(&inode->i_mutex); 201 mutex_unlock(&inode->i_mutex);
201 } 202 }