Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp59401imm; Wed, 25 Jul 2018 22:35:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVqiwlgRrj+UuZgR3Rixge58XLC0b3tZHRDP9JCdTiXf8kBoivuyJI8CucYF2RB7699lrb X-Received: by 2002:a63:c60:: with SMTP id 32-v6mr553181pgm.155.1532583323612; Wed, 25 Jul 2018 22:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532583323; cv=none; d=google.com; s=arc-20160816; b=FvPV7Iww9gsGcYIGWz4uZpfhpZ+SykytchBbZozbbPYHCQKeFqv2qrk6Zmtdve84P8 ixoY7gYCCl/Xg9LvbLpQo+quYJLkP8nfxa41gF7R2vPUZZ+Ck0Piavp0zNzVeFiIGDf2 RjU+xAHkrsV1d28dKFqZhpTrK7q9uAjk8GfX8+/kCDEbBAR5r/hlFT+S5PBFAmSOaW1g i5Jzfz0Ntdt8NDyI1zkLKAYCFf9ORJJFwTwOWH+l9pHxVDSb66kUsJCHvhMqYPGswQ+c Z3bmbiy6XvCDpfo+vLTWQKydGNg/FmN9B+45ffFylQV2hBFBGQMHf1utsbxMtvTLTl1K NS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XOdvCy85sKLL43TX1lTqopZX1P6yRziElFutpYgugXI=; b=AQGZHhWQsTWUeYNLPgG/EA9Bk9Sv0F9v/FDJpByxpdyZfGZptWuDGiCU/+M1LPQY2X asBZjRXCNML8eo8sSpNWp8gIVOCq5ur2eMCUKnFQKnoGzs2Lm29TnsXdWI2328dDTCZ8 jpCKIf9xIBVU5VYqEaBz3ZalZipYrW+lvfHwrbhIy+p3i9I497UyneTpX0yDuqD5YiJ1 2Y1XiHODD7JyCucV5UuxuQbjeLaPnS2bfJHxY5SGnQUQmLPtGjMmIDfPQiVIRrgval6H l+4jc1B8J7oRXslDYm5v/2uB6fPuOTgIjM3FdcD0c+GNlulZCp/eCN6iZuzkFnQbAw+G DtNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si455952pld.184.2018.07.25.22.35.06; Wed, 25 Jul 2018 22:35:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbeGZGtQ (ORCPT + 99 others); Thu, 26 Jul 2018 02:49:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:43636 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728652AbeGZGtP (ORCPT ); Thu, 26 Jul 2018 02:49:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 88BEFACEF; Thu, 26 Jul 2018 05:34:07 +0000 (UTC) From: Coly Li To: colyli@suse.de, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, Andy Shevchenko , Greg Kroah-Hartman , Linus Torvalds , Thomas Gleixner , Michael Lyle , Kent Overstreet , Kate Stewart , Randy Dunlap , Eric Biggers Subject: [PATCH v5 0/2] add crc64 calculation as kernel library Date: Thu, 26 Jul 2018 13:33:50 +0800 Message-Id: <20180726053352.2781-1-colyli@suse.de> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set adds basic implementation of crc64 calculation as Linux kernel library. Since bcache already does crc64 by itself, this patch set also modifies bcache code to use the new crc64 library routine. Currently bcache is the only user of crc64 calculation, another potential user is bcachefs which is on the way to be in mainline kernel. Therefore it makes sense to make crc64 calculation to be a public library. CRC calculation consistency testing is not trvial, it will be another separated patch set and not in this series any more. Coly Li Cc: Andy Shevchenko Cc: Greg Kroah-Hartman Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Michael Lyle Cc: Kent Overstreet Cc: Kate Stewart Cc: Andrew Morton Cc: Randy Dunlap Cc: Eric Biggers --- Changelog: v5: Remove test_crc patch from this series, it will be another separated patch set. Fixes review comments from v4. v4: Only keep crc64_be() in lib/crc64.c, tested bcache specific stuffs moved back to bcache code. Fixes all review comments of v3. v3: Remove little endian restriction and remove 'le' from function names. Fixes all review comments of v2 v2: Combine first two patches into one Fixes all review comments of v1 v1: Initial version. Coly Li (2): lib: add crc64 calculation routines bcache: use routines from lib/crc64.c for CRC64 calculation drivers/md/bcache/Kconfig | 1 + drivers/md/bcache/util.c | 131 -------------------------------------- drivers/md/bcache/util.h | 21 ++++-- include/linux/crc64.h | 11 ++++ lib/.gitignore | 2 + lib/Kconfig | 8 +++ lib/Makefile | 11 ++++ lib/crc64.c | 56 ++++++++++++++++ lib/gen_crc64table.c | 68 ++++++++++++++++++++ 9 files changed, 174 insertions(+), 135 deletions(-) create mode 100644 include/linux/crc64.h create mode 100644 lib/crc64.c create mode 100644 lib/gen_crc64table.c -- 2.17.1