From patchwork Sat Jul 28 15:15:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10547993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E5DE112E for ; Sat, 28 Jul 2018 15:16:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52DB62B20D for ; Sat, 28 Jul 2018 15:16:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 447382B555; Sat, 28 Jul 2018 15:16:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 390122B20D for ; Sat, 28 Jul 2018 15:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729017AbeG1QnO (ORCPT ); Sat, 28 Jul 2018 12:43:14 -0400 Received: from mout.gmx.net ([212.227.15.18]:36425 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728951AbeG1QnO (ORCPT ); Sat, 28 Jul 2018 12:43:14 -0400 Received: from localhost.localdomain ([113.87.89.132]) by mail.gmx.com (mrgmx003 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MbPLI-1fQo8k2SzU-00Immm; Sat, 28 Jul 2018 17:16:19 +0200 From: Chengguang Xu To: ceph-devel@vger.kernel.org Cc: zyan@redhat.com, idryomov@gmail.com, Chengguang Xu Subject: [PATCH 0/6] code cleanup and minor optimization for cap reservation Date: Sat, 28 Jul 2018 23:15:34 +0800 Message-Id: <20180728151540.11253-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:FYS2gxomAA5X6Tzn9/271gXBATrH+QgNZSoyP3DdaZHHt0R2zcu 86lVYM82aJWyfcyOcsDrN9TCn0CAhKzEH3jlyDDjA1W2b98KZAfDetQhm0USI2LWeRWspi5 wyE8CWz3QGoCYFP4Rty8bVFp0CVmwOCVDkldLLu1ay1vAUfIzTXjefSJ0KxFh3dc95D3Lu8 2EvhJbqJ70c3aCYHnR87g== X-UI-Out-Filterresults: notjunk:1;V01:K0:GnvGNEWW+iQ=:BXlfvVDRXbyGfXne8RyYiA Uz9XR5RxxkzEjVekimT0LaIdgnYtpY5tUyinkFbqMY1WdQxxCFx7sdibH2jy2kDaaoFxojQsE B223+dgmVTK2QDvnSvXHKUFd9DH66m2zeI0hfK8tMxUMZ31UxACDFGZIeK3OdNER4OoDYDCv1 t5gEgZJXqMkBgmwuZsZmLX/VTET0dq3qoSKzvqK5r2Vm3uUthoCIx9SStKU9UvEkcMA0IeP7y v7pyV8l62jiQF4uVkFDhFARtVW419AdKWwhHSufBHzQDnOC/UjVs7msKuxOs8nEkofef18Lk0 dmKLv+MUSHG3947begIoGzhuWhHdZI5uL6kJPl/PevSwM1y1iDARZhO3OarCeOag8lyWFFJdj Y49c7HjGHXtNDtfNKWV4Javi5dF12/5q5tneTDI7O0jxf9cBbITN5Y1aids9a3fldDKvg8819 zH0OE4JZeCX6elVisOHP+f5LRywoWdi49kkKPDWXomCS3Q+nCl2dB1EoiDgb4udZC7QXv5Ept bT2a3AHzLe6zI7zedlMzxeJ52FUT7mrOfDpd/XoUn9tE5L6sxAMoBxDyCVZQgu/mPY/Oy9VtE LCYai2XrsFYnhQBcG1XbADC4BYWznEsj7G1Vq7uQND8z6/4zHorJq6NDQrMwI33Ul/ViNktmO hUWnYNH5KVKEIOcnla+dWX2nGBrV0zOiyIVlvPELkV2hBtXb9QndH2SREjdnQS8vfnlA9OmZ/ lHwZWboxMcV/3yf/ep/RNFn73lS8iFhLXYaN2PsMa+fJEhEtrMVLRdsqmCI= Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch set does code cleanup and minor optimization for cap reservation. Chengguang Xu (6): ceph: introduce a helper for reducing duplicated code ceph: refactor ceph_unreserve_caps() ceph: refactor error handling code in ceph_reserve_caps() ceph: change return type of ceph_unreserve_caps() to void ceph: let ceph_trim_caps() return trimmed cap number ceph: minor optimization for cap reservation fs/ceph/caps.c | 126 +++++++++++++++++++++---------------------- fs/ceph/mds_client.c | 6 ++- fs/ceph/super.h | 2 +- 3 files changed, 65 insertions(+), 69 deletions(-)