From patchwork Wed Mar 29 10:56:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9651227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70466602BE for ; Wed, 29 Mar 2017 10:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F23B22638 for ; Wed, 29 Mar 2017 10:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6409F22B1F; Wed, 29 Mar 2017 10:57:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE9824B44 for ; Wed, 29 Mar 2017 10:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932132AbdC2K5H (ORCPT ); Wed, 29 Mar 2017 06:57:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:33822 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932125AbdC2K4d (ORCPT ); Wed, 29 Mar 2017 06:56:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 56A37ADBE; Wed, 29 Mar 2017 10:56:30 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 526291E128F; Wed, 29 Mar 2017 12:56:26 +0200 (CEST) From: Jan Kara To: Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jan Kara , Miklos Szeredi Subject: [PATCH 17/25] fuse: Get rid of bdi_initialized Date: Wed, 29 Mar 2017 12:56:15 +0200 Message-Id: <20170329105623.18241-18-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170329105623.18241-1-jack@suse.cz> References: <20170329105623.18241-1-jack@suse.cz> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is not needed anymore since bdi is initialized whenever superblock exists. CC: Miklos Szeredi CC: linux-fsdevel@vger.kernel.org Suggested-by: Miklos Szeredi Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig --- fs/fuse/dev.c | 5 ++--- fs/fuse/fuse_i.h | 3 --- fs/fuse/inode.c | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 78887f68ee6a..c2d7f3a92679 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -382,7 +382,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) wake_up(&fc->blocked_waitq); if (fc->num_background == fc->congestion_threshold && - fc->connected && fc->bdi_initialized) { + fc->connected && fc->sb) { clear_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC); clear_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC); } @@ -573,8 +573,7 @@ void fuse_request_send_background_locked(struct fuse_conn *fc, fc->num_background++; if (fc->num_background == fc->max_background) fc->blocked = 1; - if (fc->num_background == fc->congestion_threshold && - fc->bdi_initialized) { + if (fc->num_background == fc->congestion_threshold && fc->sb) { set_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC); set_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC); } diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 0e7c79a390e0..f33341d9501a 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -527,9 +527,6 @@ struct fuse_conn { /** Filesystem supports NFS exporting. Only set in INIT */ unsigned export_support:1; - /** Set if bdi is valid */ - unsigned bdi_initialized:1; - /** write-back cache policy (default is write-through) */ unsigned writeback_cache:1; diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 90bacbc87fb3..73cf05135252 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -983,8 +983,6 @@ static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb) /* fuse does it's own writeback accounting */ sb->s_bdi->capabilities = BDI_CAP_NO_ACCT_WB | BDI_CAP_STRICTLIMIT; - fc->bdi_initialized = 1; - /* * For a single fuse filesystem use max 1% of dirty + * writeback threshold.