From patchwork Fri Oct 19 15:29:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AEBD109C for ; Fri, 19 Oct 2018 15:29:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69F6B27F8E for ; Fri, 19 Oct 2018 15:29:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E43F27F92; Fri, 19 Oct 2018 15:29:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 10F1B27F8E for ; Fri, 19 Oct 2018 15:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbeJSXgK (ORCPT ); Fri, 19 Oct 2018 19:36:10 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44694 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbeJSXgJ (ORCPT ); Fri, 19 Oct 2018 19:36:09 -0400 Received: by mail-qk1-f194.google.com with SMTP id y8-v6so21195498qka.11 for ; Fri, 19 Oct 2018 08:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YV0ywaarNoQ2aekV26dY3a6rFtgR4/mQesVdSttzTq8=; b=GiXYv5U2szPLUhBZKb1+frlsXtPsHqovJjrDwW+Xf9iPQ6+Nip4u5A3yjlQZW8ZL7+ T88UCdvmxCBQVr6PIsemdva+B7OzvzTMFQPwzW2mz15kGa+hYCuQAUPavIkyKDpX/7iN huIxVcTu3y7YLxxmWZYesWQ0ptr/Xc9AKCi7+SEN11VoNU7mVDpLG/MDnwjQiTirJFkS ZcsuHprT+bmR/xXQyFy7mM7R3AeQX9cv3lC/QjFtKk9bQr6XeVFrClz2Di5Hk6xvLBKs rAW2hoEQgim7IQ6ONvQlqE8AVhmLO/wVkfOKbUAT4nAgVMOvn9Vs6290vNFOFnNC6j38 WA7A== 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=YV0ywaarNoQ2aekV26dY3a6rFtgR4/mQesVdSttzTq8=; b=ceK9WLU+TW/WlGj3ive0z0TYy6/QbbnYLOcnNoCFNKVEmFIP4XTiUXYkpcsF3rNhKN kcPdYmCiKyXvaTOaQlx9TVpV41efktcaHFVIM4BoXQysP0eiuWIPjB2Hq6InUmKu7JyE qFVkw+6wrgUAzCTXKTO4GoQqxBSSKD6Qt1KLfgiBDmx87akVWBwDSKIUiOA58+8hgppl Gn/CHKNsRgkvUGh9Xxv2ein50T7oY2wZGVeANVkKDXXJ439Par1AmRV1vQLj7knouxUd Gq5a5eR39y3psGQIDKv5D8VILqTw8i5gWc5OF6UG8UkzHxurdAGu4TczNKKTq1cHjElo 4e6A== X-Gm-Message-State: ABuFfogbMTqf4ZDR92uFBwYvedeOLZ9/rkNIn3ltWekg63Hdkb+XMHiE MYRN+L+qwukkn8X8j0WXrX4= X-Google-Smtp-Source: ACcGV63T+jwVSHDet1pRLHH9bQMJivejHFmvljcGZefLfbh7WedhG/dKnIGJlVpGOPtULXQxlH3fAw== X-Received: by 2002:a37:2a98:: with SMTP id q24-v6mr2218532qkq.197.1539962974417; Fri, 19 Oct 2018 08:29:34 -0700 (PDT) Received: from Olgas-MBP-195.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id w39-v6sm17358099qtc.84.2018.10.19.08.29.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:33 -0700 (PDT) From: Olga Kornievskaia To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 03/11] NFS test for intra vs inter COPY Date: Fri, 19 Oct 2018 11:29:24 -0400 Message-Id: <20181019152932.32462-4-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20181019152932.32462-1-olga.kornievskaia@gmail.com> References: <20181019152932.32462-1-olga.kornievskaia@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Olga Kornievskaia Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/nfs/nfs42.h b/fs/nfs/nfs42.h index 19ec38f8..5abff4d 100644 --- a/fs/nfs/nfs42.h +++ b/fs/nfs/nfs42.h @@ -6,6 +6,7 @@ #ifndef __LINUX_FS_NFS_NFS4_2_H #define __LINUX_FS_NFS_NFS4_2_H +#include /* * FIXME: four LAYOUTSTATS calls per compound at most! Do we need to support * more? Need to consider not to pre-alloc too much for a compound. @@ -21,4 +22,14 @@ int nfs42_proc_layoutstats_generic(struct nfs_server *, struct nfs42_layoutstat_data *); int nfs42_proc_clone(struct file *, struct file *, loff_t, loff_t, loff_t); +static inline bool nfs42_files_from_same_server(struct file *in, + struct file *out) +{ + struct nfs_client *c_in = (NFS_SERVER(file_inode(in)))->nfs_client; + struct nfs_client *c_out = (NFS_SERVER(file_inode(out)))->nfs_client; + + return rpc_cmp_addr((struct sockaddr *)&c_in->cl_addr, + (struct sockaddr *)&c_out->cl_addr); +} + #endif /* __LINUX_FS_NFS_NFS4_2_H */