diff options
author | Alessio Igor Bogani <abogani@texware.it> | 2010-11-16 12:40:47 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-06 11:03:56 -0500 |
commit | 4d0fb621d35007c19a396f2bb629e5aeaacef2d0 (patch) | |
tree | 92f6e0d3c38c15b0af507bd4b6d3353e34a337a9 /fs/udf/file.c | |
parent | d1668fe390c1e84580575965684a8fa7e4626dee (diff) |
udf: Replace bkl with the UDF_I(inode)->i_data_sem for protect udf_inode_info struct
Replace bkl with the UDF_I(inode)->i_data_sem rw semaphore in
udf_release_file(), udf_symlink(), udf_symlink_filler(), udf_get_block(),
udf_block_map(), and udf_setattr(). The rule now is that any operation
on regular file's or symlink's extents (or generally allocation information
including goal block) needs to hold i_data_sem.
This work was supported by a hardware donation from the CE Linux Forum.
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r-- | fs/udf/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index 66b9e7e7e4c5..df0c5561cc7e 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -204,10 +204,10 @@ static int udf_release_file(struct inode *inode, struct file *filp) | |||
204 | { | 204 | { |
205 | if (filp->f_mode & FMODE_WRITE) { | 205 | if (filp->f_mode & FMODE_WRITE) { |
206 | mutex_lock(&inode->i_mutex); | 206 | mutex_lock(&inode->i_mutex); |
207 | lock_kernel(); | 207 | down_write(&UDF_I(inode)->i_data_sem); |
208 | udf_discard_prealloc(inode); | 208 | udf_discard_prealloc(inode); |
209 | udf_truncate_tail_extent(inode); | 209 | udf_truncate_tail_extent(inode); |
210 | unlock_kernel(); | 210 | up_write(&UDF_I(inode)->i_data_sem); |
211 | mutex_unlock(&inode->i_mutex); | 211 | mutex_unlock(&inode->i_mutex); |
212 | } | 212 | } |
213 | return 0; | 213 | return 0; |