aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-09 18:59:24 -0500
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 18:59:24 -0500
commit1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch)
treeb0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/hfsplus
parent794ee1baee1c26be40410233e6c20bceb2b03c08 (diff)
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on XFS and compiled as much as one can consider on an ia64. Anyway your luck with it might be different. Modified-by: Ingo Molnar <mingo@elte.hu> (finished the conversion) Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/bitmap.c8
-rw-r--r--fs/hfsplus/inode.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/hfsplus/bitmap.c b/fs/hfsplus/bitmap.c
index c7d316455fa0..9fb51632303c 100644
--- a/fs/hfsplus/bitmap.c
+++ b/fs/hfsplus/bitmap.c
@@ -29,7 +29,7 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, u32 offset, u32 *ma
29 return size; 29 return size;
30 30
31 dprint(DBG_BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); 31 dprint(DBG_BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len);
32 down(&HFSPLUS_SB(sb).alloc_file->i_sem); 32 mutex_lock(&HFSPLUS_SB(sb).alloc_file->i_mutex);
33 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping; 33 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping;
34 page = read_cache_page(mapping, offset / PAGE_CACHE_BITS, 34 page = read_cache_page(mapping, offset / PAGE_CACHE_BITS,
35 (filler_t *)mapping->a_ops->readpage, NULL); 35 (filler_t *)mapping->a_ops->readpage, NULL);
@@ -143,7 +143,7 @@ done:
143 sb->s_dirt = 1; 143 sb->s_dirt = 1;
144 dprint(DBG_BITMAP, "-> %u,%u\n", start, *max); 144 dprint(DBG_BITMAP, "-> %u,%u\n", start, *max);
145out: 145out:
146 up(&HFSPLUS_SB(sb).alloc_file->i_sem); 146 mutex_unlock(&HFSPLUS_SB(sb).alloc_file->i_mutex);
147 return start; 147 return start;
148} 148}
149 149
@@ -164,7 +164,7 @@ int hfsplus_block_free(struct super_block *sb, u32 offset, u32 count)
164 if ((offset + count) > HFSPLUS_SB(sb).total_blocks) 164 if ((offset + count) > HFSPLUS_SB(sb).total_blocks)
165 return -2; 165 return -2;
166 166
167 down(&HFSPLUS_SB(sb).alloc_file->i_sem); 167 mutex_lock(&HFSPLUS_SB(sb).alloc_file->i_mutex);
168 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping; 168 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping;
169 pnr = offset / PAGE_CACHE_BITS; 169 pnr = offset / PAGE_CACHE_BITS;
170 page = read_cache_page(mapping, pnr, (filler_t *)mapping->a_ops->readpage, NULL); 170 page = read_cache_page(mapping, pnr, (filler_t *)mapping->a_ops->readpage, NULL);
@@ -215,7 +215,7 @@ out:
215 kunmap(page); 215 kunmap(page);
216 HFSPLUS_SB(sb).free_blocks += len; 216 HFSPLUS_SB(sb).free_blocks += len;
217 sb->s_dirt = 1; 217 sb->s_dirt = 1;
218 up(&HFSPLUS_SB(sb).alloc_file->i_sem); 218 mutex_unlock(&HFSPLUS_SB(sb).alloc_file->i_mutex);
219 219
220 return 0; 220 return 0;
221} 221}
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index fc98583cf045..983bcd02ac1c 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -276,13 +276,13 @@ static int hfsplus_file_release(struct inode *inode, struct file *file)
276 if (atomic_read(&file->f_count) != 0) 276 if (atomic_read(&file->f_count) != 0)
277 return 0; 277 return 0;
278 if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) { 278 if (atomic_dec_and_test(&HFSPLUS_I(inode).opencnt)) {
279 down(&inode->i_sem); 279 mutex_lock(&inode->i_mutex);
280 hfsplus_file_truncate(inode); 280 hfsplus_file_truncate(inode);
281 if (inode->i_flags & S_DEAD) { 281 if (inode->i_flags & S_DEAD) {
282 hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL); 282 hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL);
283 hfsplus_delete_inode(inode); 283 hfsplus_delete_inode(inode);
284 } 284 }
285 up(&inode->i_sem); 285 mutex_unlock(&inode->i_mutex);
286 } 286 }
287 return 0; 287 return 0;
288} 288}