From patchwork Mon Sep 18 15:52:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Czerner X-Patchwork-Id: 9957027 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 5587F6039A for ; Mon, 18 Sep 2017 15:53:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4667328CCE for ; Mon, 18 Sep 2017 15:53:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B55428D1C; Mon, 18 Sep 2017 15:53:19 +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=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 D993628CCE for ; Mon, 18 Sep 2017 15:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754383AbdIRPxM (ORCPT ); Mon, 18 Sep 2017 11:53:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54136 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755368AbdIRPxE (ORCPT ); Mon, 18 Sep 2017 11:53:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36DCA81DEB; Mon, 18 Sep 2017 15:53:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 36DCA81DEB Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lczerner@redhat.com Received: from rh_laptop.brq.redhat.com (unknown [10.43.17.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6013C5D6A8; Mon, 18 Sep 2017 15:53:03 +0000 (UTC) From: Lukas Czerner To: linux-fsdevel@vger.kernel.org Cc: Lukas Czerner , linux-xfs@vger.kernel.org Subject: [PATCH 4/7] xfs: Implement fallocate query support mode Date: Mon, 18 Sep 2017 17:52:24 +0200 Message-Id: <1505749947-26360-5-git-send-email-lczerner@redhat.com> In-Reply-To: <1505749947-26360-1-git-send-email-lczerner@redhat.com> References: <1505749947-26360-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 18 Sep 2017 15:53:04 +0000 (UTC) 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 Return all fallcoate modes supported by xfs file system. Cc: linux-xfs@vger.kernel.org Signed-off-by: Lukas Czerner Acked-by: OGAWA Hirofumi --- fs/xfs/xfs_file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index ebdd0bd..85e06c6 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -746,7 +746,8 @@ xfs_file_write_iter( #define XFS_FALLOC_FL_SUPPORTED \ (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE | \ FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE | \ - FALLOC_FL_INSERT_RANGE | FALLOC_FL_UNSHARE_RANGE) + FALLOC_FL_INSERT_RANGE | FALLOC_FL_UNSHARE_RANGE | \ + FALLOC_FL_QUERY_SUPPORT | FALLOC_FL_PREALLOC_RANGE) STATIC long xfs_file_fallocate( @@ -768,6 +769,9 @@ xfs_file_fallocate( if (mode & ~XFS_FALLOC_FL_SUPPORTED) return -EOPNOTSUPP; + if (mode & FALLOC_FL_QUERY_SUPPORT) + return XFS_FALLOC_FL_SUPPORTED; + xfs_ilock(ip, iolock); error = xfs_break_layouts(inode, &iolock); if (error)