From patchwork Thu May 18 06:26:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9732735 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 AF1D4601BC for ; Thu, 18 May 2017 06:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 814BA2654B for ; Thu, 18 May 2017 06:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75C2127D4D; Thu, 18 May 2017 06:32:26 +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 0F93D2654B for ; Thu, 18 May 2017 06:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbdERG1y (ORCPT ); Thu, 18 May 2017 02:27:54 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:55387 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932209AbdERG1v (ORCPT ); Thu, 18 May 2017 02:27:51 -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=s4+75jN2oCh56COf7uHtnm1Ni4xwr+ak9QSGNRowEaA=; b=Yn90/2E471ooFSNMY/HKf6WZG 5oHXixkC2E503ALxIjUEBxDBoRfpWw0ARN4oMIP4Y/abn/9m9/dUSoGPhNozWhbfF56vWufSGupLB x8PSBfG6i5ObZRtzd6Bk1BSOqaoUHdtwAyE5vSOjS1PLxj0TZKbVXFwv+/Q+Xu3hBWh2g6jEQLJHc L/Fq0x237xYeKVCwUDDFytoRQp6/SxDrUCmpsrQmq2NUqHNsKW7R1z7ttAfhptLgstK+TkP2Nz5RQ itXkh7hm1ff9GoiHpCaT67iwzgIHA7Y/0zTPY+kvsP6Zg3eSlVLycYewzS+e23nKLJVQw6XfMQfVf GNjDelVOw==; Received: from [46.125.249.66] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dBEub-00020K-Mq; Thu, 18 May 2017 06:27:50 +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 10/23] afs: switch to use uuid_t and uuid_gen Date: Thu, 18 May 2017 08:26:52 +0200 Message-Id: <20170518062705.25902-11-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170518062705.25902-1-hch@lst.de> References: <20170518062705.25902-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 Signed-off-by: Christoph Hellwig Reviewed-by: David Howells --- fs/afs/cmservice.c | 46 +++++++++++++++++++++++----------------------- fs/afs/internal.h | 2 +- fs/afs/main.c | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c index 3062cceb5c2a..d4e77d12570c 100644 --- a/fs/afs/cmservice.c +++ b/fs/afs/cmservice.c @@ -350,7 +350,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) { struct sockaddr_rxrpc srx; struct afs_server *server; - struct uuid_v1 *r; + uuid_t *r; unsigned loop; __be32 *b; int ret; @@ -380,20 +380,20 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL); + call->request = kmalloc(sizeof(uuid_t), GFP_KERNEL); if (!call->request) return -ENOMEM; b = call->buffer; r = call->request; - r->time_low = b[0]; - r->time_mid = htons(ntohl(b[1])); - r->time_hi_and_version = htons(ntohl(b[2])); - r->clock_seq_hi_and_reserved = ntohl(b[3]); - r->clock_seq_low = ntohl(b[4]); + r->v1.time_low = b[0]; + r->v1.time_mid = htons(ntohl(b[1])); + r->v1.time_hi_and_version = htons(ntohl(b[2])); + r->v1.clock_seq_hi_and_reserved = ntohl(b[3]); + r->v1.clock_seq_low = ntohl(b[4]); for (loop = 0; loop < 6; loop++) - r->node[loop] = ntohl(b[loop + 5]); + r->v1.node[loop] = ntohl(b[loop + 5]); call->offset = 0; call->unmarshall++; @@ -453,7 +453,7 @@ static int afs_deliver_cb_probe(struct afs_call *call) static void SRXAFSCB_ProbeUuid(struct work_struct *work) { struct afs_call *call = container_of(work, struct afs_call, work); - struct uuid_v1 *r = call->request; + uuid_t *r = call->request; struct { __be32 match; @@ -476,7 +476,7 @@ static void SRXAFSCB_ProbeUuid(struct work_struct *work) */ static int afs_deliver_cb_probe_uuid(struct afs_call *call) { - struct uuid_v1 *r; + uuid_t *r; unsigned loop; __be32 *b; int ret; @@ -502,20 +502,20 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call) } _debug("unmarshall UUID"); - call->request = kmalloc(sizeof(struct uuid_v1), GFP_KERNEL); + call->request = kmalloc(sizeof(uuid_t), GFP_KERNEL); if (!call->request) return -ENOMEM; b = call->buffer; r = call->request; - r->time_low = b[0]; - r->time_mid = htons(ntohl(b[1])); - r->time_hi_and_version = htons(ntohl(b[2])); - r->clock_seq_hi_and_reserved = ntohl(b[3]); - r->clock_seq_low = ntohl(b[4]); + r->v1.time_low = b[0]; + r->v1.time_mid = htons(ntohl(b[1])); + r->v1.time_hi_and_version = htons(ntohl(b[2])); + r->v1.clock_seq_hi_and_reserved = ntohl(b[3]); + r->v1.clock_seq_low = ntohl(b[4]); for (loop = 0; loop < 6; loop++) - r->node[loop] = ntohl(b[loop + 5]); + r->v1.node[loop] = ntohl(b[loop + 5]); call->offset = 0; call->unmarshall++; @@ -568,13 +568,13 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *work) memset(&reply, 0, sizeof(reply)); reply.ia.nifs = htonl(nifs); - reply.ia.uuid[0] = afs_uuid.time_low; - reply.ia.uuid[1] = htonl(ntohs(afs_uuid.time_mid)); - reply.ia.uuid[2] = htonl(ntohs(afs_uuid.time_hi_and_version)); - reply.ia.uuid[3] = htonl((s8) afs_uuid.clock_seq_hi_and_reserved); - reply.ia.uuid[4] = htonl((s8) afs_uuid.clock_seq_low); + reply.ia.uuid[0] = afs_uuid.v1.time_low; + reply.ia.uuid[1] = htonl(ntohs(afs_uuid.v1.time_mid)); + reply.ia.uuid[2] = htonl(ntohs(afs_uuid.v1.time_hi_and_version)); + reply.ia.uuid[3] = htonl((s8) afs_uuid.v1.clock_seq_hi_and_reserved); + reply.ia.uuid[4] = htonl((s8) afs_uuid.v1.clock_seq_low); for (loop = 0; loop < 6; loop++) - reply.ia.uuid[loop + 5] = htonl((s8) afs_uuid.node[loop]); + reply.ia.uuid[loop + 5] = htonl((s8) afs_uuid.v1.node[loop]); if (ifs) { for (loop = 0; loop < nifs; loop++) { diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 393672997cc2..7de45c8686a2 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -544,7 +544,7 @@ extern int afs_drop_inode(struct inode *); * main.c */ extern struct workqueue_struct *afs_wq; -extern struct uuid_v1 afs_uuid; +extern uuid_t afs_uuid; /* * misc.c diff --git a/fs/afs/main.c b/fs/afs/main.c index 51d7d17bca57..75b3d3a8b1ba 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -31,7 +31,7 @@ static char *rootcell; module_param(rootcell, charp, 0); MODULE_PARM_DESC(rootcell, "root AFS cell name and VL server IP addr list"); -struct uuid_v1 afs_uuid; +uuid_t afs_uuid; struct workqueue_struct *afs_wq; /* @@ -43,7 +43,7 @@ static int __init afs_init(void) printk(KERN_INFO "kAFS: Red Hat AFS client v0.1 registering.\n"); - generate_random_uuid((unsigned char *)&afs_uuid); + uuid_gen(&afs_uuid); /* create workqueue */ ret = -ENOMEM;