From patchwork Sat Oct 24 23:17:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 7480711 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 59571BF90C for ; Sat, 24 Oct 2015 15:30:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 824A5206EF for ; Sat, 24 Oct 2015 15:30:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91D71207DB for ; Sat, 24 Oct 2015 15:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbJXPaZ (ORCPT ); Sat, 24 Oct 2015 11:30:25 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34904 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752681AbbJXP3V (ORCPT ); Sat, 24 Oct 2015 11:29:21 -0400 Received: by pasz6 with SMTP id z6so144433312pas.2 for ; Sat, 24 Oct 2015 08:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=primarydata_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dwMkKw7AA4M/ZHB3QQyWhkpU7XSx3fLzsclc2xXJhXc=; b=O0fNhPp1jOI1gRVfLAh7rK6IT2O3aQsJfoY9ma1qT+uFDmucjNKCzGePLkORhmJ24y QRU9VCHZX1uIRcZsnrmcZPFNHbCv70XHRYVSCvfakD2zyMGNAvBuLTOOSio7AvbMrNNN mfos0yDSMbzJu2lfJZMI9qugy9n4qQiCEkiw9Xjci48OZUcoV29T/0JuJH6g8bvPSvNi CzuJueLeZ+BnRxb3N57I98OTIR4GbRPuNqdunqT6M9Zw143aW4z7yrmoHMRqxPN5a7kY hvsx5RtZRX80Hir1vqebL56XqQTRkizvXCIcCSXJjVaTdAhMAltwu9i/xcQfO4yFA6/+ at2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dwMkKw7AA4M/ZHB3QQyWhkpU7XSx3fLzsclc2xXJhXc=; b=PqC8c/DwhxPMPNgbZFoTEYj3NUbtrCwV4kVxrSS6FKdXZKzoHRtb0vbiJL10772U+z BKz793T5KFLsdzVgJ+esPZXEPFrQFZuBCnZA0wVml3PDtGjRpqYGFG9fIbpwXoBea5wu k9hxy8+Qjw1a0ZDpRrYXy9OyfjowkAZc+bpExGoZ/nmWdZnK5aaK+mUdGpoGp6OqMWOe PtYeXSGKGlPhyxgCyyZc91ybG5HBa1MVqemaa+LZtONiFTFzKm0EryJpQAPnqTrIxv3U OU8mTgxUvdUxfunnzodtMwHErzuR5QP42CpwYt48izHAN+9qdXYitjVI727uCfFC0DZc 1yYg== X-Gm-Message-State: ALoCoQkmo/oPQ13AcLWYZPHCrc7n2D8XttxYBcM5vm5RWdxRiWKGxHvKfRszY2NHM4Cs61UZrC9u X-Received: by 10.66.218.129 with SMTP id pg1mr11635221pac.156.1445700561289; Sat, 24 Oct 2015 08:29:21 -0700 (PDT) Received: from lear.localdomain (ec2-54-65-164-9.ap-northeast-1.compute.amazonaws.com. [54.65.164.9]) by smtp.gmail.com with ESMTPSA id nj1sm24764918pbc.2.2015.10.24.08.29.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Oct 2015 08:29:20 -0700 (PDT) From: Peng Tao To: linux-fsdevel@vger.kernel.org Cc: Trond Myklebust , Anna Schumaker , Christoph Hellwig , Zach Brown , Darren Hart , Jeff Layton , bfields@fieldses.org, "Darrick J. Wong" , viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org, Steve French , Peng Tao Subject: [PATCH 5/9] btrfs: remove btrfs_ioctl_clone(_range) Date: Sun, 25 Oct 2015 07:17:12 +0800 Message-Id: <1445728636-10109-6-git-send-email-tao.peng@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1445728636-10109-1-git-send-email-tao.peng@primarydata.com> References: <1445728636-10109-1-git-send-email-tao.peng@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BTRFS_IOC_CLONE/BTRFS_IOC_CLONE_RANGE is now handled by generic layer and goes through the .copy_file_range method. Signed-off-by: Peng Tao --- fs/btrfs/ioctl.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d3697e8..b568e24 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3854,51 +3854,6 @@ ssize_t btrfs_copy_file_range(struct file *file_in, loff_t pos_in, return ret; } -static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, - u64 off, u64 olen, u64 destoff) -{ - struct fd src_file; - int ret; - - /* the destination must be opened for writing */ - if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) - return -EINVAL; - - ret = mnt_want_write_file(file); - if (ret) - return ret; - - src_file = fdget(srcfd); - if (!src_file.file) { - ret = -EBADF; - goto out_drop_write; - } - - /* the src must be open for reading */ - if (!(src_file.file->f_mode & FMODE_READ)) { - ret = -EINVAL; - goto out_fput; - } - - ret = btrfs_clone_files(file, src_file.file, off, olen, destoff); - -out_fput: - fdput(src_file); -out_drop_write: - mnt_drop_write_file(file); - return ret; -} - -static long btrfs_ioctl_clone_range(struct file *file, void __user *argp) -{ - struct btrfs_ioctl_clone_range_args args; - - if (copy_from_user(&args, argp, sizeof(args))) - return -EFAULT; - return btrfs_ioctl_clone(file, args.src_fd, args.src_offset, - args.src_length, args.dest_offset); -} - /* * there are many ways the trans_start and trans_end ioctls can lead * to deadlocks. They should only be used by applications that @@ -5438,10 +5393,6 @@ long btrfs_ioctl(struct file *file, unsigned int return btrfs_ioctl_dev_info(root, argp); case BTRFS_IOC_BALANCE: return btrfs_ioctl_balance(file, NULL); - case BTRFS_IOC_CLONE: - return btrfs_ioctl_clone(file, arg, 0, 0, 0); - case BTRFS_IOC_CLONE_RANGE: - return btrfs_ioctl_clone_range(file, argp); case BTRFS_IOC_TRANS_START: return btrfs_ioctl_trans_start(file); case BTRFS_IOC_TRANS_END: