diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-04-30 17:36:33 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-14 01:18:09 -0400 |
commit | 5e69e3a4492ea5abfd2e8ddc575448becf28e4d9 (patch) | |
tree | 85cad0034222ceef31241e7c0e406bc76aca0186 | |
parent | e6950a4da33fa84ef4402d29e2331cd5e5df9cb8 (diff) |
kill-the-BKL/reiserfs: release write lock while rescheduling on prepare_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>
-rw-r--r-- | fs/reiserfs/stree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 6bd99a99a652..6ddcecb4e8ab 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -1026,7 +1026,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st | |||
1026 | reiserfs_free_block(th, inode, block, 1); | 1026 | reiserfs_free_block(th, inode, block, 1); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | reiserfs_write_unlock(sb); | ||
1029 | cond_resched(); | 1030 | cond_resched(); |
1031 | reiserfs_write_lock(sb); | ||
1030 | 1032 | ||
1031 | if (item_moved (&s_ih, path)) { | 1033 | if (item_moved (&s_ih, path)) { |
1032 | need_re_search = 1; | 1034 | need_re_search = 1; |