From patchwork Tue May 1 18:48:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksei Besogonov X-Patchwork-Id: 10374329 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 BCAC960234 for ; Tue, 1 May 2018 18:48:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE2CF283C3 for ; Tue, 1 May 2018 18:48:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2A0428B38; Tue, 1 May 2018 18:48:19 +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.0 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 3992B28B1A for ; Tue, 1 May 2018 18:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756477AbeEASsS (ORCPT ); Tue, 1 May 2018 14:48:18 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:62492 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756333AbeEASsR (ORCPT ); Tue, 1 May 2018 14:48:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1525200497; x=1556736497; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ySuqSTpMjKJzJPIhVkTqH0At8DKTJSdTNb9oCBarPbk=; b=jswgcZdQkfAciTYC1S55q14BwFXkv7voyRbqYgoLR53PJ5/AHDPRMu2W BYgwZZC4UaIS5hA3L8ByiSKxAqDY5j0an4kD9EUpGhMJ72y0T7jhSnP+y D4a4ejdT6R2GdE9Gr9Go8J4AMo7zjJGZjNSKx79kwJolK4T7fp4+anTZj w=; X-IronPort-AV: E=Sophos;i="5.49,352,1520899200"; d="scan'208";a="342020365" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 May 2018 18:48:16 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w41ImDlS046542 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 1 May 2018 18:48:14 GMT Received: from EX13D12UWA002.ant.amazon.com (10.43.160.88) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 1 May 2018 18:48:14 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D12UWA002.ant.amazon.com (10.43.160.88) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 1 May 2018 18:48:14 +0000 Received: from dev-dsk-cyberax-2c4-037e2d74.us-west-2.amazon.com (10.184.178.228) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 1 May 2018 18:48:14 +0000 Received: by dev-dsk-cyberax-2c4-037e2d74.us-west-2.amazon.com (Postfix, from userid 3193228) id 1FEEAA0FAD; Tue, 1 May 2018 18:48:14 +0000 (UTC) From: Aleksei Besogonov To: , , CC: Aleksei Besogonov Subject: [PATCH 2/2] xfs: add support for iomap-based swapfile activation Date: Tue, 1 May 2018 18:48:07 +0000 Message-ID: <20180501184807.123111-3-cyberax@amazon.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180501184807.123111-1-cyberax@amazon.com> References: <20180501184807.123111-1-cyberax@amazon.com> MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use iomap-based swapfile activation instead of the default generic_swapfile_activate bmap-based infrastructure. --- fs/xfs/xfs_aops.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 31f1f10eecd1..9c10efaabc6f 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1491,6 +1491,13 @@ xfs_vm_set_page_dirty( return newly_dirty; } +static int xfs_swap_activate(struct swap_info_struct *sis, struct file *swap_file, + sector_t *span) +{ + sis->bdev = xfs_find_bdev_for_inode(file_inode(swap_file)); + return iomap_swap_activate(sis, swap_file, span, &xfs_iomap_ops); +} + const struct address_space_operations xfs_address_space_operations = { .readpage = xfs_vm_readpage, .readpages = xfs_vm_readpages, @@ -1504,4 +1511,5 @@ const struct address_space_operations xfs_address_space_operations = { .migratepage = buffer_migrate_page, .is_partially_uptodate = block_is_partially_uptodate, .error_remove_page = generic_error_remove_page, + .swap_activate = xfs_swap_activate, };