From patchwork Sun Oct 6 01:19:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13823620 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E561EBE6C; Sun, 6 Oct 2024 01:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177602; cv=none; b=n98pig9T6xTG8UnDxC+YdznMUlzg0osPpR4mdcU4mDA9Ds5CO3PY4th9Yep4VO3aJGZkGBp12kO4hwYIedoa3cvWFoVqhVHMGVm8XAzAqsOU7UbzIPFdZX4+ScRaqKUSvBaqFkpqUKbfcrgCEI1TLPPJomLxGCASEyXggMG9WB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177602; c=relaxed/simple; bh=UJViJazAd2ZGpzntsVOHSEhvQLlHJxCERyFncInudHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hI/J1OgwEYjDSNN2EPQqzd5w6q/Q9qWU61uYMnl8X1c0MHKYYurVTuXCWYFLl/hWGHe9sKBJyPICCaAVQGxb9tuT9//DUeijTTEl7CIB4Vq/ivOfQhdWigTJk4EJwr4C8D1q7KEQU5YV+NKswhImhimvdgORIUTiXMR1RB6Xqb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=TUS8utDz; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="TUS8utDz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=vC4l2UYKZpyNu5umgYrgsjnU5De5FjNDCKiJd63mSeI=; b=TUS8utDzeN3s+pkB ef6wovvrv2TUOt8gb9fAx8kc0bshTeL8PSP5GzgsANf2Jc79VgieFbPflYDq4YlQAoPnX2adwpQQ0 BdzaqkcT+GRA8fMbFOfrqkX2ywM0gkUbN6OUtqVPUKpChuFcI9rgzfi734PxUcHTMDx0L2sdfeP1p dUKvTKeWU3yHWtVmzEF1qwPDjNbvXglsQvTqGJfjPX+zJfYT/v+1z0wdPCditCmzevMbgzXxdpEJ+ dp39Z7l/y71em2lCa9kekBwxF9aNSlmmn9JZpxXEWKF/tv0yUSj+pctLoDY8//6uq3/QszIe6hR98 9eSR5YwkZCvNZruCCQ==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sxFwE-009DsK-0V; Sun, 06 Oct 2024 01:19:58 +0000 From: linux@treblig.org To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/5] libceph: Remove unused ceph_pagelist functions Date: Sun, 6 Oct 2024 02:19:52 +0100 Message-ID: <20241006011956.373622-2-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241006011956.373622-1-linux@treblig.org> References: <20241006011956.373622-1-linux@treblig.org> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ceph_pagelist_truncate() and ceph_pagelist_set_cursor() have been unused since commit 39be95e9c8c0 ("ceph: ceph_pagelist_append might sleep while atomic") Remove them. Signed-off-by: Dr. David Alan Gilbert --- include/linux/ceph/pagelist.h | 12 ----------- net/ceph/pagelist.c | 38 ----------------------------------- 2 files changed, 50 deletions(-) diff --git a/include/linux/ceph/pagelist.h b/include/linux/ceph/pagelist.h index 5dead8486fd8..879bec0863aa 100644 --- a/include/linux/ceph/pagelist.h +++ b/include/linux/ceph/pagelist.h @@ -17,12 +17,6 @@ struct ceph_pagelist { refcount_t refcnt; }; -struct ceph_pagelist_cursor { - struct ceph_pagelist *pl; /* pagelist, for error checking */ - struct list_head *page_lru; /* page in list */ - size_t room; /* room remaining to reset to */ -}; - struct ceph_pagelist *ceph_pagelist_alloc(gfp_t gfp_flags); extern void ceph_pagelist_release(struct ceph_pagelist *pl); @@ -33,12 +27,6 @@ extern int ceph_pagelist_reserve(struct ceph_pagelist *pl, size_t space); extern int ceph_pagelist_free_reserve(struct ceph_pagelist *pl); -extern void ceph_pagelist_set_cursor(struct ceph_pagelist *pl, - struct ceph_pagelist_cursor *c); - -extern int ceph_pagelist_truncate(struct ceph_pagelist *pl, - struct ceph_pagelist_cursor *c); - static inline int ceph_pagelist_encode_64(struct ceph_pagelist *pl, u64 v) { __le64 ev = cpu_to_le64(v); diff --git a/net/ceph/pagelist.c b/net/ceph/pagelist.c index 74622b278d57..5a9c4be5f222 100644 --- a/net/ceph/pagelist.c +++ b/net/ceph/pagelist.c @@ -131,41 +131,3 @@ int ceph_pagelist_free_reserve(struct ceph_pagelist *pl) return 0; } EXPORT_SYMBOL(ceph_pagelist_free_reserve); - -/* Create a truncation point. */ -void ceph_pagelist_set_cursor(struct ceph_pagelist *pl, - struct ceph_pagelist_cursor *c) -{ - c->pl = pl; - c->page_lru = pl->head.prev; - c->room = pl->room; -} -EXPORT_SYMBOL(ceph_pagelist_set_cursor); - -/* Truncate a pagelist to the given point. Move extra pages to reserve. - * This won't sleep. - * Returns: 0 on success, - * -EINVAL if the pagelist doesn't match the trunc point pagelist - */ -int ceph_pagelist_truncate(struct ceph_pagelist *pl, - struct ceph_pagelist_cursor *c) -{ - struct page *page; - - if (pl != c->pl) - return -EINVAL; - ceph_pagelist_unmap_tail(pl); - while (pl->head.prev != c->page_lru) { - page = list_entry(pl->head.prev, struct page, lru); - /* move from pagelist to reserve */ - list_move_tail(&page->lru, &pl->free_list); - ++pl->num_pages_free; - } - pl->room = c->room; - if (!list_empty(&pl->head)) { - page = list_entry(pl->head.prev, struct page, lru); - pl->mapped_tail = kmap(page); - } - return 0; -} -EXPORT_SYMBOL(ceph_pagelist_truncate); From patchwork Sun Oct 6 01:19:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13823621 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE14C8F0; Sun, 6 Oct 2024 01:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177603; cv=none; b=mwLgEWBaIK6lylOBC2wGkdrEXIWXbu5GRKVQR95pIXeRP52oYw8p6WuYlFcK3y5FUz1Sv6pyPyIGj1ki1hx/0Wm5a6BeZPgB8qRGwuMyV/2AbYGj9dMTZLYdwZacS7gWrblXTy2ewDMaSauDbnweFELbPdWnNyLeTIpGqAEkD4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177603; c=relaxed/simple; bh=RA2MmJUyp2GKIXW/5gN301QTenv/laiJqdSQKhEsMxI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bx6QhAxGNczC2lwrEBc9KKWPzEWezrbd2q/510uVdu1YMgccf1tv1oorqKIjtEV1iwSsCZFkSwwdpR8dWFqbsN2r8ryyIzIFJxQu6ZvR5D5AyZfdUJA1SkPslJhxTZl4ya6/PfgCIYRgTBeZMtg54e+OPC7ATbN8zNjYjnhdxbU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=EsAMmP2k; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="EsAMmP2k" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=0ipru9QdHkE8npmswXi0jMUY0FyIseud22YPF1wL9+Q=; b=EsAMmP2ksiuTCVa5 vuYk06A24uxkyOR8glOnGEyTMX37IolYo+F06q4+fCPrHL/e9TOFlc2HfKEXllIghy1wBKkQxjFhu T2CI3baRwdkM5oyaAGLygnYF1xwYnS37hyQ523iVsnURo5jFzuCkAsKJqKbw6HoGugNSDsVgSgN9f FDKATbVCTgrtRv+COCokbrPTMkqjHlbgFZ4exIrAhmHDwEPx1i0p538ofngILKHWvS5pLdqMGYMEf sd6aMD1w/YKAY21/Wo+vVYiX/E1lnsgzdSCY+JlxdB8akPfEXwAaP9LtRbeZMUDrj9NIshlu1KzcB 1BDO+2znaD95g2g5Kw==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sxFwE-009DsK-2V; Sun, 06 Oct 2024 01:19:58 +0000 From: linux@treblig.org To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/5] libceph: Remove unused pagevec functions Date: Sun, 6 Oct 2024 02:19:53 +0100 Message-ID: <20241006011956.373622-3-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241006011956.373622-1-linux@treblig.org> References: <20241006011956.373622-1-linux@treblig.org> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ceph_copy_user_to_page_vector() has been unused since 2013's commit e8344e668915 ("ceph: Implement writev/pwritev for sync operation.") ceph_copy_to_page_vector() has been unused since 2012's commit 913d2fdcf605 ("rbd: always pass ops array to rbd_req_sync_op()") Remove them. Signed-off-by: Dr. David Alan Gilbert --- include/linux/ceph/libceph.h | 6 ----- net/ceph/pagevec.c | 52 ------------------------------------ 2 files changed, 58 deletions(-) diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 15fb566d3f46..733e7f93db66 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h @@ -317,12 +317,6 @@ extern void ceph_release_page_vector(struct page **pages, int num_pages); extern void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty); extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); -extern int ceph_copy_user_to_page_vector(struct page **pages, - const void __user *data, - loff_t off, size_t len); -extern void ceph_copy_to_page_vector(struct page **pages, - const void *data, - loff_t off, size_t len); extern void ceph_copy_from_page_vector(struct page **pages, void *data, loff_t off, size_t len); diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 64305e7056a1..4509757d8b3b 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c @@ -55,58 +55,6 @@ struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags) } EXPORT_SYMBOL(ceph_alloc_page_vector); -/* - * copy user data into a page vector - */ -int ceph_copy_user_to_page_vector(struct page **pages, - const void __user *data, - loff_t off, size_t len) -{ - int i = 0; - int po = off & ~PAGE_MASK; - int left = len; - int l, bad; - - while (left > 0) { - l = min_t(int, PAGE_SIZE-po, left); - bad = copy_from_user(page_address(pages[i]) + po, data, l); - if (bad == l) - return -EFAULT; - data += l - bad; - left -= l - bad; - po += l - bad; - if (po == PAGE_SIZE) { - po = 0; - i++; - } - } - return len; -} -EXPORT_SYMBOL(ceph_copy_user_to_page_vector); - -void ceph_copy_to_page_vector(struct page **pages, - const void *data, - loff_t off, size_t len) -{ - int i = 0; - size_t po = off & ~PAGE_MASK; - size_t left = len; - - while (left > 0) { - size_t l = min_t(size_t, PAGE_SIZE-po, left); - - memcpy(page_address(pages[i]) + po, data, l); - data += l; - left -= l; - po += l; - if (po == PAGE_SIZE) { - po = 0; - i++; - } - } -} -EXPORT_SYMBOL(ceph_copy_to_page_vector); - void ceph_copy_from_page_vector(struct page **pages, void *data, loff_t off, size_t len) From patchwork Sun Oct 6 01:19:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13823622 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36EE3D53C; Sun, 6 Oct 2024 01:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177603; cv=none; b=eXwkvKrv3a4sn+2nXo9ZxZfyZ+PXjsJNOo+/Nj5ewpXb1k2Xu5gfzzYoEypzFp0dTwfSQRlx0BMFpYefIUOMZsuDHmGNZKNUoI3eRd/wiCkr/RJUXsYBFhoqgR4W4+xOQjq0elzExZe50NUd1am4yaqATHgVhWIkrb2jZXhtIfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177603; c=relaxed/simple; bh=UDdkxw6HQ51u3bf5tDI5NuNzl8upRcwGmhPHjzjkBZ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FYsgyHVluWiVlOzK9jJ09xkv/i5H3n5vvI7XNaLiT6y2VgP9LDPVLtJjUM4IOLgWyBt6XI07cezeKLznQF5a+PybdVXGC3u6dupRQT7ZvSyoZedQpkxba+PtREB2Yvb5iu+XkV1uN4C0n8tPGFyxVv7udK62+XxksnyTgQk3J2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=ZvvWimPh; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="ZvvWimPh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=N+JA47qrmeJoilUAFUOqrc7+xRDDquESIIZMwmvis50=; b=ZvvWimPh0xVtjpnG qNnIOisxjzgRwsUs8Ba4sTXGYTMthYa4X4srT/oc2d/hQZM5Fyce97cwzkvbGijntXjAHH8jzDHts v+0Yh1HKhAoXkWfunKy345Dcm4Y4gN9mvDAESzk344R+YRMJCoTLNndpSzNVVu575xY5mzULuqt7o MnFbx/AR1szgxEcq0mlAPVDlTpj2rRq526rhNeuEz3GKRcbaYzPa+MLKhqQxAVg4s5XnyG4QoAQJA RsA03YFqOStg6vKAXT/tlMnj+UKJmtubLjABlcRuJhXzpXAhau0p6uqQEw6XqyICv8XlkFDEsAYoT C+olBSvvmkeSL/C43Q==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sxFwF-009DsK-1E; Sun, 06 Oct 2024 01:19:59 +0000 From: linux@treblig.org To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 3/5] libceph: Remove unused ceph_osdc_watch_check Date: Sun, 6 Oct 2024 02:19:54 +0100 Message-ID: <20241006011956.373622-4-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241006011956.373622-1-linux@treblig.org> References: <20241006011956.373622-1-linux@treblig.org> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ceph_osdc_watch_check() has been unused since it was added in commit b07d3c4bd727 ("libceph: support for checking on status of watch") Remove it. Signed-off-by: Dr. David Alan Gilbert --- include/linux/ceph/osd_client.h | 2 -- net/ceph/osd_client.c | 34 --------------------------------- 2 files changed, 36 deletions(-) diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d7941478158c..d55b30057a45 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -626,8 +626,6 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc, u32 timeout, struct page ***preply_pages, size_t *preply_len); -int ceph_osdc_watch_check(struct ceph_osd_client *osdc, - struct ceph_osd_linger_request *lreq); int ceph_osdc_list_watchers(struct ceph_osd_client *osdc, struct ceph_object_id *oid, struct ceph_object_locator *oloc, diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 9d078b37fe0b..9b1168eb77ab 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -4999,40 +4999,6 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc, } EXPORT_SYMBOL(ceph_osdc_notify); -/* - * Return the number of milliseconds since the watch was last - * confirmed, or an error. If there is an error, the watch is no - * longer valid, and should be destroyed with ceph_osdc_unwatch(). - */ -int ceph_osdc_watch_check(struct ceph_osd_client *osdc, - struct ceph_osd_linger_request *lreq) -{ - unsigned long stamp, age; - int ret; - - down_read(&osdc->lock); - mutex_lock(&lreq->lock); - stamp = lreq->watch_valid_thru; - if (!list_empty(&lreq->pending_lworks)) { - struct linger_work *lwork = - list_first_entry(&lreq->pending_lworks, - struct linger_work, - pending_item); - - if (time_before(lwork->queued_stamp, stamp)) - stamp = lwork->queued_stamp; - } - age = jiffies - stamp; - dout("%s lreq %p linger_id %llu age %lu last_error %d\n", __func__, - lreq, lreq->linger_id, age, lreq->last_error); - /* we are truncating to msecs, so return a safe upper bound */ - ret = lreq->last_error ?: 1 + jiffies_to_msecs(age); - - mutex_unlock(&lreq->lock); - up_read(&osdc->lock); - return ret; -} - static int decode_watcher(void **p, void *end, struct ceph_watch_item *item) { u8 struct_v; From patchwork Sun Oct 6 01:19:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13823623 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A654310A18; Sun, 6 Oct 2024 01:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177605; cv=none; b=PAe2xxOLpSmmopRe/jUUzORsys1ZV475ij+MORKd03x3dsK6j64KZLuCb778B9bhZHUDlBT7o4Ay49UKBbihBZIFxlTRg3WGYWVgh0env7ePPndzYxfnpyIF1Tk8qD4b3TCrP/k/apIM2sGVSaXN/mY4rZ4SkG3eLokoXCHEHJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177605; c=relaxed/simple; bh=+3eYkmZ73kJwT6bLA1lV3xCVKKFZuDi8QptcLVB14FA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TceDcuT7Po+93H4H22UrZY4OjoiEhd6Mb4DE1GqpMcQmzmEgTbW9O4xwXRc0C1o/loj7Zra2peq5fOFuNhOD4NTOualjUUf5/wK54/Occzt2e7Yy0Ws8QQHfibducEd3DkcB9wE2QhaG5qsPwKfExGcrwGdTpzm21X1QZQKIvjg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=qebLZu1u; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="qebLZu1u" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=EZS/lTZ8aHdEQcGNta0bwoK+ZREYdcJEcsEzL5DBoX0=; b=qebLZu1uM7dqJ3iT KJ4gkFV/HhjOmpCrrsmVj3AVbhV9H7LVd2P6qlvu+wkHTSF1qfsBdY4jqwxYrCJpi0DTvtT+qnTVl GwhE2uqtokbBrtGO0WGWEpth+gjf5qABowFMeZgqoCnaHy0zcv8LPvLvgM8QF99SCUnt5kncTr7rn okIIHvIOualVW+Vg7ZJbpllFSORHK2YzNrkZvCZrk6QvZbUV0I2LP46n3yVoV9x1KzpcGhuN5bN1x 7WdpCt9t72JPb2XyI4GUYhlFl2GNR1X9/+y5DOUNVWNqHjhY57ekXrOXjriVtdwLa/BzdIFruRJLY aLXr7ObO6x7xB6lcUA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sxFwG-009DsK-06; Sun, 06 Oct 2024 01:20:00 +0000 From: linux@treblig.org To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 4/5] libceph: Remove unused ceph_crypto_key_encode Date: Sun, 6 Oct 2024 02:19:55 +0100 Message-ID: <20241006011956.373622-5-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241006011956.373622-1-linux@treblig.org> References: <20241006011956.373622-1-linux@treblig.org> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ceph_crypto_key_encode() was added in 2010's commit 8b6e4f2d8b21 ("ceph: aes crypto and base64 encode/decode helpers") but has remained unused (the decode is used). Remove it. Signed-off-by: Dr. David Alan Gilbert --- net/ceph/crypto.c | 12 ------------ net/ceph/crypto.h | 1 - 2 files changed, 13 deletions(-) diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 051d22c0e4ad..01b2ce1e8fc0 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -74,18 +74,6 @@ int ceph_crypto_key_clone(struct ceph_crypto_key *dst, return set_secret(dst, src->key); } -int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end) -{ - if (*p + sizeof(u16) + sizeof(key->created) + - sizeof(u16) + key->len > end) - return -ERANGE; - ceph_encode_16(p, key->type); - ceph_encode_copy(p, &key->created, sizeof(key->created)); - ceph_encode_16(p, key->len); - ceph_encode_copy(p, key->key, key->len); - return 0; -} - int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end) { int ret; diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h index 13bd526349fa..23de29fc613c 100644 --- a/net/ceph/crypto.h +++ b/net/ceph/crypto.h @@ -21,7 +21,6 @@ struct ceph_crypto_key { int ceph_crypto_key_clone(struct ceph_crypto_key *dst, const struct ceph_crypto_key *src); -int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end); int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end); int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in); void ceph_crypto_key_destroy(struct ceph_crypto_key *key); From patchwork Sun Oct 6 01:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13823625 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C7578F5A; Sun, 6 Oct 2024 01:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177608; cv=none; b=A/dBRUBf3tMMpX+XPEdDLrlJ0HMWAu0L0QMmqI2zDNINmotD4sfMBORhYL919DZ1O4CKxCW4qlLIO0xX4LowjAxkpiGwCK0eEoLpNuw6cheMVezfZ1vfY4OIinZvNbMp9xMMw/T/9sZFPJlEcxJBpiGd5jTPo2UxhmrHF0Fo3XA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728177608; c=relaxed/simple; bh=AMhJWtDJ3DmzilqLovKPEDl9iPQ/8NhBRi8PAwhpUvI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ufo2gzjjk9+pz7V+S+2Er1rwzPn7JjWuJ0dWZPvqeOHqc+AqRqTVteSOIHwGIDyOD31wp8hrBAvgG/wrOA0QRh0msEYFsxYn3oynQIDNMDj61that4oh3OU2UCcMAJscApbqRwA3IZMP9/rCEAKkABzzvVRGNN8G7Qmbea++KEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=ONLdQOm0; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="ONLdQOm0" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=MBiF799tS1XTKKBb+cgx7wzKHjzYh+/tYFwc8HgQmQg=; b=ONLdQOm0N/tzF3tx s1Ij7raGrn0g92/9J3eznWbCx2R+1+t21GzH5abDBTTMN+LoSsDoErcBQpU/UfRM/FMSg9SKLBdrw AL33d77AhekdXjL+Z7QG5TqTVAvSpKSKWU6GLyQDkDTblCbGJACnbsXglYDflIOzeomOGOVSEN+c+ rqrbsmxELV4IjT9E8b5znraK44qnyduck3rdD1C+3/BbqNbZ/VxTjhDyNA+0P/5LLEo8X8y457ka4 pjZ6FqQWxMg/bEXjc2JpaNuovoAbg4iSekleoljWo2sOtlXs1VYVHLhRGq/fdVzqHj7DV+y4d7fT6 5CLXQrNnvaQgl19rzA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1sxFwG-009DsK-1v; Sun, 06 Oct 2024 01:20:00 +0000 From: linux@treblig.org To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 5/5] ceph: Remove fs/ceph deadcode Date: Sun, 6 Oct 2024 02:19:56 +0100 Message-ID: <20241006011956.373622-6-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241006011956.373622-1-linux@treblig.org> References: <20241006011956.373622-1-linux@treblig.org> Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ceph_caps_revoking() has been unused since 2017's commit 3fb99d483e61 ("ceph: nuke startsync op") ceph_mdsc_open_export_target_sessions() has been unused since 2013's commit 11df2dfb610d ("ceph: add imported caps when handling cap export message") Remove them. Signed-off-by: Dr. David Alan Gilbert --- fs/ceph/caps.c | 14 -------------- fs/ceph/mds_client.c | 8 -------- fs/ceph/mds_client.h | 2 -- fs/ceph/super.h | 1 - 4 files changed, 25 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index bed34fc11c91..0d6b2c0269bf 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -978,20 +978,6 @@ int __ceph_caps_revoking_other(struct ceph_inode_info *ci, return 0; } -int ceph_caps_revoking(struct ceph_inode_info *ci, int mask) -{ - struct inode *inode = &ci->netfs.inode; - struct ceph_client *cl = ceph_inode_to_client(inode); - int ret; - - spin_lock(&ci->i_ceph_lock); - ret = __ceph_caps_revoking_other(ci, NULL, mask); - spin_unlock(&ci->i_ceph_lock); - doutc(cl, "%p %llx.%llx %s = %d\n", inode, ceph_vinop(inode), - ceph_cap_string(mask), ret); - return ret; -} - int __ceph_caps_used(struct ceph_inode_info *ci) { int used = 0; diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index c4a5fd94bbbb..923635532f03 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1747,14 +1747,6 @@ static void __open_export_target_sessions(struct ceph_mds_client *mdsc, } } -void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc, - struct ceph_mds_session *session) -{ - mutex_lock(&mdsc->mutex); - __open_export_target_sessions(mdsc, session); - mutex_unlock(&mdsc->mutex); -} - /* * session caps */ diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 3dd54587944a..38bb7e0d2d79 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h @@ -634,8 +634,6 @@ extern void ceph_mdsc_handle_fsmap(struct ceph_mds_client *mdsc, extern struct ceph_mds_session * ceph_mdsc_open_export_target_session(struct ceph_mds_client *mdsc, int target); -extern void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc, - struct ceph_mds_session *session); extern int ceph_trim_caps(struct ceph_mds_client *mdsc, struct ceph_mds_session *session, diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 037eac35a9e0..b0b15e87251d 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -796,7 +796,6 @@ extern int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask, extern int __ceph_caps_revoking_other(struct ceph_inode_info *ci, struct ceph_cap *ocap, int mask); -extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask); extern int __ceph_caps_used(struct ceph_inode_info *ci); static inline bool __ceph_is_file_opened(struct ceph_inode_info *ci)