lkml.org 
[lkml]   [2008]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 09/35] cpumask: add cpumask_copy()
    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 <rusty@rustcorp.com.au>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: Mike Travis <travis@sgi.com>
    ---
    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.
    *
    --


    \
     
     \ /
      Last update: 2008-10-20 19:15    [W:0.022 / U:59.924 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site