lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v37 3/4] scsi: ufs: Prepare HPB read for cached sub-region
Date
>+	/*
>+ * If the region state is active, mctx must be allocated.
>+ * In this case, check whether the region is evicted or
>+ * mctx allcation fail.
>+ */
>+ if (unlikely(!srgn->mctx)) {
>+ dev_err(&hpb->sdev_ufs_lu->sdev_dev,
>+ "no mctx in region %d subregion %d.\n",
>+ srgn->rgn_idx, srgn->srgn_idx);
>+ return true;
>+ }
>+
>+ if ((srgn_offset + cnt) > bitmap_len)
>+ bit_len = bitmap_len - srgn_offset;
>+ else
>+ bit_len = cnt;
>+
>+ if (find_next_bit(srgn->mctx->ppn_dirty, bitmap_len,
>+ srgn_offset) < bit_len + srgn_offset)
>+ return true;
>+

It seems unnecessary to search through bitmap_len
How about searching by transfer size?

if (find_next_bit(srgn->mctx->ppn_dirty,
bit_len + srgn_offset, srgn_offset) < bit_len + srgn_offset)

Thanks
Yohan
\
 
 \ /
  Last update: 2021-06-11 07:08    [W:0.062 / U:3.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site