Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp180342imm; Thu, 31 May 2018 21:48:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJGxdUmETSjHNadm4WLA2UqqUGwDie+Ebr4avIxN9f5BIEz60/3G9LWKmq/G+J3BUmqlozl X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr9727801plb.198.1527828480324; Thu, 31 May 2018 21:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527828480; cv=none; d=google.com; s=arc-20160816; b=dhfxyYg36e9laQeT8nMKm30G6aNdRKzBd15+3+UAhmaHtYSCWw+s2Walt23nn49Geo +gRHbnb8LRaHLDKMCKp7+mK5LXfd/w5aGlymWuxLBxNiBzeWiSaQHNa3sLClslpVjdEu 0WlpWft9wMaIWYtKQex1rDKgC8hgw8sXsoIcENfaR6neaskElY+jaaJjhGJAGO48qwAz zui3QzKhiREfNb9adASVx7MB2aip5llbf4Lqho9XXoxcN6iAvQ4qjF+FwRPydUEMcIKE ltdUS6nLJGrpAif1ZLAhdekoiM7SBpA9J4ZD5wZbM00vQXMCAQSImqZwog+/aiq6Cw1p UFQA== 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=463v56RIhNDY5Jn3x3VA4SXC3v7cwlvk5QawwlMDrs8=; b=zB7PHqhnhTzm4fX3t7YUWBDDkJr1Amh4lLAQ9OqmQwh45J7fcv+W9gIZSb0rFLqnrM m3Dl2j69cuMG7c5U+UbT7Wc0ZIOQO/LPenDR8SfPK0fWKtVBbR6DCowlGQr14F7NlFFF oDI1nh5K+B8NwKPFatwh2T1mPv99YNbECKh96TgZx+BQeUPoW58d41wFeQ/Y4Nt/4CS6 eFUIdWWgyYrWGIG6Bm+xgEEBg2k4QBDF4rAxA7MUtgKsOuHt0yslL85iDt6+FaNd+VDi /gUXIGcd7M/ALTGLu4kRQS4dRo2TVjJoF1obBJXro7YbFGdto7SFjqXrzX9qaIuE/2jW QBFw== 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 i61-v6si28672624plb.138.2018.05.31.21.47.45; Thu, 31 May 2018 21:48:00 -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 S1751654AbeFAEqP (ORCPT + 99 others); Fri, 1 Jun 2018 00:46:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:34113 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbeFAEqH (ORCPT ); Fri, 1 Jun 2018 00:46:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 65AC6ADE3; Fri, 1 Jun 2018 04:46:06 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu Date: Fri, 01 Jun 2018 14:44:09 +1000 Subject: [PATCH 10/18] rhashtable: remove rhashtable_walk_peek() Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <152782824964.30340.6329146982899668633.stgit@noble> In-Reply-To: <152782754287.30340.4395718227884933670.stgit@noble> References: <152782754287.30340.4395718227884933670.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. A future patch will introduce a new function with a simpler interface which can meet the same need that this was added for. 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 10435a77b156..4e2fc97667e0 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -247,7 +247,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 86c801d04d4a..120382b0bad0 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -891,40 +891,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