From patchwork Tue May 14 00:59:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiyong Wu X-Patchwork-Id: 2561621 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8365BDF2E5 for ; Tue, 14 May 2013 01:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755914Ab3ENA7X (ORCPT ); Mon, 13 May 2013 20:59:23 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:52884 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755778Ab3ENA7U (ORCPT ); Mon, 13 May 2013 20:59:20 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 May 2013 20:59:19 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 May 2013 20:59:18 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id AA0656E803C; Mon, 13 May 2013 20:59:14 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4E0xHbG64422036; Mon, 13 May 2013 20:59:17 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4E0xGq9004680; Mon, 13 May 2013 21:59:17 -0300 Received: from us.ibm.com (f17.cn.ibm.com [9.115.122.140]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id r4E0xBuD004479; Mon, 13 May 2013 21:59:12 -0300 Received: by us.ibm.com (sSMTP sendmail emulation); Tue, 14 May 2013 09:00:12 +0800 From: zwu.kernel@gmail.com To: viro@zeniv.linux.org.uk Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, sekharan@us.ibm.com, linuxram@us.ibm.com, david@fromorbit.com, dsterba@suse.cz, gregkh@linuxfoundation.org, paulmck@linux.vnet.ibm.com, chris.mason@fusionio.com, Zhi Yong Wu Subject: [PATCH v2 05/12] VFS hot tracking, rcu: introduce one rcu macro for list Date: Tue, 14 May 2013 08:59:37 +0800 Message-Id: <1368493184-5939-6-git-send-email-zwu.kernel@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1368493184-5939-1-git-send-email-zwu.kernel@gmail.com> References: <1368493184-5939-1-git-send-email-zwu.kernel@gmail.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13051400-9360-0000-0000-000012276249 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Zhi Yong Wu This rcu macro for list will be used in seq_list rcu interfaces. Signed-off-by: Chandra Seetharaman Signed-off-by: Zhi Yong Wu --- include/linux/rculist.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 8089e35..a3fa055 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h @@ -218,6 +218,11 @@ static inline void list_splice_init_rcu(struct list_head *list, at->prev = last; } +#define __list_for_each_rcu(pos, head) \ + for (pos = rcu_dereference(list_next_rcu(head)); \ + pos != head; \ + pos = rcu_dereference(list_next_rcu(pos))) + /** * list_entry_rcu - get the struct for this entry * @ptr: the &struct list_head pointer.