From patchwork Wed May 10 18:02:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9720429 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 BEA5A60365 for ; Wed, 10 May 2017 18:06:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E34D926E78 for ; Wed, 10 May 2017 18:06:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7FF728622; Wed, 10 May 2017 18:06:17 +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=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 8EE2826E78 for ; Wed, 10 May 2017 18:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932275AbdEJSFe (ORCPT ); Wed, 10 May 2017 14:05:34 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:43486 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754205AbdEJSCp (ORCPT ); Wed, 10 May 2017 14:02:45 -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:Cc:To:From:Sender:Reply-To: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=RuD4lse1HZRsYXtn7tQm4vY89WYsST1E6UNX2haAm6s=; b=L6WYNIaN1sSytLNMlwJelkFbV nohwAcudqw+hFAm+EMSoLVTJ7OXBRYVsRa5+5apCpgNE7XWg3Ow69Oh1S0T9+rfX+O94NxxRhZrjk zfPfSDql/MPtnQYtB87BEw9CoaJ9k6Og52wn/iIZnnXndxZz4Qt+l5ZIBUtNkYQfM83UX3pexE+xk X7LVwHs4vdhKGMf5Lf5oI3lGcXGOOJK9rjRQDrY78wFox+4PglMy8s2vKlzdbFbfWDGoo6koKpXxk NhT0Y3dTDLQmkRHm1O+ei9a21avtsDA72zM+/aOCjotHHNTORAH6eT7RuPVvBEES0wnjEtnGzHYFf oXyvjmVPA==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1d8Vwd-0005J1-0B; Wed, 10 May 2017 18:02:39 +0000 From: Christoph Hellwig To: Andy Shevchenko , Amir Goldstein , linux-fsdevel@vger.kernel.org Cc: Shaohua Li , Dan Williams , David Howells , Steven Whitehouse , Mimi Zohar , linux-xfs@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/16] xfs: remove uuid_getnodeuniq and xfs_uu_t Date: Wed, 10 May 2017 20:02:06 +0200 Message-Id: <20170510180214.16852-9-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170510180214.16852-1-hch@lst.de> References: <20170510180214.16852-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 Directly use the v1 intepretation of uuid_t instead. Signed-off-by: Christoph Hellwig --- fs/xfs/uuid.c | 25 ------------------------- fs/xfs/uuid.h | 1 - fs/xfs/xfs_mount.c | 6 +++++- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/fs/xfs/uuid.c b/fs/xfs/uuid.c index b83f76b6d410..937deaf2128d 100644 --- a/fs/xfs/uuid.c +++ b/fs/xfs/uuid.c @@ -17,31 +17,6 @@ */ #include -/* IRIX interpretation of an uuid_t */ -typedef struct { - __be32 uu_timelow; - __be16 uu_timemid; - __be16 uu_timehi; - __be16 uu_clockseq; - __be16 uu_node[3]; -} xfs_uu_t; - -/* - * uuid_getnodeuniq - obtain the node unique fields of a UUID. - * - * This is not in any way a standard or condoned UUID function; - * it just something that's needed for user-level file handles. - */ -void -uuid_getnodeuniq(uuid_t *uuid, int fsid [2]) -{ - xfs_uu_t *uup = (xfs_uu_t *)uuid; - - fsid[0] = (be16_to_cpu(uup->uu_clockseq) << 16) | - be16_to_cpu(uup->uu_timemid); - fsid[1] = be32_to_cpu(uup->uu_timelow); -} - int uuid_is_nil(uuid_t *uuid) { diff --git a/fs/xfs/uuid.h b/fs/xfs/uuid.h index 4f1441ba4fa5..65b5cebf2f99 100644 --- a/fs/xfs/uuid.h +++ b/fs/xfs/uuid.h @@ -20,7 +20,6 @@ extern int uuid_is_nil(uuid_t *uuid); extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2); -extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]); static inline void uuid_copy(uuid_t *dst, uuid_t *src) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 2eaf81859166..742e4a61c0bc 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -793,7 +793,11 @@ xfs_mountfs( * Copies the low order bits of the timestamp and the randomly * set "sequence" number out of a UUID. */ - uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid); + mp->m_fixedfsid[0] = + ((u32)sbp->sb_uuid.v1.clock_seq_hi_and_reserved << 24) | + ((u32)sbp->sb_uuid.v1.clock_seq_low << 16) | + be16_to_cpu(sbp->sb_uuid.v1.time_mid); + mp->m_fixedfsid[1] = be32_to_cpu(sbp->sb_uuid.v1.time_low); mp->m_dmevmask = 0; /* not persistent; set after each mount */