From patchwork Tue Oct 18 01:54:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9381023 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 D5CF8600CA for ; Tue, 18 Oct 2016 01:54:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDDE028C9B for ; Tue, 18 Oct 2016 01:54:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1BA828CA2; Tue, 18 Oct 2016 01:54:49 +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, UNPARSEABLE_RELAY autolearn=unavailable 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 B0A7C28C9E for ; Tue, 18 Oct 2016 01:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935667AbcJRByn (ORCPT ); Mon, 17 Oct 2016 21:54:43 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46238 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932571AbcJRByl (ORCPT ); Mon, 17 Oct 2016 21:54:41 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9I1sb0j020977 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Oct 2016 01:54:37 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u9I1sbe9015776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Oct 2016 01:54:37 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id u9I1saRO016033; Tue, 18 Oct 2016 01:54:36 GMT Received: from localhost (/24.21.211.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Oct 2016 18:54:36 -0700 Subject: [PATCH 2/2] man2/ioctl_fideduperange.2: clarify operation some more From: "Darrick J. Wong" To: mtk.manpages@gmail.com, darrick.wong@oracle.com Cc: linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-man@vger.kernel.org Date: Mon, 17 Oct 2016 18:54:35 -0700 Message-ID: <147675567514.12400.12489294497404900248.stgit@birch.djwong.org> In-Reply-To: <147675566778.12400.16090171199161180354.stgit@birch.djwong.org> References: <147675566778.12400.16090171199161180354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clarify the behavior of the dedupe ioctl. Signed-off-by: Darrick J. Wong --- man2/ioctl_ficlonerange.2 | 2 +- man2/ioctl_fideduperange.2 | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/man2/ioctl_ficlonerange.2 b/man2/ioctl_ficlonerange.2 index ac0738a..0e3ae0e 100644 --- a/man2/ioctl_ficlonerange.2 +++ b/man2/ioctl_ficlonerange.2 @@ -114,7 +114,7 @@ regions in directories. .TP .B EOPNOTSUPP This can appear if the filesystem does not support reflinking either file -descriptor. +descriptor, or if either file descriptor refers to special inodes. .TP .B EPERM .IR dest_fd diff --git a/man2/ioctl_fideduperange.2 b/man2/ioctl_fideduperange.2 index c52fa2a..2112d10 100644 --- a/man2/ioctl_fideduperange.2 +++ b/man2/ioctl_fideduperange.2 @@ -99,21 +99,39 @@ Each deduplication operation targets bytes in file descriptor .IR dest_fd at offset -.IR logical_offset ". +.IR dest_offset ". The field .IR reserved must be zero. +During the call, +.IR src_fd +must be open for reading and +.IR dest_fd +must be open for writing. +For any call to this ioctl, there may not be more than 65,536 +requests attached; each request may not exceed 16MiB. +By convention, the storage used by +.IR src_fd +is mapped into +.IR dest_fd +and the previous contents in +.IR dest_fd +are freed. Upon successful completion of this ioctl, the number of bytes successfully deduplicated is returned in .IR bytes_deduped and a status code for the deduplication operation is returned in .IR status ". - +If even a single byte in the range does not match, the deduplication +request will be ignored and +.IR status +set to +.BR FILE_DEDUPE_RANGE_DIFFERS . The .IR status code is set to -.B 0 +.B FILE_DEDUPE_RANGE_SAME for success, a negative error code in case of error, or .B FILE_DEDUPE_RANGE_DIFFERS if the data did not match. @@ -150,7 +168,7 @@ regions in directories. .TP .B EOPNOTSUPP This can appear if the filesystem does not support deduplicating either file -descriptor. +descriptor, or if either file descriptor refers to special inodes. .TP .B EPERM .IR dest_fd