aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r--fs/reiserfs/inode.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index a14d6cd9eeda..1893c8198439 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -489,10 +489,14 @@ static int reiserfs_get_blocks_direct_io(struct inode *inode,
489 disappeared */ 489 disappeared */
490 if (REISERFS_I(inode)->i_flags & i_pack_on_close_mask) { 490 if (REISERFS_I(inode)->i_flags & i_pack_on_close_mask) {
491 int err; 491 int err;
492 lock_kernel(); 492
493 reiserfs_write_lock(inode->i_sb);
494
493 err = reiserfs_commit_for_inode(inode); 495 err = reiserfs_commit_for_inode(inode);
494 REISERFS_I(inode)->i_flags &= ~i_pack_on_close_mask; 496 REISERFS_I(inode)->i_flags &= ~i_pack_on_close_mask;
495 unlock_kernel(); 497
498 reiserfs_write_unlock(inode->i_sb);
499
496 if (err < 0) 500 if (err < 0)
497 ret = err; 501 ret = err;
498 } 502 }
@@ -616,7 +620,6 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
616 loff_t new_offset = 620 loff_t new_offset =
617 (((loff_t) block) << inode->i_sb->s_blocksize_bits) + 1; 621 (((loff_t) block) << inode->i_sb->s_blocksize_bits) + 1;
618 622
619 /* bad.... */
620 reiserfs_write_lock(inode->i_sb); 623 reiserfs_write_lock(inode->i_sb);
621 version = get_inode_item_key_version(inode); 624 version = get_inode_item_key_version(inode);
622 625
@@ -997,10 +1000,14 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
997 if (retval) 1000 if (retval)
998 goto failure; 1001 goto failure;
999 } 1002 }
1000 /* inserting indirect pointers for a hole can take a 1003 /*
1001 ** long time. reschedule if needed 1004 * inserting indirect pointers for a hole can take a
1005 * long time. reschedule if needed and also release the write
1006 * lock for others.
1002 */ 1007 */
1008 reiserfs_write_unlock(inode->i_sb);
1003 cond_resched(); 1009 cond_resched();
1010 reiserfs_write_lock(inode->i_sb);
1004 1011
1005 retval = search_for_position_by_key(inode->i_sb, &key, &path); 1012 retval = search_for_position_by_key(inode->i_sb, &key, &path);
1006 if (retval == IO_ERROR) { 1013 if (retval == IO_ERROR) {
@@ -2608,7 +2615,10 @@ int reiserfs_prepare_write(struct file *f, struct page *page,
2608 int ret; 2615 int ret;
2609 int old_ref = 0; 2616 int old_ref = 0;
2610 2617
2618 reiserfs_write_unlock(inode->i_sb);
2611 reiserfs_wait_on_write_block(inode->i_sb); 2619 reiserfs_wait_on_write_block(inode->i_sb);
2620 reiserfs_write_lock(inode->i_sb);
2621
2612 fix_tail_page_for_writing(page); 2622 fix_tail_page_for_writing(page);
2613 if (reiserfs_transaction_running(inode->i_sb)) { 2623 if (reiserfs_transaction_running(inode->i_sb)) {
2614 struct reiserfs_transaction_handle *th; 2624 struct reiserfs_transaction_handle *th;
@@ -2758,7 +2768,10 @@ int reiserfs_commit_write(struct file *f, struct page *page,
2758 int update_sd = 0; 2768 int update_sd = 0;
2759 struct reiserfs_transaction_handle *th = NULL; 2769 struct reiserfs_transaction_handle *th = NULL;
2760 2770
2771 reiserfs_write_unlock(inode->i_sb);
2761 reiserfs_wait_on_write_block(inode->i_sb); 2772 reiserfs_wait_on_write_block(inode->i_sb);
2773 reiserfs_write_lock(inode->i_sb);
2774
2762 if (reiserfs_transaction_running(inode->i_sb)) { 2775 if (reiserfs_transaction_running(inode->i_sb)) {
2763 th = current->journal_info; 2776 th = current->journal_info;
2764 } 2777 }