From: Levi Yun <ppbuk5246@gmail.com>
To: akpm@linux-foundation.org, yury.norov@gmail.com,
andriy.shevchenko@linux.intel.com,
richard.weiyang@linux.alibaba.com, christian.brauner@ubuntu.com,
arnd@arndb.de, jpoimboe@redhat.com, changbin.du@intel.com,
rdunlap@infradead.org, masahiroy@kernel.org,
gregkh@linuxfoundation.org, peterz@infradead.org,
peter.enderborg@sony.com, krzk@kernel.org,
brendanhiggins@google.com, keescook@chromium.org,
broonie@kernel.org, matti.vaittinen@fi.rohmeurope.com,
mhiramat@kernel.org, jpa@git.mail.kapsi.fi,
nivedita@alum.mit.edu, glider@google.com, orson.zhai@unisoc.com,
takahiro.akashi@linaro.org, clm@fb.com, josef@toxicpanda.com,
dsterba@suse.com, dushistov@mail.ru
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-btrfs@vger.kernel.org
Subject: [PATCH v2 8/8] ufs/util.h: Apply new find_last_zero_bit.
Date: Sun, 6 Dec 2020 15:50:40 +0900 [thread overview]
Message-ID: <20201206065040.GA6385@ubuntu> (raw)
Former find_last_zero_bit in ufs makes complie error when we add
find_last_zero_bit in lib/find_bit.c
We remove former find_last_zero_bit in ufs which iterates per char,
And apply new find_last_zero_bit in lib.
Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
---
fs/ufs/util.h | 30 +++---------------------------
1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 4931bec1a01c..3024f2076feb 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -413,29 +413,6 @@ static inline unsigned _ubh_find_next_zero_bit_(
return (base << uspi->s_bpfshift) + pos - begin;
}
-static inline unsigned find_last_zero_bit (unsigned char * bitmap,
- unsigned size, unsigned offset)
-{
- unsigned bit, i;
- unsigned char * mapp;
- unsigned char map;
-
- mapp = bitmap + (size >> 3);
- map = *mapp--;
- bit = 1 << (size & 7);
- for (i = size; i > offset; i--) {
- if ((map & bit) == 0)
- break;
- if ((i & 7) != 0) {
- bit >>= 1;
- } else {
- map = *mapp--;
- bit = 1 << 7;
- }
- }
- return i;
-}
-
#define ubh_find_last_zero_bit(ubh,begin,size,offset) _ubh_find_last_zero_bit_(uspi,ubh,begin,size,offset)
static inline unsigned _ubh_find_last_zero_bit_(
struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh,
@@ -453,15 +430,14 @@ static inline unsigned _ubh_find_last_zero_bit_(
size + (uspi->s_bpf - start), uspi->s_bpf)
- (uspi->s_bpf - start);
size -= count;
- pos = find_last_zero_bit (ubh->bh[base]->b_data,
- start, start - count);
- if (pos > start - count || !size)
+ pos = find_last_zero_bit_le(ubh->bh[base]->b_data, start + 1);
+ if ((pos < start + 1 && pos > start - count) || !size)
break;
base--;
start = uspi->s_bpf;
}
return (base << uspi->s_bpfshift) + pos - begin;
-}
+}
#define ubh_isblockclear(ubh,begin,block) (!_ubh_isblockset_(uspi,ubh,begin,block))
--
2.27.0
reply other threads:[~2020-12-06 6:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201206065040.GA6385@ubuntu \
--to=ppbuk5246@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=brendanhiggins@google.com \
--cc=broonie@kernel.org \
--cc=changbin.du@intel.com \
--cc=christian.brauner@ubuntu.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=dushistov@mail.ru \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=josef@toxicpanda.com \
--cc=jpa@git.mail.kapsi.fi \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=krzk@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mhiramat@kernel.org \
--cc=nivedita@alum.mit.edu \
--cc=orson.zhai@unisoc.com \
--cc=peter.enderborg@sony.com \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=richard.weiyang@linux.alibaba.com \
--cc=takahiro.akashi@linaro.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox