Received: by 10.192.165.148 with SMTP id m20csp1001309imm; Sat, 5 May 2018 02:43:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFizQYkqOBxqFp9J7xrYItr56Ga/e2ofc5fd4FwjYl9J5AV89mCqYHR1kCDwO2gyjMDDsb X-Received: by 2002:a17:902:7c94:: with SMTP id y20-v6mr31242465pll.56.1525513434750; Sat, 05 May 2018 02:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525513434; cv=none; d=google.com; s=arc-20160816; b=FL4zaWIaIqINE2/oMPVKIHKojdH9Xgbj0TtKnw4cJzQgA0VEgv42wjzgvCt5gCZ/u0 z5xOpewOx9ejNEMG5bvoedAAh0A36fteuKQKuaQxCsYWwntbO/quzIQb4Zlb5LVpVaFA 7/ZZ7lsOi642bV2dD9hWtZD0NIxUT1dcqMXoWWLvq5aq2xpGSpnck9B6lw2UmGE/I/Yh eaHNZ0cwod2DXgXrydAMBv6swwj5vxCNTRiHuS5vNgnXaCR6FgR8CbkY5vXbyX0+e7eS F4ysjHGrY8gbFBCpFfwioelnS/u3xlecepzPCckR7gyIwDLtOmnVZePqLRS0JF5KSXK+ biWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ME8/3/57KKATCKjs6kdvn64RWU/DpFnr7xnMMBoWrUI=; b=RZakKLBsRoZaPPfeOV7YBA6WPL+b4s3ZhAtG8CPFyRHxCLjMX9yY+wu833Ij3N7Br2 v0GqD7mPbFpEOX9qww2WYMiFUh3d5ZE4vffob/QvrLcwcPLhPEOnVC4JlZ0QnivskOrh EPvuACXz48SsVha4ZuMLGnxFfnGjdf8wQ70yCZW3SlI0XSbQ3QKGfLoXJOAm4x0PSdI5 qApycSN0Q4oJgDETJPUSE4GKNNgiDpBGyeuvlG0+X8qiKJWXMoHBPEnnwdJPFxOerYNz UdUaEN3EievZG3dZITZd31Pudry59f99eB+uZ7EwO1oZiPuntMWDIbKVIc0Ae1O3hqKA GLRw== 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 b10-v6si17759661plb.177.2018.05.05.02.43.40; Sat, 05 May 2018 02:43:54 -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 S1751774AbeEEJna (ORCPT + 99 others); Sat, 5 May 2018 05:43:30 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:35454 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbeEEJn3 (ORCPT ); Sat, 5 May 2018 05:43:29 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fEtiv-00024A-Go; Sat, 05 May 2018 17:43:25 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fEtiv-0005zx-1q; Sat, 05 May 2018 17:43:25 +0800 Date: Sat, 5 May 2018 17:43:25 +0800 From: Herbert Xu To: NeilBrown Cc: Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Herbert Subject: Re: [PATCH 7/8] rhashtable: add rhashtable_walk_prev() Message-ID: <20180505094324.wwjtl76oofgrtpg4@gondor.apana.org.au> References: <152540595840.18473.11298241115621799037.stgit@noble> <152540605441.18473.4087381584733882012.stgit@noble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152540605441.18473.4087381584733882012.stgit@noble> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 01:54:14PM +1000, NeilBrown wrote: > rhashtable_walk_prev() returns the object returned by > the previous rhashtable_walk_next(), providing it is still in the > table (or was during this grace period). > This works even if rhashtable_walk_stop() and rhashtable_talk_start() > have been called since the last rhashtable_walk_next(). > > If there have been no calls to rhashtable_walk_next(), or if the > object is gone from the table, then NULL is returned. > > This can usefully be used in a seq_file ->start() function. > If the pos is the same as was returned by the last ->next() call, > then rhashtable_walk_prev() can be used to re-establish the > current location in the table. If it returns NULL, then > rhashtable_walk_next() should be used. > > Signed-off-by: NeilBrown I will ack this if Tom is OK with replacing peek with it. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt