From patchwork Mon May 7 08:21:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383415 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 25BBE602D8 for ; Mon, 7 May 2018 08:21:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A7F727031 for ; Mon, 7 May 2018 08:21:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F687287F3; Mon, 7 May 2018 08:21:52 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 B196A27031 for ; Mon, 7 May 2018 08:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752023AbeEGIVi (ORCPT ); Mon, 7 May 2018 04:21:38 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44737 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752011AbeEGIVR (ORCPT ); Mon, 7 May 2018 04:21:17 -0400 Received: by mail-wr0-f196.google.com with SMTP id y15-v6so16066454wrg.11 for ; Mon, 07 May 2018 01:21:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D8PEb8xrb2Wa/MxY4AHinkCsR0f/haVhCP9hHwlo9yA=; b=O19OYeDJswUyOvsKObnOfylUmH45Gn4an444lcQIFodBJf8dkwnyfu+gvb3Nhvp9iO DCsNZaPnd4zDX6YVJXLbb2ILd9GYEGbstLomS8v71OZ+HL+96QZd1Lq+OC2p1hZZL32B qBP8zxERqiQjYc/pAc2cdIlL1E1pjKAbnfQ3rWasthqg9RuF0FqynWu0bZ6sc8Iq/RmA WxgkN8oTWLXBSvv2/uQlC6mxmqrHOXewla9nHC4hdjYiN54IDnA/GKYCF30pdVFSgNBO wuPpKDO2kQjTPD415RDJhaj2vLvEtNDJI/mg0/OHRy6GM56abDVJSTsyHjlCt98ixrx5 Vs8Q== X-Gm-Message-State: ALQs6tATgIjaoLu6OMuqaYmCBrHXZ6pKJz0bqDiIG+dgNOHttAb+C7xv YvgSTKNe0OEQMdXpv2eWF1vZ4A== X-Google-Smtp-Source: AB8JxZqyxrRRoI0lPuIVgm4w+ZyOZmypa/xaBy3fRWQsfDYJ3xR2y7oc0N7ZGiWuOQYQlxVmgJEFng== X-Received: by 2002:adf:bd89:: with SMTP id l9-v6mr31973113wrh.234.1525681276082; Mon, 07 May 2018 01:21:16 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id w6-v6sm26991776wra.16.2018.05.07.01.21.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:21:15 -0700 (PDT) From: Miklos Szeredi To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Amir Goldstein Subject: [PATCH 2/3] vfs: dedupe: rationalize args Date: Mon, 7 May 2018 10:21:07 +0200 Message-Id: <20180507082108.28186-3-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507082108.28186-1-mszeredi@redhat.com> References: <20180507082108.28186-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clean up f_op->dedupe_file_range() interface. 1) Use loff_t for offsets instead of u64 2) Order the arguments the same way as {copy|clone}_file_range(). Signed-off-by: Miklos Szeredi --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/ioctl.c | 4 ++-- fs/ocfs2/file.c | 6 +++--- fs/read_write.c | 4 ++-- fs/xfs/xfs_file.c | 6 +++--- include/linux/fs.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 019a25962ac8..a8f1ab69158b 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3269,8 +3269,8 @@ void btrfs_get_block_group_info(struct list_head *groups_list, struct btrfs_ioctl_space_info *space); void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock, struct btrfs_ioctl_balance_args *bargs); -s64 btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen, - struct file *dst_file, u64 dst_loff); +s64 btrfs_dedupe_file_range(struct file *src_file, loff_t loff, + struct file *dst_file, loff_t dst_loff, u64 olen); /* file.c */ int __init btrfs_auto_defrag_init(void); diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b6a1df6bb895..10658c0a5ac9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3194,8 +3194,8 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, #define BTRFS_MAX_DEDUPE_LEN SZ_16M -s64 btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen, - struct file *dst_file, u64 dst_loff) +s64 btrfs_dedupe_file_range(struct file *src_file, loff_t loff, + struct file *dst_file, loff_t dst_loff, u64 olen) { struct inode *src = file_inode(src_file); struct inode *dst = file_inode(dst_file); diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index cf3732df4c2e..00656f4b6059 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2538,10 +2538,10 @@ static int ocfs2_file_clone_range(struct file *file_in, } static s64 ocfs2_file_dedupe_range(struct file *src_file, - u64 loff, - u64 len, + loff_t loff, struct file *dst_file, - u64 dst_loff) + loff_t dst_loff, + u64 len) { int error; diff --git a/fs/read_write.c b/fs/read_write.c index 6a79c7ec2bb2..0cdef381d9d9 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -2046,8 +2046,8 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same) info->status = -EINVAL; } else { deduped = dst_file->f_op->dedupe_file_range(file, off, - len, dst_file, - info->dest_offset); + dst_file, + info->dest_offset, len); if (deduped == -EBADE) info->status = FILE_DEDUPE_RANGE_DIFFERS; else if (deduped < 0) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index d06dd1557d0e..e2620a00d132 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -871,10 +871,10 @@ xfs_file_clone_range( STATIC s64 xfs_file_dedupe_range( struct file *src_file, - u64 loff, - u64 len, + loff_t loff, struct file *dst_file, - u64 dst_loff) + loff_t dst_loff, + u64 len) { int error; diff --git a/include/linux/fs.h b/include/linux/fs.h index 6feb121ae48c..8007a31c4d3c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1738,7 +1738,7 @@ struct file_operations { loff_t, size_t, unsigned int); int (*clone_file_range)(struct file *, loff_t, struct file *, loff_t, u64); - s64 (*dedupe_file_range)(struct file *, u64, u64, struct file *, + s64 (*dedupe_file_range)(struct file *, loff_t, struct file *, loff_t, u64); } __randomize_layout;