From patchwork Tue Sep 5 19:37:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Wareing X-Patchwork-Id: 9939567 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 3A43C604D3 for ; Tue, 5 Sep 2017 19:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D086289FC for ; Tue, 5 Sep 2017 19:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21DF628A00; Tue, 5 Sep 2017 19:37:49 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 1452B289FC for ; Tue, 5 Sep 2017 19:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753041AbdIEThq (ORCPT ); Tue, 5 Sep 2017 15:37:46 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:59921 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbdIEThp (ORCPT ); Tue, 5 Sep 2017 15:37:45 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v85JbZKk010558 for ; Tue, 5 Sep 2017 12:37:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=wZ4j5jhzzWQ+9ghO24ZBAvGeIZZDKF8CWOyHMEdbe6Q=; b=LARWQ/UF7F/YzWZxRm/B02bM4h8MHprV1zXC0+y5QiyVT0kA6Hd6w/AON7dfnkpGnFCQ RgyHd4uRu4jENFCS935wc1yH8YSDFL+i19D2YWS5QvgVHco3ja15MjTJVQYxqSWytb/K Zzy5JSUxmajxjK/8qKR8mmqz0Ui9EXgQ6Yo= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2csyw3gn67-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Sep 2017 12:37:44 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB03.TheFacebook.com (192.168.16.13) with Microsoft SMTP Server id 14.3.319.2; Tue, 5 Sep 2017 12:37:44 -0700 Received: from devbig279.prn1.facebook.com (localhost [127.0.0.1]) by devbig279.prn1.facebook.com (Postfix) with ESMTP id 54A813620AED; Tue, 5 Sep 2017 12:37:43 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Richard Wareing Smtp-Origin-Hostname: devbig279.prn1.facebook.com To: CC: Richard Wareing , , , Smtp-Origin-Cluster: prn1c29 Subject: [PATCH v3 2/3] fs/xfs: Add real-time device support to statfs Date: Tue, 5 Sep 2017 12:37:30 -0700 Message-ID: <20170905193731.909535-3-rwareing@fb.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170905193731.909535-1-rwareing@fb.com> References: <20170905193731.909535-1-rwareing@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-05_07:, , signatures=0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Reports real-time device free blocks in statfs calls if inheritance bit is set on the inode of directory. This is a bit more intuitive, especially for use-cases which are using a much larger device for the real-time device. Signed-off-by: Richard Wareing --- fs/xfs/xfs_super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 4dbf95c..de6acc4 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1148,6 +1148,12 @@ xfs_fs_statfs( ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD)) xfs_qm_statvfs(ip, statp); + if ((ip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) && mp->m_rtdev_targp) { + statp->f_blocks = sbp->sb_rblocks; + statp->f_bavail = statp->f_bfree = + sbp->sb_frextents * sbp->sb_rextsize - + mp->m_alloc_set_aside; + } return 0; }