From patchwork Mon May 7 08:37:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383671 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 93F9060159 for ; Mon, 7 May 2018 08:50:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B37628B92 for ; Mon, 7 May 2018 08:50:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E32D28BAB; Mon, 7 May 2018 08:50:27 +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 1FF4728B92 for ; Mon, 7 May 2018 08:50:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752529AbeEGIt0 (ORCPT ); Mon, 7 May 2018 04:49:26 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36885 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977AbeEGIiT (ORCPT ); Mon, 7 May 2018 04:38:19 -0400 Received: by mail-wm0-f67.google.com with SMTP id l1-v6so13846972wmb.2 for ; Mon, 07 May 2018 01:38:18 -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=Os3mJHwZYo2U7MntH/uNj07TV3UhXwq03mgqi7XmDlY=; b=HZFd0ByaqcIvIKduYaxlLr4IqXC5mLIBBCC/ojLRpUNY8eeBB4HT/mMc4Efa4ScKVL Ey/C3bMfWqoVKOG6OivTwMOC5M0jh8TnETNTY86C3KOIKTALBsQMu8YmFiQGqdyTfE55 HFfAcnYhDFj4//6rCKy90zRoQdP5QZCsTyslmounrVm6Rh9XCFgRgdDlstCHFaIc0p7Z I0wLE/NR5DhPfqb9Zh4/bjo7cWOoM6qa7mkflh4vwRghMpG/Td1al/t5sRAm4nYKNaD6 5SVjQPBSrfCtm1Wvxl1H2Aif3Dfo1AlrdlFA6NLicSPtAxLu6qOrXA3RXERXnHZm525G n2Mw== X-Gm-Message-State: ALKqPweEDGvhG7d6hYexYj9Fq1UORbWQDAAuaOoBvTryLOan/0x4cj0+ LBGHChO+hCI3gcuztQNRnLPkxA== X-Google-Smtp-Source: AB8JxZqfc2o/pN7Yxp1O6lFxIGTok2gRDr5YBo2ZJ4zaCeSJUO6nwfBTjDa454XDB3O6F9Rqjx3T4w== X-Received: by 10.28.168.77 with SMTP id r74mr186147wme.114.1525682298367; Mon, 07 May 2018 01:38:18 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:17 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH v2 05/35] vfs: export vfs_dedupe_file_range_one() to modules Date: Mon, 7 May 2018 10:37:37 +0200 Message-Id: <20180507083807.28792-6-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-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 This is needed by the stacked dedupe implementation in overlayfs. Signed-off-by: Miklos Szeredi --- fs/read_write.c | 6 +++--- include/linux/fs.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 023df230e2a0..08708f903fc5 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1964,9 +1964,8 @@ int vfs_dedupe_file_range_compare(struct inode *src, loff_t srcoff, } EXPORT_SYMBOL(vfs_dedupe_file_range_compare); -static s64 vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, - struct file *dst_file, loff_t dst_pos, - u64 len) +s64 vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, + struct file *dst_file, loff_t dst_pos, u64 len) { s64 ret; @@ -2001,6 +2000,7 @@ static s64 vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, return ret; } +EXPORT_SYMBOL(vfs_dedupe_file_range_one); int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same) { diff --git a/include/linux/fs.h b/include/linux/fs.h index 26685011c4bd..c85a8059f038 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1817,6 +1817,10 @@ extern int vfs_dedupe_file_range_compare(struct inode *src, loff_t srcoff, loff_t len, bool *is_same); extern int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same); +extern s64 vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, + struct file *dst_file, loff_t dst_pos, + u64 len); + struct super_operations { struct inode *(*alloc_inode)(struct super_block *sb);