Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3502606imm; Tue, 29 May 2018 08:18:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpKPWSmT7y4laiY7CN4O0uE608gqmfCXG1quAwipCklniWITTkzb8IePqtY3VxNeVouwBJn X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr18611202plg.38.1527607111776; Tue, 29 May 2018 08:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527607111; cv=none; d=google.com; s=arc-20160816; b=cIxbRHzL0cY5aRsVMbF7OizwrLGMP5WMpcUfNdDpj43/xe8HDligrNOhvVaYY8w48N Vv4czMGbk06x8pnvDOMdn9a2RAu3vLFIibm5WHWn6FbKlIKF7hopOjbJcEg+E/AF31B/ +JCdWfgPCyvjI0etTrItwLOUV1mJ+CKEYFOsm4Mqg9dyIVNxnaPhGVCYtS36ie6pJOC2 Ovzf1ymsoiNxbWZloewm3GoN3ax+JnSRk069j7LVAdZm3+ZCsEYV58VLyYdcRwsVc+bP qxlY7ykumac9VUuoNANSNoPlKR61A1rptcdIpuSSDgvztoXCBrtVpnNUw7wK2sMcPzDE 9mJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=QHHw+y/T7t2a0iee/KElpoQLye4NLOE4b0YxbK0I6D4=; b=bQmcldmTBb3RiBZB4QzQYhylNU/9B2YTBurIJUKTrLn8dDv+tfW6UkfOG20Myqzkf1 UkqDN76IgMxaZbERD6XMvLWy0J7AZb7oNbzEBYEbmiz46aIyw6o1GWQ+uWC7EBZvvs7C hc1MKhkOmOzDMMGh0mB086XjFIfIbW9C0PpLHs0qcRf+cJ7ap+yUZbIiBmEo3tAJmc/Y samAAaK970Mfzb+TLW27UuD8xQ6T/O5DgAGRhP9G9krYKgUYETjyUrln6ufRIJTc74Rb O/P/ofdfJM8lt2Zn49pr7RhSxwAqfLHTZOCd8JpARAivSHkIztJE6fNrdV1No+F1O/fG JiUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17-v6si31991789plz.480.2018.05.29.08.18.17; Tue, 29 May 2018 08:18:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936694AbeE2PQy (ORCPT + 99 others); Tue, 29 May 2018 11:16:54 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:37752 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935166AbeE2Ono (ORCPT ); Tue, 29 May 2018 10:43:44 -0400 Received: by mail-wr0-f182.google.com with SMTP id i12-v6so25998250wrc.4 for ; Tue, 29 May 2018 07:43:44 -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=QHHw+y/T7t2a0iee/KElpoQLye4NLOE4b0YxbK0I6D4=; b=GMr3UjlUz/27hMNOBotxoGrwD4WzOwM24K9y8ObkGzMM/JJyzil0ekiA6YzWOs70sE dII7P+en4QijWeel5pd5YVDxG90ha8eYKa0aaHm6V9HuWU6OGhICZYxhjaOveTCay8bA NBw8iWsYzUQA/Kq9VDs3Xs75A5lqIBrAMqEKQNwvFIzkdyb8KeaUmkVNYejKqJt7MgIA KJy8HKSCfil6jbGD3h39zQ3W48kBWyA9vfG6wuZ6hKlP6hA4Xqw8wrnpZ0I4DFlCcroH fmzmXJbJd1gm5Xsu/UZBmC+Dfi9gFmTsgL9Lizmmtu5kAARoIDLWW6if5wH8MkfcQyd8 bSNQ== X-Gm-Message-State: ALKqPwcYhMMReTW3t7Y572GtIZNeswQM6nHNyz/KTir9tDRiB5a3PMIp +5ovbv79uJ7Ep8b0+//sSJhTxQ== X-Received: by 2002:adf:accd:: with SMTP id o71-v6mr15520670wrc.61.1527605023592; Tue, 29 May 2018 07:43:43 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id t198-v6sm18834422wmt.23.2018.05.29.07.43.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:43:43 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/39] vfs: dedupe: rationalize args Date: Tue, 29 May 2018 16:43:02 +0200 Message-Id: <20180529144339.16538-3-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144339.16538-1-mszeredi@redhat.com> References: <20180529144339.16538-1-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up f_op->dedupe_file_range() interface. 1) Use loff_t for offsets and length instead of u64 2) Order the arguments the same way as {copy|clone}_file_range(). Signed-off-by: Miklos Szeredi --- fs/btrfs/ctree.h | 5 +++-- fs/btrfs/ioctl.c | 5 +++-- fs/ocfs2/file.c | 6 +++--- fs/read_write.c | 4 ++-- fs/xfs/xfs_file.c | 6 +++--- include/linux/fs.h | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 990e011c9f0c..5968ba5aa0d1 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3271,8 +3271,9 @@ 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); -loff_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen, - struct file *dst_file, u64 dst_loff); +loff_t btrfs_dedupe_file_range(struct file *src_file, loff_t loff, + struct file *dst_file, loff_t dst_loff, + loff_t olen); /* file.c */ int __init btrfs_auto_defrag_init(void); diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 1b5cc5fd4868..70eac76804df 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3194,8 +3194,9 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, #define BTRFS_MAX_DEDUPE_LEN SZ_16M -loff_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen, - struct file *dst_file, u64 dst_loff) +loff_t btrfs_dedupe_file_range(struct file *src_file, loff_t loff, + struct file *dst_file, loff_t dst_loff, + loff_t 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 4a81d82ab7f6..a024715cd227 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 loff_t 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, + loff_t len) { int error; diff --git a/fs/read_write.c b/fs/read_write.c index c41e2a1eb7c7..1818581cadf6 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 cf51d47efdb6..75704edfba82 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -875,10 +875,10 @@ xfs_file_clone_range( STATIC loff_t 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, + loff_t len) { struct inode *srci = file_inode(src_file); u64 max_dedupe; diff --git a/include/linux/fs.h b/include/linux/fs.h index 8e49defc7aab..b0f290944220 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1738,8 +1738,8 @@ struct file_operations { loff_t, size_t, unsigned int); int (*clone_file_range)(struct file *, loff_t, struct file *, loff_t, u64); - loff_t (*dedupe_file_range)(struct file *, u64, u64, struct file *, - u64); + loff_t (*dedupe_file_range)(struct file *, loff_t, + struct file *, loff_t, loff_t); } __randomize_layout; struct inode_operations { -- 2.14.3