Received: by 10.192.165.148 with SMTP id m20csp305971imm; Thu, 3 May 2018 20:57:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqcM78NpZOHKq7Lcq1DU/j2xOo4184ahH+/Hcw0OPI8JGt/aXuBkxW0RUbOPIGCeZhzNgIj X-Received: by 2002:a17:902:7b97:: with SMTP id w23-v6mr19026943pll.116.1525406231979; Thu, 03 May 2018 20:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525406231; cv=none; d=google.com; s=arc-20160816; b=U7l82MB04SxQNSjF6azNFb9/78l/+IiqzEiRN0i14pLuD28G8lvk1FJIUJjYAzjNSN 1WEY81nLiSWc6MHX00XFM7GTQAu0tKP1WLIKd/j5Oa19Nd2OqLdoTRmF2EWHW3bb9D47 0gowhV8gOJ7x6xobstd0AT9pfUAoS3UJZ3VZ6sc3tVED5PjidWO4ADhP4mEbhUT7XMf5 wU/HfVNkczzYCRoNCQEDex0eYoPKJ7H8Bw4UprlZdsIU1sml3G07E9AcGF4/rfOC91X8 npla6JebUWA1Vm+iMczoOpEZHWj8J7dGuBULd2UclAWnFSTeCt+RCxcBSxrqBU5dHLSI yNPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from:arc-authentication-results; bh=4J4C0AyFqfOnATVIU9M3SjRPoUcrU+H68LGgyccYls4=; b=Zux5lXEoim4Eh16Ph0qUbnqsXhqwWTtzRQae9bUEmzJUfdXZ61us2cBUu4WhlSChmF QUfXooTCZN1HM9gvx/YWR+EIt4UCMhP02GKO/pYy+ccbEUhIWWaKyZQhDoQKjy+cnISw MWx3/Rqpgw0XbRuCOoRYUpC8cm8rMWnzQikLLFUBkIEwZvM+CsDSvf4APeU8uB1SeKFh eRHMZwztNPYGRexgovGe/p3TPo42Gi99ZTtRTDzDYdwwaceOc49+ZKDed2jK06vLQHT9 3l3YQW3+3uSEozE1z18aAZJSonYUIJTNakr7FYZ2Vb7cDSGnwOt3Y3Cfk+NsbGk783Hm /7OA== 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 u71-v6si12566012pgb.332.2018.05.03.20.56.44; Thu, 03 May 2018 20:57:11 -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 S1751563AbeEDDzO (ORCPT + 99 others); Thu, 3 May 2018 23:55:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:44998 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbeEDDzL (ORCPT ); Thu, 3 May 2018 23:55:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 91E49ABB2; Fri, 4 May 2018 03:55:10 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu Date: Fri, 04 May 2018 13:54:14 +1000 Subject: [PATCH 5/8] rhashtable: remove rhashtable_walk_peek() Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <152540605435.18473.12657571579874985957.stgit@noble> In-Reply-To: <152540595840.18473.11298241115621799037.stgit@noble> References: <152540595840.18473.11298241115621799037.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function has a somewhat confused behavior that is not properly described by the documentation. Sometimes is returns the previous object, sometimes it returns the next one. Sometimes it changes the iterator, sometimes it doesn't. This function is not currently used and is not worth keeping, so remove it. Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 1 - lib/rhashtable.c | 34 ---------------------------------- 2 files changed, 35 deletions(-) diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 8822924dd05a..5091abf975a1 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -366,7 +366,6 @@ static inline void rhashtable_walk_start(struct rhashtable_iter *iter) } void *rhashtable_walk_next(struct rhashtable_iter *iter); -void *rhashtable_walk_peek(struct rhashtable_iter *iter); void rhashtable_walk_stop(struct rhashtable_iter *iter) __releases(RCU); void rhashtable_free_and_destroy(struct rhashtable *ht, diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 114e6090228a..83f5d1ebf452 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -897,40 +897,6 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter) } EXPORT_SYMBOL_GPL(rhashtable_walk_next); -/** - * rhashtable_walk_peek - Return the next object but don't advance the iterator - * @iter: Hash table iterator - * - * Returns the next object or NULL when the end of the table is reached. - * - * Returns -EAGAIN if resize event occurred. Note that the iterator - * will rewind back to the beginning and you may continue to use it. - */ -void *rhashtable_walk_peek(struct rhashtable_iter *iter) -{ - struct rhlist_head *list = iter->list; - struct rhashtable *ht = iter->ht; - struct rhash_head *p = iter->p; - - if (p) - return rht_obj(ht, ht->rhlist ? &list->rhead : p); - - /* No object found in current iter, find next one in the table. */ - - if (iter->skip) { - /* A nonzero skip value points to the next entry in the table - * beyond that last one that was found. Decrement skip so - * we find the current value. __rhashtable_walk_find_next - * will restore the original value of skip assuming that - * the table hasn't changed. - */ - iter->skip--; - } - - return __rhashtable_walk_find_next(iter); -} -EXPORT_SYMBOL_GPL(rhashtable_walk_peek); - /** * rhashtable_walk_stop - Finish a hash table walk * @iter: Hash table iterator