From patchwork Tue Nov 17 11:52:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7636071 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3271DBF90C for ; Tue, 17 Nov 2015 11:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C54B204FC for ; Tue, 17 Nov 2015 11:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64206204EA for ; Tue, 17 Nov 2015 11:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515AbbKQLxh (ORCPT ); Tue, 17 Nov 2015 06:53:37 -0500 Received: from mail-qg0-f41.google.com ([209.85.192.41]:34632 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427AbbKQLx2 (ORCPT ); Tue, 17 Nov 2015 06:53:28 -0500 Received: by qgeb1 with SMTP id b1so3408693qge.1 for ; Tue, 17 Nov 2015 03:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds_net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NY+vzPE2ICwCiL4ldm5pVIwi7TkACXlTAU/DoVTppic=; b=oMqqnY8tADYVTFBz4w4FK4FxSnmTkASxlgvi0Q9+TGxfAeClxzDRyk/Djfz/Cx4Dtf FTnR44g44qtuJTkghYOIclgIrOykDT7w8PIqith/KsKb8ihH75cOKziGBEn+NK1tb3Yb feO0Ot4sc4bhfu+gz4D9ELW7x1SOZFmn4Kuk4OdORieGy8tgPD6Xf0FGG4U5ylKGLtLQ +dMIK7mduJ+eLFoCK8gpVZRYltNc+AKy70NE6PBpRdxs/NH07kEuy6xtnTRxzXCJ45J9 nAequcTNKT6+sQCzxxjNvUkLgZhtzE8fGn63m0JVa2m1uNuU3p4lAfB9hfpLZySgkyID 4hyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NY+vzPE2ICwCiL4ldm5pVIwi7TkACXlTAU/DoVTppic=; b=eqFqk4PR6MruXcKMxisMBk/p0JaFVTbylUAjYFO0pmtHjjGhcCC/qs4I1mGGQR9DTl gbdXJWJplnUqqqXGEN6ngjJXVJLXnZ6DByfeEN4nk66Uxp/Q4Sqrs0YdZ+7D+lhnvx2M 9NBuzv3nKq1edzD+oYD4YK67le7QtwXzFsRETnfBkd2k1c841g5QXD3Nb+ID0X/6mFs2 CyrpbJUDtnWslGIZXucLxCOl0b2EDT+7Z7RjIDBiwlUY2hUFzqgVTppg43Qg40Gy3H6Y q5VG9is2kS5tHAeVRr5dbs+UDSEE0HKwY+jqn/FRdA577PBTf5KRTxrryojbqHZytZOm z6UQ== X-Gm-Message-State: ALoCoQnqtvu3f1GOt5iWH/cn0MP+sqcWPjsZs/l827wbokgNk+NqICFBK2N67Z7dSkJe14h393rf X-Received: by 10.140.101.130 with SMTP id u2mr20606055qge.2.1447761207060; Tue, 17 Nov 2015 03:53:27 -0800 (PST) Received: from tlielax.poochiereds.net ([2606:a000:1125:4075::d5a]) by smtp.googlemail.com with ESMTPSA id w10sm1583910qhc.16.2015.11.17.03.53.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Nov 2015 03:53:26 -0800 (PST) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org, trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Eric Paris , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH v1 09/38] fsnotify: add a srcu barrier for fsnotify Date: Tue, 17 Nov 2015 06:52:31 -0500 Message-Id: <1447761180-4250-10-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1447761180-4250-1-git-send-email-jeff.layton@primarydata.com> References: <1447761180-4250-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For nfsd, we'll need to be able to ensure that all fsnotify_mark callbacks have run before we can tear down the nfsd_file_mark_cache. That's simple now that we're using call_srcu directly. Just use srcu_barrier to ensure that all the callbacks have completed. Signed-off-by: Jeff Layton --- fs/notify/mark.c | 7 +++++++ include/linux/fsnotify_backend.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 00e7072d3c95..6b6b99447348 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -204,6 +204,13 @@ void fsnotify_free_mark(struct fsnotify_mark *mark) group->ops->freeing_mark(mark, group); } +void +fsnotify_srcu_barrier(void) +{ + srcu_barrier(&fsnotify_mark_srcu); +} +EXPORT_SYMBOL_GPL(fsnotify_srcu_barrier); + void fsnotify_destroy_mark(struct fsnotify_mark *mark, struct fsnotify_group *group) { diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 1c582747b410..b211eda20842 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -360,6 +360,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark, extern void fsnotify_detach_mark(struct fsnotify_mark *mark); /* free mark */ extern void fsnotify_free_mark(struct fsnotify_mark *mark); +/* wait for all in-flight fsnotify srcu callbacks to run */ +extern void fsnotify_srcu_barrier(void); /* run all the marks in a group, and clear all of the vfsmount marks */ extern void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group); /* run all the marks in a group, and clear all of the inode marks */