From patchwork Fri Nov 3 14:45:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10040459 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 A25716032D for ; Fri, 3 Nov 2017 14:46:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 982A029688 for ; Fri, 3 Nov 2017 14:46:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D15029698; Fri, 3 Nov 2017 14:46:37 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 1445829688 for ; Fri, 3 Nov 2017 14:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754083AbdKCOqg (ORCPT ); Fri, 3 Nov 2017 10:46:36 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59559 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004AbdKCOqf (ORCPT ); Fri, 3 Nov 2017 10:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3eHagU52Kh/TURuicDpijJlQ/8o47OcwxR7VFMBBLDI=; b=eTxSvOmUZNjgRx8u1D/ZjKmGq qRq9exMGecUeu+3FALWGluLWqg8zwxRncf4cwiL8M6j2vBiMu7+1SS/x9Gu09zZZPNGgVTimQq+4O zK83UfAiVgp/zdGRcK3ip78+kQ+1+Ix23R9adb1Bf9Q5ONo4y7QnCAKXjyp22fT6K04Nmv1s+GTB5 VxRyeb1yy2UFOCCezavUpa4XcIFeXS8Je364AVK+xRaVkE7LqwpWjmQrcRzF/u2VFb/DXfoBqlC8O 10jJH8/75JovmsxoRUCX7faAfCx3ZQCz0kQLV5PUTSWXgVEx/mgCbrz/Meo/LzyfF1CbhaBgzD1Ui BprH04X7w==; Received: from [94.72.11.11] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1eAdEx-000251-5t for linux-xfs@vger.kernel.org; Fri, 03 Nov 2017 14:46:35 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 16/21] xfs: allow unaligned extent records in xfs_bmbt_disk_set_all Date: Fri, 3 Nov 2017 17:45:34 +0300 Message-Id: <20171103144539.2187-17-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171103144539.2187-1-hch@lst.de> References: <20171103144539.2187-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 To make life a little simpler make xfs_bmbt_set_all unaligned access aware so that we can use it directly on the destination buffer. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap_btree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index 086e6fc8e4fc..89260972a0f6 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -199,14 +199,14 @@ xfs_bmbt_disk_set_all( ASSERT(!(s->br_blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN))); ASSERT(!(s->br_startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN))); - r->l0 = cpu_to_be64( + put_unaligned_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)s->br_startoff << 9) | - ((xfs_bmbt_rec_base_t)s->br_startblock >> 43)); - r->l1 = cpu_to_be64( + ((xfs_bmbt_rec_base_t)s->br_startblock >> 43), &r->l0); + put_unaligned_be64( ((xfs_bmbt_rec_base_t)s->br_startblock << 21) | ((xfs_bmbt_rec_base_t)s->br_blockcount & - (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21)), &r->l1); } /*