From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756154AbYJTRNe (ORCPT ); Mon, 20 Oct 2008 13:13:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754467AbYJTREQ (ORCPT ); Mon, 20 Oct 2008 13:04:16 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:33627 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753895AbYJTRD1 (ORCPT ); Mon, 20 Oct 2008 13:03:27 -0400 Message-Id: <20081020170320.850964000@polaris-admin.engr.sgi.com> References: <20081020170319.539427000@polaris-admin.engr.sgi.com> User-Agent: quilt/0.46-1 Date: Mon, 20 Oct 2008 10:03:28 -0700 From: Mike Travis To: Ingo Molnar , Rusty Russell Cc: Andi Kleen , Andrew Morton , davej@codemonkey.org.uk, David Miller , Eric Dumazet , Jack Steiner , Jeremy Fitzhardinge , Jes Sorensen , "H. Peter Anvin" , peterz@infradead.org, Thomas Gleixner , Yinghai Lu , IA64 , PowerPC , S390 , SPARC , linux-kernel@vger.kernel.org Subject: [PATCH 09/35] cpumask: add cpumask_copy() Content-Disposition: inline; filename=cpumask:cpus_copy.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since cpumasks are to become pointers to undefined structs, we need to replace assignments. Also, dynamically allocated ones will eventually be nr_cpu_ids bits (<= NR_CPUS), so assignment is a definite no-no. From: Rusty Russell Signed-off-by: Rusty Russell Signed-off-by: Mike Travis --- include/linux/cpumask.h | 8 ++++++++ 1 file changed, 8 insertions(+) --- linux-2.6.28.orig/include/linux/cpumask.h +++ linux-2.6.28/include/linux/cpumask.h @@ -64,6 +64,8 @@ * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids * + * void cpumask_copy(dmask, smask) dmask = smask + * * size_t cpumask_size() Length of cpumask in bytes. * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set * (can be used as an lvalue) @@ -351,6 +353,12 @@ static inline void cpumask_fold(struct c bitmap_fold(dstp->bits, origp->bits, sz, NR_CPUS); } +static inline void cpumask_copy(struct cpumask *dstp, + const struct cpumask *srcp) +{ + bitmap_copy(cpumask_bits(dstp), cpumask_bits(srcp), NR_CPUS); +} + /* * Special-case data structure for "single bit set only" constant CPU masks. * --