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: 7636041 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 271029F1D3 for ; Tue, 17 Nov 2015 11:53:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F01720501 for ; Tue, 17 Nov 2015 11:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 747B7204FC for ; Tue, 17 Nov 2015 11:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753274AbbKQLxh (ORCPT ); Tue, 17 Nov 2015 06:53:37 -0500 Received: from mail-qg0-f54.google.com ([209.85.192.54]:36050 "EHLO mail-qg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753434AbbKQLx2 (ORCPT ); Tue, 17 Nov 2015 06:53:28 -0500 Received: by qgad10 with SMTP id d10so3408166qga.3 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=OhrsKcR6qD63jFZyTxWLox8cn+eWis/IM3dFkVVoztUlri/jOJ1zAFB0vFBUlAXI7l kGY2nT2/8N636oTxRPjUrAwMyCLqU9tYWC+ykGrZX7yW29WWQv0BZ/SYcpSF2IaPfAX8 p64Y2ZUAB3JIzRaxx3C8QvangiosaGsxwGbRWk0N4g5usPOaXNF7WvZ/COZ7SXqauajG QN4uOaY8H3oAc3G8hDSO1k6cuwY7bgWKGYbUTSLSDWq6dKIIqrCw335sPcllJ94feSYC YvBGJMCrVNcvCE37RtdYJJWlkOgGytRCFJ+h5liqdvPXV6g/qwwYDSfCby8Ydou9UMDZ 5diA== X-Gm-Message-State: ALoCoQnDeiooeHL3R1DisHBnGpgEzr4B2QnTzCWmDqm/n0B0i7sA+WOcxlmNPjYTqzTJE8CWRnKV 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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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 */