Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7216212ybc; Thu, 28 Nov 2019 13:14:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzAvfIThZRH3skKgHtMFLQvGNHK3nCrspqZDseLjI0pE1B6Lk42TaHpU968zLgviENf71+J X-Received: by 2002:a50:e619:: with SMTP id y25mr40977428edm.204.1574975670329; Thu, 28 Nov 2019 13:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574975670; cv=none; d=google.com; s=arc-20160816; b=I3BavvJYaaKQXUGTntA3OdC7uSGtm7IiTqkOhbT/8xudz6bCyQv0k2y6U1qyyMfXey f7Dr7Y4qzg8E0MkZggTKg2UfCuDt83/wvgX34TaPbkui8yRsLDMx9HLGucJRg83Q3FrV S23LcpkfQN8lqKOelLTsBWE5N0FenUarR9UZcmgdYDGV9eAKPFHofmMe6+yRHmpRLMHe jpONi2k9bjP+KhWWM+md47vBaXvZ+YKcIT3NINw3cdRuR5Qz1iEcRVKSByqdFGMSIhJJ DWCXKpsNJdMSdVT/ihHomgg9dECfFgerv8QFiYPiDdFHBZyMXCxEKwUY9aXZRKXvkNAY lWEg== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Lg7L77IP4bx5QKviUaKZB+T2xlEmOdr7ElK44pBo7WA=; b=qncEmYIXsXAUv8rp924IwthQfg5BbX9sh9OaYu2qo5H4vRsUgd8bHPqL3fYquhVcEk 4WrAj7X4Hk2kXkJLy3hbjMWFwhrEr2MUIA8cyH28i4PGBo3aSnp7G+QTc7OPacKySaEf 0tDfW9EBJ20TY+woGaNlhYRzPy/gp/YJkVcSi9iCqjJBmPrTrpz4tBSbtApO6E2LV5m/ vl4shNN0GV17xkxQw1e+cM3BYOQiMSTgNJK/xeB7hjES9rs6Jf1UvF463F5F9CsFvlow jRXRSqROc1lrQpN0FXxgd89SHE7E7r+gPWcD1fkdmf8lr0LNrDD2zYtu2TbejtAkM5ul 2XZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X8vfNFSy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u24si12434902ejb.93.2019.11.28.13.14.02; Thu, 28 Nov 2019 13:14:30 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X8vfNFSy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfK1VM0 (ORCPT + 99 others); Thu, 28 Nov 2019 16:12:26 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42033 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfK1VMZ (ORCPT ); Thu, 28 Nov 2019 16:12:25 -0500 Received: by mail-wr1-f66.google.com with SMTP id a15so32647563wrf.9; Thu, 28 Nov 2019 13:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Lg7L77IP4bx5QKviUaKZB+T2xlEmOdr7ElK44pBo7WA=; b=X8vfNFSy73lLY1V6LiT2zN+ER6oI601XUGtHVkH1zsQ/ca6cHz+Ma9znwE+QeDm6eJ XeQyKxNr4YYJIf632sihj6wyRB7LcgIMtBRCoBpO88NzSx8h+zSTJ3J1B0N6QLdkGozw 7y3ux5z4sflj2Xjo7XSREL2Illbc1C7bX8b0KmoZsaYogQ1ECD7ttBjWT3/9bHCMFjnX sbTVySr29u+1Pbb/k93zTan11Sbpr2J2vZ1eoq33ZRZBPBEL47jvN+sMcLstRNdF2d16 7zX9+1FKUNocz/APdluQxW0nsVEw6c6N8p/5SaXf4KHNarEDnCADy92tfCMHUuE6lki3 9MUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lg7L77IP4bx5QKviUaKZB+T2xlEmOdr7ElK44pBo7WA=; b=FqcfrBRCZ4K5U68qkwaWP00Qfi8pG+4EFmxsSTIXBADjLZfNlO7hhdvfaFjJc1u83E GCBi3inz54yXrGUxqnB3rMAEBQgqWeivTf8dZmgBllYPQ6Vn6SvNC9fMf7YQYIb+gx/o xC+Of8DjvNJKH/9AVw2kBQZkXPL7VGpAi0jnJMGaNLxvGGqts7P9xZCdzYwYiEOyEi5R zVC255HFQGrUAdO5B/9f4PVg1fP43OI1yNI7l4vQBo+KRb7d5VXxND7sm3yIk7/8g93c ScaohYMLPiQGZ6FhJPzcore2+xcRY8u7dGSbBMDuw9kY/T1xJyo6Z/um9e/lkDSd1pPC cM9g== X-Gm-Message-State: APjAAAWYRM7pq7ZvautQcDQAhJmbmrwsQ6aVgB9jdH1bFjaSfJ5BnG9E iPrdhreFLlyqufnjno1JjoFui5gI X-Received: by 2002:a5d:6887:: with SMTP id h7mr19806568wru.397.1574975541563; Thu, 28 Nov 2019 13:12:21 -0800 (PST) Received: from localhost.localdomain ([109.126.143.74]) by smtp.gmail.com with ESMTPSA id l26sm11620809wmj.48.2019.11.28.13.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 13:12:21 -0800 (PST) From: Pavel Begunkov To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] list: introduce list_for_each_continue() Date: Fri, 29 Nov 2019 00:11:54 +0300 Message-Id: <2b54707c0640114d24a3e08f57fce2576e05bd27.1574974577.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As other *continue() helpers, this continues iteration from a given position. Signed-off-by: Pavel Begunkov --- include/linux/list.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index 85c92555e31f..3c391bbd03c3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -538,6 +538,16 @@ static inline void list_splice_tail_init(struct list_head *list, #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) +/** + * list_for_each_continue - continue iteration over a list + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + * + * Continue to iterate over a list, continuing after the current position. + */ +#define list_for_each_continue(pos, head) \ + for (pos = pos->next; pos != (head); pos = pos->next) + /** * list_for_each_prev - iterate over a list backwards * @pos: the &struct list_head to use as a loop cursor. -- 2.24.0