Return-Path: Received: from mx141.netapp.com ([216.240.21.12]:56103 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935370AbbI2SFg (ORCPT ); Tue, 29 Sep 2015 14:05:36 -0400 From: Anna Schumaker To: , , , , , , , , , , Subject: [PATCH v4 9/9] btrfs: btrfs_copy_file_range() only supports reflinks Date: Tue, 29 Sep 2015 14:05:12 -0400 Message-ID: <1443549913-8091-10-git-send-email-Anna.Schumaker@Netapp.com> In-Reply-To: <1443549913-8091-1-git-send-email-Anna.Schumaker@Netapp.com> References: <1443549913-8091-1-git-send-email-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-nfs-owner@vger.kernel.org List-ID: Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4311554..2e14b91 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "ctree.h" #include "disk-io.h" #include "transaction.h" @@ -3848,6 +3849,9 @@ ssize_t btrfs_copy_file_range(struct file *file_in, loff_t pos_in, { ssize_t ret; + if (!(flags & COPY_FR_REFLINK)) + return -EOPNOTSUPP; + ret = btrfs_clone_files(file_out, file_in, pos_in, len, pos_out); if (ret == 0) ret = len; -- 2.5.3