From patchwork Sat Mar 18 01:26:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Owens X-Patchwork-Id: 9631913 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 BED4E60245 for ; Sat, 18 Mar 2017 01:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A24842836D for ; Sat, 18 Mar 2017 01:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84CAE28511; Sat, 18 Mar 2017 01:27:11 +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 DF6542836D for ; Sat, 18 Mar 2017 01:27:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751072AbdCRB1J (ORCPT ); Fri, 17 Mar 2017 21:27:09 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:56180 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbdCRB1I (ORCPT ); Fri, 17 Mar 2017 21:27:08 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2I1PDeC004507 for ; Fri, 17 Mar 2017 18:26:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=K/7/9LyJqRSdX3q/Cmfrk+wpevECxHuIMGlYhhfvGIs=; b=SMQ2Jt3BaltKk1HHG+M8B/vO/36QMrxwn2EMLxFies/vj67Zi+BHlgO0hbfxWccZJ2Mr sHVTNayogdLOYOQhrQfAlFC+EuVkkJNkbyV693pSXgc26X5HvN6aP6mqc7V/s02oNTGO JPIxn9tn0Dx8o+60jxSVprvBvM9NGWpCzzA= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 298nhuh6e7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 17 Mar 2017 18:26:16 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB06.TheFacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 17 Mar 2017 18:26:14 -0700 Received: from facebook.com (2401:db00:11:d0be:face:0:1b:0) by mx-out.facebook.com (10.102.107.97) with ESMTP id e0a741f00b7911e7be760002c99331b0-e2dc79a0 for ; Fri, 17 Mar 2017 18:26:14 -0700 Received: by devbig337.prn1.facebook.com (Postfix, from userid 10532) id 8D1FA65C12B2; Fri, 17 Mar 2017 18:26:14 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Calvin Owens Smtp-Origin-Hostname: devbig337.prn1.facebook.com To: CC: , Smtp-Origin-Cluster: prn1c29 Subject: [PATCH][PROGS] xfs_io: Allow setting multiple mode flags for fallocate() Date: Fri, 17 Mar 2017 18:26:09 -0700 Message-ID: X-Mailer: git-send-email 2.9.3 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-03-17_21:, , 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 This allows testing FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE. Signed-off-by: Calvin Owens --- io/prealloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/io/prealloc.c b/io/prealloc.c index a9d66cc..2a4bcdc 100644 --- a/io/prealloc.c +++ b/io/prealloc.c @@ -201,19 +201,19 @@ fallocate_f( while ((c = getopt(argc, argv, "cikpu")) != EOF) { switch (c) { case 'c': - mode = FALLOC_FL_COLLAPSE_RANGE; + mode |= FALLOC_FL_COLLAPSE_RANGE; break; case 'i': - mode = FALLOC_FL_INSERT_RANGE; + mode |= FALLOC_FL_INSERT_RANGE; break; case 'k': - mode = FALLOC_FL_KEEP_SIZE; + mode |= FALLOC_FL_KEEP_SIZE; break; case 'p': - mode = FALLOC_FL_PUNCH_HOLE; + mode |= FALLOC_FL_PUNCH_HOLE; break; case 'u': - mode = FALLOC_FL_UNSHARE_RANGE; + mode |= FALLOC_FL_UNSHARE_RANGE; break; default: command_usage(&falloc_cmd);