Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1551925pxu; Sat, 5 Dec 2020 22:54:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJD3I5TAGsGsyO5T9ui1ycOXML1KplmwIokbEh73YKIXRQXWcs6P9mWgy71uXzjrfaPgN0 X-Received: by 2002:a17:906:ae55:: with SMTP id lf21mr14041089ejb.101.1607237666451; Sat, 05 Dec 2020 22:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607237666; cv=none; d=google.com; s=arc-20160816; b=c9xl/LRJ5XeL4wC3YSOpLm/TbbUm1y+OZ9vpiDtEa3q4ePqCRj+YNZ4CjHuQjVaBq5 m8Pj1lcJhQzn+gdOeqrszlOGyYuKkHvS/u32C+LRKiseO8U3BxCeGUHyfWUoolbLfzPh 2ySxR/NSg0zpWbAytcujabqLB1XLwJ5jvuhpS11N6b/wPHpi5yBVJWlwBMa7UEdMO4IA mj8c5IcHy3gnewKdGjsOfHgAyHFVVpGAYFudvDoGEyX7lFJ5CLb78N/nnuooWng2rsSw BIVUI7Veh0Z9XuzIksCgDSofwXN4kFydp0CsRoIQE354u2+YjSyl0sbqWUOdDutUCMrX wzeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=FX0UailaNX0q+4Z+Y5R9hIxj0ArhyVPsbwe2N/jEEzM=; b=IIvbH5NkUkm6wkva/D2crPWbzclpNynEGQkBtXw8NZM6X8IkjwX0ecjo61dAReGkXr UVW5pgs5lYg39is0ARjopM5cGsPCAEwz3OnAXLFFv85BGwDctfseLquzvqaTXgtY+Wg+ iQq3L+jRqmmZN3Yz8kgt8ytEbnE5KqrD5vWxF9RbiunMGnYREx4SV+MgmJGQ7yYHRB1A HP1b41QWqtHkRc4v8ciGkBLFeQ82Xi8SXedBQE+nuOF1qfUTfL/2qRf7Byyug3VUFduG /57L3Tl76f7uFxoy8wPw6L+ytkqHEU9BtdxRqvHbfDTRxWeKaDEIdq6t+fn3dLk4G4jC rgkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YQWA/4ZT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si6157453edt.77.2020.12.05.22.54.04; Sat, 05 Dec 2020 22:54:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YQWA/4ZT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbgLFGvc (ORCPT + 99 others); Sun, 6 Dec 2020 01:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgLFGvb (ORCPT ); Sun, 6 Dec 2020 01:51:31 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 491BBC0613D4; Sat, 5 Dec 2020 22:50:51 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id 11so611892pfu.4; Sat, 05 Dec 2020 22:50:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=FX0UailaNX0q+4Z+Y5R9hIxj0ArhyVPsbwe2N/jEEzM=; b=YQWA/4ZTe6M9q3MYP55f69EOLM9UY5efkxhwcV0Bwv0uj88o9COAFSRYJY7pBndWOd ICSlePTIlrnvZvMc1BR0pQbhhDfT2t/tVhNg55npDn98IUnh7g66B/u4Rl5adDmqosxM i1qELRcX1rtFXX82Kx8XZgTVDkz/FmxXPuPWXAgUxrOKXIvo/8n4IBLcVgC622HEdaDz BXkYhNG2in8wR9Fc5cucJEz1whldUnEfbeQvJrXpJxRU/ejdPOwZbwU40UULo6sqMUo2 afDB43BYkRChqcE9zOkqCfJpXCiIEdBNU5KHxDAYEbckiluDwUL/90cImovoW6NdwASx f8PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=FX0UailaNX0q+4Z+Y5R9hIxj0ArhyVPsbwe2N/jEEzM=; b=QNadYS+ZKwtK2oViKiwsWN9KZgzXEW7kMnzaSqHSucH5MRH6VG+htFzL4f2FluGtrv iIBFvtaUU+Y3q2yc9UcTkKOH5fl1+4dMV/ChsU7jna3ZAPIhOoDidyyD0yduVHDnJjTj aByB/rqgIPL3Cm6W6+tuIOmve804qV+9ABhQdutMjMG1tom4pYvft9H+N0OzB3PTe64V TDCUyYobM7zLAPRdXQSI9trHch6dRjBbeAvRjaWvxr5qXm0+/KaER/DK+stqSgiZKb/3 e37pwhAHp2IgFmDaqbA0foMnH28VCUnap4ow1NZ/pfMRHQOtEIq91iGSP35MyOCGMlsS nFeg== X-Gm-Message-State: AOAM530Sc25VEHi4UmSE6FMQXl3nT11uGNJE1zkS/7f6/YL+05Ty36e9 9O3ksjoPraGth2eap4eBYp8= X-Received: by 2002:a65:490c:: with SMTP id p12mr13995291pgs.98.1607237450811; Sat, 05 Dec 2020 22:50:50 -0800 (PST) Received: from ubuntu ([211.226.85.205]) by smtp.gmail.com with ESMTPSA id z23sm2182499pfn.202.2020.12.05.22.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 22:50:50 -0800 (PST) Date: Sun, 6 Dec 2020 15:50:40 +0900 From: Levi Yun 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. Message-ID: <20201206065040.GA6385@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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