Skip to content

Commit

Permalink
kill-the-BKL/reiserfs: release write lock while rescheduling on prepa…
Browse files Browse the repository at this point in the history
…re_for_delete_or_cut()

prepare_for_delete_or_cut() can process several types of items, including
indirect items, ie: items which contain no file data but pointers to
unformatted nodes scattering the datas of a file.

In this case it has to zero out these pointers to block numbers of
unformatted nodes and release the bitmap from these block numbers.

It can take some time, so a rescheduling() is performed between each
block processed. We can safely release the write lock while
rescheduling(), like the bkl did, because the code checks just after
if the item has moved after sleeping.

[ Impact: release the reiserfs write lock when it is not needed ]

Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Frederic Weisbecker committed Sep 14, 2009
1 parent e6950a4 commit 5e69e3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/reiserfs/stree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
reiserfs_free_block(th, inode, block, 1);
}

reiserfs_write_unlock(sb);
cond_resched();
reiserfs_write_lock(sb);

if (item_moved (&s_ih, path)) {
need_re_search = 1;
Expand Down

0 comments on commit 5e69e3a

Please sign in to comment.