/* The function is NOT SCHEDULE-SAFE! It might unlock the write lock if we needed to wait for a block to be read. Note that in this case it won't recover the lock to avoid high contention resulting from too much lock requests, especially the caller (search_by_key) will perform other schedule-unsafe operations just after calling this function. */
static bool search_by_key_reada(struct super_block *s, struct buffer_head **bh, b_blocknr_t *b, int num)
/* The function is NOT SCHEDULE-SAFE! It might unlock the write lock if we needed to wait for a block to be read. Note that in this case it won't recover the lock to avoid high contention resulting from too much lock requests, especially the caller (search_by_key) will perform other schedule-unsafe operations just after calling this function. */
static bool search_by_key_reada(struct super_block *s, struct buffer_head **bh, b_blocknr_t *b, int num)
{
	int i, j;
	bool unlocked = false;
	for (i = 0; i < num; i++) {
		bh[i] = sb_getblk(s, b[i]);
	}
	for (j = 0; j < i; j++) {
		if (!buffer_uptodate(bh[j])) {
			if (!unlocked) {
				reiserfs_write_unlock(s);
				unlocked = true;
			}
			ll_rw_block(READA, 1, bh + j);
		}
		brelse(bh[j]);
	}
	return unlocked;
}