From patchwork Thu Feb 4 06:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 8214021 Return-Path: X-Original-To: patchwork-linux-btrfs@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 6103CBEEED for ; Thu, 4 Feb 2016 06:48:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8878A20375 for ; Thu, 4 Feb 2016 06:48:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 880DF20373 for ; Thu, 4 Feb 2016 06:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756625AbcBDGsF (ORCPT ); Thu, 4 Feb 2016 01:48:05 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:37679 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932328AbcBDGsC (ORCPT ); Thu, 4 Feb 2016 01:48:02 -0500 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Feb 2016 16:47:59 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 4 Feb 2016 16:47:58 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: chandan@linux.vnet.ibm.com X-IBM-RcptTo: linux-btrfs@vger.kernel.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 233AE2CE8057 for ; Thu, 4 Feb 2016 17:47:58 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u146loYM58327132 for ; Thu, 4 Feb 2016 17:47:58 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u146lPUL015796 for ; Thu, 4 Feb 2016 17:47:25 +1100 Received: from localhost.in.ibm.com ([9.124.125.198]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u146krRM013893; Thu, 4 Feb 2016 17:47:23 +1100 From: Chandan Rajendra To: clm@fb.com, jbacik@fb.com, bo.li.liu@oracle.com, dsterba@suse.cz Cc: Chandan Rajendra , aneesh.kumar@linux.vnet.ibm.com, linux-btrfs@vger.kernel.org, chandan@mykolab.com Subject: [PATCH V14 15/15] Btrfs: subpagesize-blocksize: Enable dedup ioctl Date: Thu, 4 Feb 2016 12:16:22 +0530 Message-Id: <1454568382-2020-16-git-send-email-chandan@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1454568382-2020-1-git-send-email-chandan@linux.vnet.ibm.com> References: <1454568382-2020-1-git-send-email-chandan@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16020406-0013-0000-0000-000002ABD9D5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The function implementing the dedup ioctl i.e. btrfs_ioctl_file_extent_same(), returns with an error in subpagesize-blocksize scenario. This was done due to the fact that Btrfs did not have code to deal with block size < page size. This commit removes this restriction since we now support "block size < page size". Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b209415..ab47cfa 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3191,7 +3191,6 @@ static long btrfs_ioctl_file_extent_same(struct file *file, int i; int ret; unsigned long size; - u64 bs = BTRFS_I(src)->root->fs_info->sb->s_blocksize; bool is_admin = capable(CAP_SYS_ADMIN); u16 count; @@ -3228,16 +3227,6 @@ static long btrfs_ioctl_file_extent_same(struct file *file, if (len > BTRFS_MAX_DEDUPE_LEN) len = BTRFS_MAX_DEDUPE_LEN; - if (WARN_ON_ONCE(bs < PAGE_CACHE_SIZE)) { - /* - * Btrfs does not support blocksize < page_size. As a - * result, btrfs_cmp_data() won't correctly handle - * this situation without an update. - */ - ret = -EINVAL; - goto out; - } - ret = -EISDIR; if (S_ISDIR(src->i_mode)) goto out;