From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751521AbcBBBug (ORCPT ); Mon, 1 Feb 2016 20:50:36 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58562 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751006AbcBBBuf (ORCPT ); Mon, 1 Feb 2016 20:50:35 -0500 From: Shaohua Li To: CC: , , Subject: [PATCH] block-dev: enable writeback cgroup support Date: Mon, 1 Feb 2016 17:50:33 -0800 Message-ID: X-Mailer: git-send-email 2.4.6 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-02-02_01:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org block_dev's .writepages/.writepage already handles wbc_init_bio/wbc_account_io. We only set the SB_I_CGROUPWB bit to suppport writeback cgroup support. Signed-off-by: Shaohua Li --- fs/block_dev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 7b9cd49..548ded7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -575,7 +575,11 @@ static const struct super_operations bdev_sops = { static struct dentry *bd_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { - return mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC); + struct dentry *dent; + dent = mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC); + if (dent) + dent->d_sb->s_iflags |= SB_I_CGROUPWB; + return dent; } static struct file_system_type bd_type = { -- 2.4.6