From patchwork Mon Oct 5 11:02:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7326641 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 82CCBBEEA4 for ; Mon, 5 Oct 2015 11:04:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B206B206E9 for ; Mon, 5 Oct 2015 11:04:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA378206F8 for ; Mon, 5 Oct 2015 11:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751024AbbJELEL (ORCPT ); Mon, 5 Oct 2015 07:04:11 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:32910 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbbJELCy (ORCPT ); Mon, 5 Oct 2015 07:02:54 -0400 Received: by qgev79 with SMTP id v79so145480500qge.0 for ; Mon, 05 Oct 2015 04:02:53 -0700 (PDT) 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=kaKg6KCGE8H8G5SRQ9Fp0XRqFUqU6uuoWe6eg53jQyY=; b=l76YKlUMnh3hVvR/0B6tlEcQ4mTAegU9lNjRbxm/cqchqOX9y12jckMRTyXBNnFFzU TCsFz6Q84x81aclO5BGdo0Tqnt0dsGy+XENkQJZMZGiwFaaSqJ8h/x4eHwYd443BlcQg wAbt1EuYbiz0EqOAnKP8RuH6pzllhgdz+nV4wXT/y+mHAW++NtiGc7jZjxZdqVXZ8TEp EnB1mcSwi2O2UdHaEHrJgJMB094iOQQZKpn+JZC1+pGqEHstcJXmoCILDRI9MKMoqW+c zdfWLNHkcBFV22VJ3IF7nk6jOKQoehGK73Etbs8g1XrUa8aikSS3rr4fqCy9ld2QVlQn JcAA== X-Gm-Message-State: ALoCoQmwyA/EGGGI51k/wJtccEAdYkSj+Bm1TV9r4cB364erjO9hz6SrGe64hpdtg5abh28bdiSm X-Received: by 10.140.148.203 with SMTP id 194mr40321191qhu.102.1444042973468; Mon, 05 Oct 2015 04:02:53 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:6079::d5a]) by smtp.googlemail.com with ESMTPSA id p39sm4977719qkp.47.2015.10.05.04.02.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 04:02:52 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro Subject: [PATCH v5 05/20] fs: export flush_delayed_fput Date: Mon, 5 Oct 2015 07:02:27 -0400 Message-Id: <1444042962-6947-6-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444042962-6947-1-git-send-email-jeff.layton@primarydata.com> References: <1444042962-6947-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 ...and clean up the comments over it a bit. The nfsd code will need to be able to call back into this. Signed-off-by: Jeff Layton --- fs/file_table.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 95361d2b8a08..899c19687cfa 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -246,20 +246,24 @@ static void ____fput(struct callback_head *work) static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput); -/* - * If kernel thread really needs to have the final fput() it has done - * to complete, call this. The only user right now is the boot - we - * *do* need to make sure our writes to binaries on initramfs has - * not left us with opened struct file waiting for __fput() - execve() - * won't work without that. Please, don't add more callers without - * very good reasons; in particular, never call that with locks - * held and never call that from a thread that might need to do - * some work on any kind of umount. +/** + * flush_delayed_fput - ensure that all delayed_fput work is complete + * + * If kernel thread or task that has used fput_queue really needs to have the + * final fput() it has done to complete, call this. One of the main users is + * the boot - we *do* need to make sure our writes to binaries on initramfs has + * not left us with opened struct file waiting for __fput() - execve() won't + * work without that. + * + * Please, don't add more callers without very good reasons; in particular, + * never call that with locks held and never from a thread that might need to + * do some work on any kind of umount. */ void flush_delayed_fput(void) { flush_delayed_work(&delayed_fput_work); } +EXPORT_SYMBOL(flush_delayed_fput); /** * fput - put a struct file reference