Re: [PATCH] 2.6.8-rc1 fix AFS struct_cpy use which break !X86

From: Vincent Hanquez (tab_at_snarc.org)
Date: 07/14/04

  • Next message: Andrew Morton: "2.6.8-rc1-mm1"
    Date:	Wed, 14 Jul 2004 03:21:10 +0200
    To: Darren Williams <dsw@gelato.unsw.edu.au>
    
    
    

    On Wed, Jul 14, 2004 at 11:07:06AM +1000, Darren Williams wrote:
    > Including Andrew File System on any arch other
    > than i386 and x86_64 will break the compilation
    > due to the use of 'struct_cpy()', which is only
    > define in the two archs above and both archs
    > define it differently:

    struct_cpy will be remove as suggest by AKPM in a recent discussion in LKML.

    > A quick discussion here suggests that we are not
    > doing a deep copy of the struct though others
    > may by able to enlighten us on what happens to
    > pointers within a struct?

    using only *x = *y works.

    > I have applied the i386 definition to ia64 and
    > compiles OK, though I cannot test it since I
    > do not have direct access to AFS.

    Ok, what about the following patch ?

    Index: fs/afs/mntpt.c
    ===================================================================
    --- fs/afs/mntpt.c (revision 1)
    +++ fs/afs/mntpt.c (working copy)
    @@ -257,7 +257,7 @@
             if (IS_ERR(newmnt))
                     return PTR_ERR(newmnt);
     
    - struct_cpy(&newnd, nd);
    + newnd = *nd;
             newnd.dentry = dentry;
             err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);
     
    Index: fs/afs/vlocation.c
    ===================================================================
    --- fs/afs/vlocation.c (revision 1)
    +++ fs/afs/vlocation.c (working copy)
    @@ -906,7 +906,7 @@
                     if (!vlocation->valid ||
                         vlocation->vldb.rtime == vldb->rtime
                         ) {
    - struct_cpy(&vlocation->vldb, vldb);
    + vlocation->vldb = *vldb;
                             vlocation->valid = 1;
                             _leave(" = SUCCESS [c->m]");
                             return CACHEFS_MATCH_SUCCESS;
    @@ -947,7 +947,7 @@
     
             _enter("");
     
    - struct_cpy(vldb,&vlocation->vldb);
    + *vldb = vlocation->vldb;
     
     } /* end afs_vlocation_cache_update() */
     #endif

    -- 
    Tab
    
    

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/



  • Next message: Andrew Morton: "2.6.8-rc1-mm1"

    Relevant Pages

    • Re: m68knommu doesnt build upstream
      ... toolchains for those archs in order to at least test build my changes. ... unsigned long flags, const char *devname, void *dev_id) ... -typedef struct irq_handler { ... extern volatile unsigned int num_spurious; ...
      (Linux-Kernel)
    • Re: DMA APIs gumble grumble
      ... the only breakage here would be for those archs to have some ... drivers start going slowly, though we could expect drivers to have been ... to put things like your dma ops in every struct device. ...
      (Linux-Kernel)
    • [PATCH 304] M68k PCI
      ... like all other archs do ... struct pci_ops; ... In personal conversations with technical people, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: preempt-count oddities - still looking for comments :)
      ... > gcc is complaining about that since preempt_count in struct thread_info ... > thread_info for the different archs, and found that the type used differs ... > __s32, int and unsigned int. ...
      (Linux-Kernel)
    • [PATCH] 2.6.8-rc1 including AFS in ia64 and other ARCHS builds breaks the compilation
      ... than i386 and x86_64 will break the compilation ... define in the two archs above and both archs ... doing a deep copy of the struct though others ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)