From patchwork Mon May 15 15:43:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9727399 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 EBDAE60386 for ; Mon, 15 May 2017 15:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6A64286D5 for ; Mon, 15 May 2017 15:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB46C28990; Mon, 15 May 2017 15:43:46 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 99DAC286D5 for ; Mon, 15 May 2017 15:43:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8A7C4203BF115; Mon, 15 May 2017 08:43:42 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 55066203BF108 for ; Mon, 15 May 2017 08:43:41 -0700 (PDT) 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=AxUf9nrgCNnwMkFBGVNuFu9o8 lmneEXvuXmM2Lmvfxj/4oWvQS+dL58sM8M4QslFnK4UliXHR5TgihWdJLeDduADbpOrbQkc7D5LNW JRheuE3KVJdDDekhfhPZ/phQhVjEcV3E0TRBQfI0FI2uequ3BMX5AnnxVTbLa2+CiP5IcJbEA3t45 TG/GjmWV+TKi7EBYvBEgTEOz+7i6oMu1bE5W+8KXi/Bc6fFTNtmX49hVGW2BcKtJ2dqaKqgQU80Tj xQrXs1CrNT61uiYxRCjdeA6+Etp8ktPWiOvaQlwQ6tK40x1xF4+/3aGJmCpxpQ62HjpnVT1heYE2S 81ESYt8lQ==; 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 1dAI9p-0006M4-Fn; Mon, 15 May 2017 15:43:37 +0000 From: Christoph Hellwig To: Andy Shevchenko , Amir Goldstein , linux-fsdevel@vger.kernel.org Subject: [PATCH 10/17] afs: switch to use uuid_t and uuid_gen Date: Mon, 15 May 2017 17:43:01 +0200 Message-Id: <20170515154308.26739-11-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170515154308.26739-1-hch@lst.de> References: <20170515154308.26739-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-xfs@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvdimm@lists.01.org, Shaohua Li , linux-kernel@vger.kernel.org, David Howells , Mimi Zohar , Steven Whitehouse MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" 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;